Your masked affiliate links aren’t fooling Google

One common piece of advice that SEOs give to affiliate marketers (see here and here) is to mask their affiliate links by following these steps:

  1. Setup a 301 redirect (ie: redirect yoursite.com/affiliate to affiliatesite.com)
  2. Block the redirected page through robots.txt
  3. Add the nofollow attribute to all affiliate links

The idea is to make it look like you’re linking to internal product pages, when you’re really linking to an external site. Then you’re adding nofollow and /disallow directives to keep Google from discovering that you’re linking offsite.

It sounds like a good idea in theory, right? I mean, how could Google know that a link redirects if they can’t follow it or crawl it?

The truth is, there are some advantages to running your affiliate links through redirects (more on that later). But if you’re trying to fool Google by masking your affiliate links in this way, the fact of the matter is that you’re wasting your time.

Google can see right through you

Before we dive in here, I need to clear up some common misconceptions about how Google works.

Nofollow attributes on links tell search engines not to give editorial credit to the links. But the spiders will still follow the link and discover the page on the other side. So you’re not stopping the crawl by adding a nofollow attribute to your affiliate link.

Robots.txt disallow commands tell Google not to crawl a page. That’s it. They will still index the page, and they can still tell if the page is redirected without crawling it. This is how:

HTTP headers are sent from your server each time a file is requested. These headers return status codes that communicate whether or not the document exists, or if it has been moved (redirected).

Now, Google can check HTTP headers without crawling a page. In fact, you can do the same thing yourself with just two lines of PHP (try it out for yourself if you’re curious — just replace the value of the $url variable with your own affiliate url):

$url = 'http://google.com'; 
var_dump(get_headers($url,0)); 

When executed, the above code will return a response that looks something like this:

/*array(18) { 
  [0]=>  string(30) "HTTP/1.0 301 Moved Permanently" 
  [1]=>  string(32) "Location: http://www.google.com/" 
  [2]=>  string(38) "Content-Type: text/html; charset=UTF-8" 
  [3]=>  string(35) "Date: Mon, 30 Jul 2012 00:59:50 GMT" 
  [4]=>  string(38) "Expires: Wed, 29 Aug 2012 00:59:50 GMT" 
  [5]=>  string(38) "Cache-Control: public, max-age=2592000" 
.... 
  string(15) "HTTP/1.0 200 OK" 
  [10]=>  string(35) "Date: Mon, 30 Jul 2012 00:59:51 GMT" 
  [11]=>  string(11) "Expires: -1" 
  [12]=>  string(33) "Cache-Control: private, max-age=0" 
..... 
}*/ 

See how the header communicates that google.com 301 redirects to www.google.com? With two lines of code, even a well-behaved bot that honors robots.txt could discover that your ‘sneaky’ redirect is a 301 affiliate link.

In short, your masked links aren’t fooling anyone. But they can still be worthwhile to implement.

Good reasons to redirect affiliate links

Even though your redirects aren’t fooling Google, there are still a few good reasons why you might want to implement them:

1. Click tracking. By running your affiliate links through an internal redirect, you can track the number of times that visitors click on your links. This is necessary information if you want to calculate your own conversion rates (GoCodes is a popular WordPress plugin that will do this for you).

2. Pretty URLs. Some affiliate programs (I’m looking you, CJ), provide incredibly ugly URLs like fewrxrk.com/32535346342. Your users don’t want to click on that link, because they have no idea what’s going to be on the other side. An internal redirect can help entice clicks.

3. Privacy. Many affiliate programs include your affiliate ID in the links that they give you. If you use the same ID on multiple sites, it can make it very easy for people to discover all of the affiliate sites that you’re running through a simple Google search. By not including the ID on your page, you can make it a little bit harder for them.

a picture of kevin spence.by: Kevin Spence

Kevin Spence built his first website in 1999. These days, he builds all of his sites on WordPress using the Genesis Framework, and manages them using these tools. Follow him on Twitter.

Get Email Updates

Sign up to receive email updates each time we publish a new SEO or WordPress tip (normally 2-3 times a week).


Comments

  1. Rob Woods says:

    As far as “Good reasons to redirect affiliate links” another reason is that I’ve actually seen Google recommend that you do this, I suspect because the theory is that they don’t want to spend resources following affiliate links.

    Also I think a good point for newcomers is that while there are good ideas for masking and blocking crawling of affiliate links, if you’re with the big affiliate programs, Google already recognizes those URLs as such and likely won’t spend time following them anyway.

    • kevinmspence says:

      Interesting. Do you have a link to a place where Google recommends masking the links? I’d like to link to it in the post if you can find it.

      • Rob Woods says:

        I’ll look for those tonight. :) I run some sites with a lot of aff links and I found it a while back going through their quality guidelines but I notice a bunch of the pages were updated in May. I’ll see if I can find it.

  2. Rob Woods says:

    One other benefit – If you have to update all your links for some reason it’s a lot easier to update the redirects (generally) than to find and update all the links in your html.

Speak Your Mind

*