Every day I browse the web and find sites with affiliate links that are uncloaked. It puzzles me quite a bit. Usually I move on, chuckle to myself, and continue to be meticulous about my affiliate link handling and onsite usage.
But today is different, today I’m going to give back to all my fellow affiliates and SEOs with an easy to follow tutorial on how to cloak affiliate links right in your WordPress admin. A method so easy that there is absolutely no excuse for having an uncloaked link much less a raw affiliate link anywhere on a site you’re trying to rank.
If you have raw links, I beg you, after reading this please go cloak them immediately.
My method is simple and easy to execute. It can very easily be used to train a VA so they can go monetize sites for you. Which is a nice bonus.
Without attempting to go into the theory behind affiliate link cloaking, SEO, and what Google can and can not see, I have concluded that this is the best method out there for getting it done in a manner that should be an industry standard.
There are two pieces to the affiliate link cloaking puzzle and all are handled via plugin in WordPress.
Let’s Cloak Some Affiliate Links
There are three main elements to proper affiliate link implementation.
1. Modify our robots.txt file to disallow a specific subfolder where our affiliate links will reside.
2. Use WordPress redirection plugin to create 302 redirects.
3. Parse links with a rel=”nofollow” tag.
Part 1. Hopefully you know your way around FTP, you will be modifying your existing or creating a new robots.txt with the following line.
Just simply type in whatever folder name you choose in place of “/subfolder/” and Google will now be dissuaded from crawling or indexing that folder.
If you don’t like FTP, then there is a plugin that will save you.
The plugin will create a robots.txt file for you if you do not already have one. If you do have one already and are using SEO Yoast for example, then you can modify the file within the yoast admin. It’s under the “edit files” tab.
Here are some suggested directory names brainstormed via Twitter.
/go/ /jump/ /download/ /likes/ /loves/ /recommends/ /r/ /visit/ /out/ /p/ /dl/ /refer/ /partner/ /ext/
Then from the smart asses.
/billstopay/ /pleaseconvert/ /makemerich/ /bob/ /mattcutts/ /showmethemoney/ /cashcashcashfuckyeah/ /pleasedontcrawltheselinks/ /plzbuy/ /ineednewshoes/ /hurryupandbuyalready/
Part 2. Now that the important part is out of the way it’s redirect time.
Start by installing WordPress Redirection Plugin. This is what we will be using to handle the redirects.
Chances are you have used redirection plugin before, but you probably haven’t set 302 redirects.
First create the redirect using the folder we just disallowed and whatever you’d like to name the link.
Easy right? Now after you make the redirect, click the drop down and change the HTTP code from the default “301” to a “302”.
If you’d like to take a look at the HTTP status code definitions then go here.
Why 302? Because we don’t want to give Google’s dumbass any chance to pass authority through that affiliate link.
News flash, Google doesn’t like affiliates, especially affiliates who spam rankings. So get your game tight and cloak those damn links, don’t give them any easy wins.
And if you were wondering about 302 vs 307 redirects for affiliate links, I might I have this one figured out (this puzzled me). So here is the first sentence of the definition from W3.org.
302: The requested resource resides temporarily under a different URI
307: The requested resource resides temporarily under a different URI
Yeah, hrmmm. The only difference I can see is a 302 redirect is HTTP 1.0 compatible and 307s are only HTTP 1.1 compatible. Yup, I’m just as lost as you are. Well Yoast says go with 302 so that’s what we’ll do.
Also in redirection plugin setting make sure to turn off the 404 logs to avoid any problems with log build ups..
It’s Video Time Kids
Tweetsourcing on the Affiliate Link Cloaking Best Practice:
Yup, just as I thought. Thanks for backing me up Krystian.
@IMJacobKing i nofollow and link to redirects and 302 via htaccess and robots.txt out the folder of the redirects. I know, paranoid.
— Krystian Szastok (@krystianszastok) September 19, 2013
A bit more advanced method, not really sure what this means.
— Giuseppe Pastore (@Zen2Seo) September 19, 2013
And another play.
— Chaos SEO (@ChaosSEO) September 19, 2013
There are some paid plugins out there for managing affiliates links that offer way more functions but they are for bigger sites mainly.
ThirstyAffiliates – ThirstyAffiliats is quite similar to PrettyLinksPro, compare them side by side to get a better idea of the differences.
LinkTrackr – This is more of an affiliate link management/link tracking service.
They also offer free versions in which you can handle the simple cloaking redirects and some of the advanced redirects. But remember they will not edit your robots.txt file for you!! Google indexes all kinds of dumb shit so we need to make sure that doesn’t happen with our affiliate link urls.
The term “cloaking” affiliate links might be a bit misleading so we’ll assume that Google still crawls and identifies affiliate links set up in this manner.
Sure there are plenty of other sneaky ways to hide affiliate links from Google but I don’t recommend playing with them unless you know what you’re doing.
Good sites have affiliate links too, so don’t get the wrong idea, they just know the “right” way to set them up. Clean, user friendly, and signalling Google and SEs to disregard them. Now go have an affiliate link dropping extravaganza and don’t forget to nofollow those bastards.