Attention Affiliates: Cloak Your Links

It’s no secret: Google isn’t a big fan of affiliate websites.  Look at it from their point of view.  They’re trying to rank the site with the best information.  An affiliate site’s primary purpose is selling a product, so they know you’re going to be saying damn well anything to get people to click on those affiliate links.  Which I’m sure if far off the mark from “quality content.”

Leaving your affiliate links looking how they usually do (i.e.: long and sloppy) is a dead giveaway that you’re an affiliate.  Not only to Google, but to your visitors as well.  If you site is a “unbiased” product review site, you’ll lose credibility when a reader sees that you’re directly making money off the product you reviewed.

So whats the solution?

Cloak those Affiliate Links

Step 1: Create a Sub-folder on your site

This can be easily accomplished by going to your cpanel, opening your file manager, and creating a new folder at the root level of your site.

This is the directory where we’ll place your links, so name it something relevant.

Some examples:

  • www.site.com/products/
  • www.site.com/recommendations/
  • www.site.com/links/

Step 2: Edit your robots.txt

Add a “Disallow” line for the directly you just made

User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /products/

Note: Some WordPress XML sitemap plugins interfere with the robots.txt by overwriting it.  You don’t want that to happen.

Step 3: Open WordPress and Install the Plugin: Redirection

Redirection can be found here.

Once installed, go to Tools > Redirection

For each of your affiliate links, specify how you would like the links to look in the “Source Url” field.  Specify your gnarly affiliate link in “Target URL“.

That’s it.

Note: If you’re an Amazon Affiliate, cloak at your own risk.  Amazon is pretty unforgiving about Terms of Service volations and this is definitely a bannable offence.

Stay Updated!

Get these articles sent straight to your inbox


22 Comments

    • Hey Sean. I haven’t done any testing to actually ‘prove’ that there is a benefit. But on the other hand, by using this technique, I’ve never seen any of the negative effects associated with affiliate sites.

  • Hey matt nice article,, actually i’m doing it with pretty link lite plugin and I didn’t create a folder via my Cpanel and just added my desired url for affiliates in that plugin and done.. but here is a question, I’ve seen some seos aren’t cloaking affiliates links, is there any harm of not doing this? Because I personally think that googlebot still crawls cloaked links but doesn’t index them at all. If Google crawls it then what seo benefit we’ll have by doing this? I know that there is higher chances of users to click on a cloaked link because user doesn’t know that it’s an affiliate link..

    • I differ in the sense that I strongly believe that Google wan’t crawl all the way to the destination of the redirected link. Crawlers are ‘supposed’ to honor the robots.txt file and a lot of times, its in their best interest to. It saves them a ton of data that they need to crawl and maintain in databases. Are they going to give up this huge benefit, just so they can catch some affiliate marketers? Not likely.

      So what happens if you don’t do this? Hard to say, as I’ve been doing it for ages. But I can indeed say from experience in one of the most lucritive affiliate niches, Google hates affiliates, so trying not to look like one is well worth it.

  • Hi Matt! I just discovered your blog today and man… I’m so excited I did! This is full with awesome, non conventional (i.e. awesome) knowledge. Thank you very much for sharing it!

    Regarding this specific post… Isn’t using the Pretty Link plugin the same thing?? Or there’s a disadvantage on using it (Pretty Link). Thanks!

    • Hi Jorge. Prettylink does the renaming (redirection) but it doesn’t handle the blocking of the directory.

  • Matt – how can you tell which XML plugin will overwrite the robots.txt file? I have SEO Yoast plugin on most of my money sites. I want to use the directory method you speak of but want to be sure it will be working…

    • Hi Rob, I don’t use Yoast so I’m not sure. You’re going to have to trial and error and just check the robots file.

  • While this is manual if you want a piece of javascript that google won’t read as a link here you go:
    < a href="void(0);" title="Insert A Title" rel="nofollow" >

    I use it for navigation on sites where I want the link there but don’t want google to see a link on tons of pages. Wait until the page is updated in google cache and look at the text version and you will see it doesn’t see where you are linking. hope it helps

  • Hi Matt,
    Really respect your work and your unfailing attention to detail – masterful!
    My question is using this method but NOT actually creating the subfolder (in my case I am using /go/ ) and doing everything else right – and it still works?
    Does it auto-magically populate the subfolder or something?
    Just wondering why it works when I forgot to create the subfolder for a site but the links still work?
    Bren

    • Hey Bren, it works because just like anything with URL language, you can specify a path to any file with the intermidary directories existing. Nonetheless, uou want to create the subfolder because you want to be able to block it, and everything in it, from the crawlers.

  • Regarding step 1: What to put in the root directory? The affiliate links (target urls) or source url? A picture from the subfolder would make this easier to understand.