Detecting Google Bot to hide content - dangerous practice?

RBKing

Registered Member
Joined
Sep 23, 2012
Messages
81
Reaction score
21
I've been looking into various ways to reduce duplicate content on a client's website.

One method I've read about is using some code inline to check whether the client is a certain bot, or not. Using this information I can choose whether or not to display content to the client.

Would this be frowned upon (if detected) in Google's eyes?


Note: this is in-page content inclusion/exclusion. Here's the code (PHP), for information:

Code:
if(!strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot")) {
     <p>displaythis</p>
}
 
It is called cloaking and will work for some time, but your site will be inevitable banned. Even if you detect google bot by IP (I for one have full list of google subnets) they will catch you via Google Toolbar and Chrome browsers of your visitors.
But for some time, sometimes days sometimes months, it may work.
 
Perfect answer, thank you.
 
Back
Top