Birthday Bash Giveaways | Mobile Buzz | Gadgets Buzz | Write For Us / Guest Post
12
Nov

Save your site. Hide Paid Links From Google Bot

Related Content

Comments

Save & Share

Recommend

Search Content

Top Posts

I'm Feeling Lucky

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.

Browse Related Articles




Bookmark/Add Subscribe


Did not find what you were looking for? Try searching for what you were looking for.



13 Responses so far | Share Your Opinions!

  1. Ryan Wagner
    November 12th, 2007 at 9:28 am #

    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.

  2. Binny V A
    November 12th, 2007 at 9:41 am #

    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.

  3. keith
    November 12th, 2007 at 12:12 pm #

    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

  4. Ashfame
    November 12th, 2007 at 12:45 pm #

    Nice trick Keith! Commented to get followup comments via e-mail.

  5. Kyle Eslick
    November 12th, 2007 at 9:27 pm #

    Well said Keith!

    Stumbled!

  6. Alfred
    November 13th, 2007 at 5:14 am #

    bookmarked will definitely come in handy someday

  7. CypherHackz
    November 13th, 2007 at 5:57 am #

    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.

  8. Juan
    December 13th, 2007 at 5:00 am #

    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 :))

  9. Anonymous
    December 24th, 2007 at 3:26 pm #

    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
    }

  10. Blue Licorice
    April 18th, 2008 at 3:53 am #

    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 :)

  11. Colleen
    May 9th, 2008 at 9:39 pm #

    I would not do the javascript one…they can find it.

Trackbacks

  1. Links for 12-11-2007
  2. Bend over and take it from Google | Dot Com Mogul

Leave a Comment

Note: We discourage users from using keywords in their names while posting comments, most of them get caught by spam, also it really would be more fruitful in knowing people who comment by their real name, rather than by using a name no one relates to. In future we reserve the right to delete comments from users using a name other than their own.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Subscribe Get Regular Updates From Techie Buzz
Twitter: @keithdsouza | @techiebuzzer