How can I hide certain text from search engines?

On my WordPress blog, I have “Added ? Days ago” for every post. I have 10 posts on my homepage. Therefore, according to most keyword analysis tools, “days ago” is a keyword on my blog, but I don’t want it to be. How can I hide these words from search engines?

I do not want to use Javascript. I can easily use PHP and the $_SERVER , but I'm afraid I might get punished for cloaking. Can I use an HTML tag or an attribute like rel="nofollow" ?

+6
source share
5 answers

What I found on the wiki :

For Yandex :

 <!--noindex-->Don't index this text.<!--/noindex--> 

For Yahoo :

 <div class="robots-nocontent">Don't index this text.</div> 

For Google :

 <!--googleoff: index--> Don't index this text.<!--googleon: index--> 
+4
source

From Is there a way for search engines not to index a specific section of a page?

Presumably you can add the robots-nocontent elements on your page, for example:

 <div class="robots-nocontent"> <p>Ignore this stuff.</p> </div> 

Yahoo respects this , although I do not know if other search engines respect this. Appears Google is not supporting it at this time. I suspect that you are uploading your content via ajax, you will get the same effect from it is not present on the page.

and

There is no general way to do this and I personally would not bother with it. Search engines are pretty good at recognizing relevant content on pages, and although this content may appear in keywords that search engines have found, this does not mean that it will make the page relevant for these keywords.

If you have a page about "Fish" and a page about "Dogs" (which has a link to the page "Fish" somewhere in the sidebar), search engines will usually be able to recognize that the page about "Fish" is much larger more relevant to "Fish" than the page about "Dogs" which mentions "Fish" in the sidebar. It is possible that both pages can be found at some point, but as a rule, the page from the site is shown in the search results, so there is nothing to worry about.

There is no need for this, and search engines are most likely just if you try (for example, if you use JavaScript to hide content, you never know when search engines will begin to detect that the content is independent). Similarly, using iframes with robots.txt prohibits or AJAX often degrades the quality of your pages for users (slow it down or make it less useful on various devices), so if this is a very, very strong and proven reason that you need to do this, I would highly recommend not to worry him.

+3
source

Linksku, I'm sure you should not worry about this particular piece of text. Our algorithms do a relatively good job of detecting template text. As far as I can tell from your question, this text is a template, and we probably already know that.

Regarding the discovery of the Googlebot robot and does not serve for this text, you are right, that would be cloaking, and you should never do that. In this case, if you hide this text from us, it will also be difficult for us to determine its template, and you will eventually do exactly what you are trying to avoid :)

+1
source

I worked on this and published it at: http://www.scivillage.com/thread-2580.html

This should work, but it would be more useful to evaluate it and the feedback.

  .x:before{ content:attr(title); display:inline; } 
 <ul> <li><a href="#"><span class="x" title="Homepage"></span></a></li> <li><a href="#"><span class="x" title="Contact" /></a></li> </ul> 

(I shortened the class name to reduce markup)

Search engines should ignore HTML tags with empty values ​​when searching for keywords, this should mean that it ignores what is written in the title attribute. (He assumes that the value is what matters if it is empty, then there are no dots checking the attributes)

It has been suggested that it is possible to deny the existence of a closing tag in HTML5 due to limited stringency, however, there are counter suggestions that end tags are still required.

I would suggest not using it directly in tags (anchor), as they can be used for Sitemaps (using #), so that means they would like Title Spidered.

Although it is possible that he might suggest that any content in the headline should inflate keywords with hidden elements, I cannot confirm this.

+1
source

HTML:

 <div class="hasHiddenText">_</div> 

It is important that you leave the character with no spaces between the element with hidden text.

External CSS:

 .hasHiddenText{ content: "Your hidden text here..."; /*This ovewrites the default content of the div but it isn't supported by all browsers.*/ } .hasHiddenText::before{ content: " Your hidden text here..."; /*Places a hidden text above the div.*/ } 

"Hidden text" refers to content that is hidden to all search engines, but visible to visitors.
You can also use nextline and all kinds of Unicode characters, escaping them with \ uXXXX. To display line breaks correctly, be sure to add

 white-space:pre-line; 

properties.

0
source

Source: https://habr.com/ru/post/892070/


All Articles