user1452114
user1452114

Reputation:

Hide content to Googlebot

If I want to hide some content on Mozilla Firefox, I use this code:

<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') == FALSE) { ?>
Hide only in Mozilla
<?php } ?>

My question is, how to hide some content to Googlebot?

Upvotes: 2

Views: 8909

Answers (3)

Ilia Ross
Ilia Ross

Reputation: 13412

Another solution is to prevent Googlebot from following any links on a page of your site, is to use the nofollow meta tag.

To prevent Googlebot from following an individual link, add:

rel="nofollow" 

attribute to the link itself.

Upvotes: 0

You can detect googlebot based on user agent some thing like

You can find list of User-Agents at http://www.useragentstring.com/pages/Crawlerlist/

For Googlebot :

if (strpos($_SERVER[‘HTTP_USER_AGENT’],"Googlebot")) { // do some functionality }

But It's a bad idea to hide elements for google, google is smart and you could definitely get punished for this.

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=66355

Upvotes: 6

room13
room13

Reputation: 1922

you need to put a robots.txt file on your webserver and configure it to exclude the googlebot or all search engines. a good description on how that works can be found on www.robotstxt.org

Upvotes: 1

Related Questions