S
S
softshape2014-05-18 05:56:10
JavaScript
softshape, 2014-05-18 05:56:10

How to hide JS templates from search engines?

Hello everyone,
on my HTML page, a template for a JS template is inserted in a regular but hidden way. The syntax is something like this -

{% if admin and filter == 'new' %}<span class="caption"><a class="ajax" href="{{ post.url }}publish-ajax/?lenta=yes" data-callback="$('.item{{ loop.index }}').hide()">Разрешить публикацию</a> &middot; <a href="{{ post.url }}edit/">Редактировать</a></span>{% endif %}

Notice the href="{{ post.url }}publish-ajax/?lenta=yes".
The template itself is invisible to the visitor, but search engines see it. And they try to download pages with the address {{ post.url }}publish-ajax/, naturally bumping into 404. The
question is, what is the best way to hide such JS templates from parsing by search engines?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Lebedev, 2014-05-18
@swanrnd

robots.txt

A
AgentSIB, 2014-05-18
@AgentSIB

https://support.google.com/webmasters/answer/93710...
help.yandex.ru/webmaster/controlling-robot/html.xml

S
softshape, 2014-05-18
@softshape

robots.txt won't help. the template is inserted into a regular HTML page (there was also the word DIV but it was eaten by the Toaster parser).
But <noindex> - that's it, but unfortunately only for Yandex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question