Preventing Google from indexing the contents of a div by reversing the string
Asked Answered
U

6

21

I want to prevent that Google indexes the contents of one <div> on my page. Of course I can create an image but that's not really an option in my case since the data is very dynamic.

So, I came up with the following solution:

Let's say that I have a string:

The quick brown fox jumps over the lazy dog.

  1. I reverse the string to: .god yzal eht revo spmuj xof nworb kciuq ehT
  2. I use a little bit of CSS to display it correctly: unicode-bidi:bidi-override; direction: rtl;

code:

<div style="unicode-bidi:bidi-override; direction: rtl;">
  .god yzal eht revo spmuj xof nworb kciuq ehT
</div>

Question: Will this affect my SEO rank negatively because Google's crawler reads:

.god yzal eht revo spmuj xof nworb kciuq ehT

..which is rubbish in English

Unilingual answered 3/7, 2012 at 23:4 Comment(5)
Since no-one can say for sure what is google page-rank algorithm, I believe that this question cannot be answered.Skald
Well, there are some Google guys here so let's wait, hope and see if they gonna answer this. If you never ask, you'll never know. I gonna send a link to this question to Matt Cutts :pUnilingual
L0L, Matt Cutts is the "inner guy" indeed... youtube.com/watch?v=b7W0o65tTIQSkald
Messing up the writing direction does look right to me. Maybe some alternate solution for preventing part of the content to be indexed would be more suitable. See there for alternates.Syphon
Do you have any answer here ? I want to do the same thing and avoid indexing <divs that are rendered by adsense or other advertising tools. It makes no sense for google to crawl and index themSerena
U
12

I asked on Google forums and the answer is: It doesn't

Unilingual answered 1/8, 2012 at 23:10 Comment(0)
B
9

I want to prevent that Google indexes the contents of one on my page

Then I think you shouldn't put that content on the page, period.

You could try using the googleon/googleoff tags, per this article:

Tell Google to Not Index Certain Parts of Your Page

<!--googleoff: index-->
don't index this content
<!--googleon: index-->

Then again, I find this article which states that it isn't possible:

http://productforums.google.com/forum/#!topic/webmasters/qrBI_v-N4N0

How to tell Google not to? =============

You don't!

If it is content, If it is part of that page, then it Will be Crawled, and may be Indexed and Ranked

You cannot use a Meta-Tag, or a HTML tag to tell Google to ignore, discount, not use, refer or touch part of your content.

Bonze answered 5/7, 2012 at 1:24 Comment(4)
"Then I think you shouldn't put that content on the page, period." Well, if you display: [email protected] on your page, you get a lot of spam. If you display it like: <div style="unicode-bidi:bidi-override; direction: rtl;">moc.elpmaxe@ofni</div>, you don't get any spam at all!!Unilingual
@Mr.Pallazzo Your question is about how hiding content will affect SEO, not about obfuscating email addresses. Email addresses are not dynamic, are they?Bonze
googleoff/on are not supposed to have any effect on Google web-search, but only on Google Search Appliance (self hosted). See this answer.Syphon
I've got a page with a multiple choice question (about an image) on it. Google is returning the image for queries about the wrong answer because it the text appears near to the image.Mroz
S
9

Updating this thread. While google will still crawl and index, you can prevent it from showing up in search results with data-nosnippet attribute in the HTML. Can be used in <div>, <span>, and <section> elements.

Example: <p><span data-nosnippet>Harry Houdini</span> is undoubtedly the most famous magician ever to live.</p>

See here

Swathe answered 27/9, 2019 at 21:45 Comment(0)
T
1

I used server side codes to hide div from googlebot

<?php if(self::isNotGoogleBot()):?>
<div id="noindex"></div>
<?php endif?>
public static function isNotGoogleBot()
    {
        $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
        if(strpos($ua,'googlebot') === false && strpos($ua,'mediapartners-google') === false)return true;
        return false;
    }
Tristichous answered 20/9, 2018 at 7:51 Comment(1)
can you please tell more about it? Does it still work? Didn't you get penalized?Microcurie
M
0

Your question is a bit unclear. You should clarify if you are concerned about negatively or positively affecting your rank.

I don't think one can fully know if using your method will affect your SEO rank either negatively or positively. Will your rank be penalized for using reversed text? Maybe if you are stuffing keywords or other spammy type content in the div. It is quite possible that Google's crawler can interpret your CSS and read the text anyway, as it was meant to be read.

Another option that might work to prevent Google from crawling a specific element is to use javascript. For example, place the javascript below in an external JS file and link to it in the head or bottom of your web page.

<script>
function jsText() {
  document.getElementById("noindex").innerHTML="The quick brown fox jumps over the lazy dog.";
}
</script>

Then use the following for the div where you want the hidden text to be displayed.

<div id="noindex">
  <script>
    jsText();
  </script>
</div>

This should write the text in the div via javascript. Google can also crawl javascript so it might still find the text and index it. To further reduce the potential that Google will crawl the javascript you could exclude the javascript file in robots.txt as well.

Milicent answered 3/7, 2012 at 23:57 Comment(1)
The answer is outdated, Googlebot runs JavaScript.Forayer
S
0

Wouldn't it be possible for you to create a new html file where you put the text and the metatag

<meta name=”robots” content=”noindex”/>

Then you can just include the html with iframe or something similar on your main page.

Skater answered 5/10, 2018 at 6:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.