How To Show Different Content For Google Spider

Before applying this technique you should be aware that Google does not recommend to do it at all. They say that sites presenting googlebot different information that to the human eye from the SEO purposes will be penalized. However, there are some cases when you might want to hide certain information from being too public in Google index. For example certain phrases from your page could lead tons of spammers into your site. You could simply hide tricky portions, serving a another version to the google bot.

Here it is how:

<?PHP if(stripos($_SERVER['HTTP_USER_AGENT'], "google") === false) { ?>

//  this is seen by the regular users

<?PHP } else { ?>

// this is seen only by google spider

<?PHP } ?>

To test the page you can follow this link to test how the page looks when the googlebot reads it and insert the following user agent before opening the page:

Googlebot/2.1 (+http://www.googlebot.com/bot.html)

Check this for a list of possible googlebot user agents.

Leave a Reply

Your email address will not be published. Required fields are marked *