Save your site. Hide Paid Links From Google Bot
I know the discussion over paid links and Google has been over done. I had suggested a simple trick to overcome being penalized by Google earlier. Here is one more trick that you can use to avoid being penalized by Google. This trick is much better than the nofollow links and will keep both the advertisers and Google happy.
Before we get to the trick lets have a look at why you should use this trick and not a nofollow link.
Publisher the Loser
As a publisher you are caught between selling paid links and following Google standards whichever way you look at it you will be the loser. Many advertisers simply decline to have a nofollow in the links. This on the other hand could get you penalized by Google itself.
So you are caught in the middle of something that you cannot face or fight. You have to give into demands from either one of them. Lose you will but having to decide which way to go is much more difficult.
Why Not Use Nofollow?
Like I said earlier many advertiser are really not going to allow you to use nofollow for paid links, if you are small or medium sized publisher then it gets worse. More of the big time publishers can convince their advertisers to allow them to use nofollow.
Now lets get on to the trick.
What is the trick?
The trick is a simple layer of code, you can use with PHP, ASP, JSP and Javascript to hide or show your advertisements. The eventual result is that they do not display your paid links if Googlebot is visiting your website. In this way you will not be showing those links to the Googlebot and disallowing them to follow those paid links. You keep your advertiser happy and also take precaution against getting banned due to selling paid links.
Lets have a look at the code, its not rocket science but a simple condition you have to put before showing up the ads.
For sites running with PHP as the processing language.
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if(stristr(strtolower($userAgent), 'googlebot') === FALSE) {
//NORMAL USER BROWSING SHOW THE ADS
//<!-- Your PAID Ads Code -->
}
else {
//THIS IS GOOGLE BOT DO NOT SHOW PAID LINKS HERE
}
For sites running ASP as the processing language.
$userAgent = Server.GetVariables("HTTP_USER_AGENT");
If Not InStr(LCASE($userAgent), "googlebot) Then
'display ad code here
Else
'do not display ad code here
End If
For sites running JSP as the processing language
<%
String userAgent = request.getHeader( "User-Agent" );
if(userAgent.toLowerCase().indexOf("googlebot") != -1) {
//display your ads here
}
else {
//do not display your ads here
}
%>
Common solution for site running any processing language using JavaScript.
if(navigator.userAgent.toLowerCase().indexOf("googlebot") <= -1) {
//display ads here
}
else {
//do not display ads here
}
As you can see in the above code examples, first you have to store the user agent in a variable and then make a check it is the Googlebot that is visiting you. If we have Googlebot visiting your site, you simply do not display the ads. You can ofcourse change and add other agents to the list using && operators.
In the above examples I have lower cased all the user agent strings such as to avoid variations in the user agent for Googlebot. It could be GoogleBot, Googlebot, googleBot, googleBOT or anything else. By changing the text to lower case we ensure that we are always searching for googlebot.
This is just a simple trick I suggest to tackle any problems for getting penalized from Google. Before using this I would suggest you contact Google and check their response on it. I should not be held responsible if you use this trick.
If you think this was helpful do leave me your comments on it, I am always looking forward to it.
Welcome! to Techie Buzz, it seems that you are new to this site. If you want to get regular updates you can signup to get email alerts or subscribe to the RSS feed.
Do check out our About page to know more about our blog. We also apprecaite your views and comments on this blogs. Thanks for visiting!!.
Related Articles
Find More Interesting Content.









Technically that is even worse to do though, and I wouldn’t be recommending it to anyone. Sites that show different content to the Google Bot have been known to be removed from the Google Search Results all together.
Hey Ryan,
The problem is that Google will penalize you if you have paid links, I have sent an email to Google asking them to verify if this is possible to do.
The main reason is that they do not want you to have paid links and advertisers do not want to have nofollow. Since anyways the links will be irrelevant to the Google bot it could be easily hidden from them. In one way you are trying to get to the best of both sides.
I do not suggest anyone use this before consulting Google first. Also you are not cloaking when you are hiding links from the SE robots you just tell do not want them to follow it. If advertisers are happy to use no follow well and good but if they do not then what does the publisher do?
Keith
It is a good solution - this is almost equal to using the ‘nofollow’ attribute value. The only issue is, the people who sell the link may disagree with you.
@Ryan
Google allows you to show different content to the bot for some valid reasons - and I believe that this is a valid reason. I am sure google will agree.
Nice trick Keith! Commented to get followup comments via e-mail.
Well said Keith!
Stumbled!
bookmarked will definitely come in handy someday
The trick is same like no-follow but just do it in different way. Infact, the advertisers also will not get the linkback in Google because when each time Googlebot comes in, it can’t see the links and can’t update the linkback. That is just my opinion btw.
GREAT STUFF MY MAN!!!! Do you realise what can REALLY be done with this?
I can’t tell of course, cause if I do MrG will know too :))
Google has several bots. You’re only eluding the Googlebot. Beside the regular googlebots, there’s
mediabot - used to analyze AdSense pages
user agent “Mediapartners-Google”
ImageBot - crawling for the Image Search
user agent “googlebot-Image”
AdsBot - checking AdWords landing pages for quality
user agent “AdsBot-Google”
Using your code will definitely get you busted when say, the Adsense bot or image bot come crawling… If you want to be a real ace hacker, here’s the dope PHP code to protect against them all…
if ( ! preg_match(”/google/i”, $_SERVER['HTTP_USER_AGENT'] ){
//NORMAL USER BROWSING SHOW THE ADS
}
Where does this code get put?
I tried the no follow but became worried and removed it. I forgot to take some of them off and every one of those was denied from my ad provider. No, they don’t like the no follow code
I would not do the javascript one…they can find it.