There are two main reasons why you would want to hide your affiliate links from Google:
- They “leak” link juice;
- They say, Google hates affiliate links because they show to Google that the site’s content is “second-hand”
So, we are running into the dilemma here: we want to monetize Google traffic and we don’t want to risk our reputation. Two main strategies to use are (note: to avoid link juice leak, the combination of these strategies can be used):
| Example | A Disadvantage | |
| rel=”nofollow” | <a href=”http: //affiliatesite.com/productID&yourtracking/” target=”_blank”>name</a> | People are still not sure how Google (as well as other search engines) treats nofollow attribute |
| Any type of redirection + Disallow directive in Robots.txt | <a href=”http: //yoursite.com/visit/nameoftheaffiliate/…”> name</a> + Disallow /visit/ directory in your Robots.txt file | Not really user-friendly: people might expect to go to the same-site page (but instead they are re-directed to another domain) |
How do you hide your affiliate links? Please share your opinion in the comments!


This is more or less exactly what I do on one of my sites. I use a WP plugin to redirect the links and nofollow on those links. I hadn’t thought of including it in the robots file too, that’s a good idea.
[Reply]
You can also use javascript and not use anchors…. Google won’t follow those “links” because they are not actual links, but the user will be able to click on them and follow the affiliate site.
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:20 pm
And what is if the user has JavaScript disabled? For the sake of accessibility you should use a “noscript” tag. And the the link should be static. So I do not consider that as the ultimate solution.
[Reply]
If I can choose I mix 4 ways:
- Create affiliate link with javascript
- This link must be nofollowed
- This link should be redirected (using a directory as base)
- I block the /red directory with robots.txt
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:31 pm
If you use javascript for the link with nofollow, why do you need the last two options? More code? Or more work?
[Reply]
What about the solution I posted at WPW? http://www.webproworld.com/search-engine-optimization-forum/78553-new-canonical-tag-big-3-a-4.html#post440204
[Reply]
Ann Smarty Reply:
September 19th, 2009 at 7:20 pm
Thanks, John, for linking to that awesome discussion.
[Reply]
Now Google does craw Javascript.
Here is a useful video from Matt Cutts of Google, on how to handle paid links in javascript.
I guess Fabio has covered it all.
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:21 pm
You came too late buddy, or you did not read my previous comment.
[Reply]
Ann, I am glad you did not mention using JavaScript. And here I explain why: http://www.webproworld.com/google-discussion-forum/91252-breaking-news-google-can-crawl-paid-links-implemented-using-javascript.html
[Reply]
I prefer the combination of JavaScript and Doorway internal page per vendor. Of course I also disallow the Doorway page in robots.txt and it works great…
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:26 pm
That does not work so fine as you are claiming. Linking to a page which is disallowed via robots.txt you are creating a dead end, otherwise called dangling node pages. That means you are not passing PR to the sites you link to, but your page is leaking PR.
Still there is a solution for that.
[Reply]
With dynamic links I use a php page that is disallowed in the robots text file. when a customer clicks the link it sets up the link by pulling the data from the database and is then redirected using a meta refresh after telling the customer that they are about to be redirected to the vendors website
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:36 pm
Two questions Steve:
1. When visit the PHP file, does that page have visible content?
2. What is if a user has disabled meta refresh in his browser? I do that for example.
[Reply]
Which one you prefer best, Ann ?
[Reply]
Ann Smarty Reply:
September 20th, 2009 at 7:16 pm
I mainly use redirection + Disallow Robot.txt directive
[Reply]
John S. Britsios Reply:
September 20th, 2009 at 7:27 pm
Ann can you be more specific how do you do that?
[Reply]
You should know that Hiding your affiliate links increase the CTR(click through) because people will not see a long link making no sense.Nice informative post.Thanks a lot for sharing this post with us.
[Reply]
And what is if the user has JavaScript disabled? For the sake of accessibility you should use a “noscript” tag thanks.
[Reply]
John S. Britsios (aka Webnauts) Reply:
September 22nd, 2009 at 4:03 pm
If you use “noscript”, then Google will see the link and follow it. So is that the solution? I assume not.
Thanks too.
[Reply]
If you are hosting on an Apache server and you do not want google to index and don’t follow the scripts and the links in them, and you have permissions to edit your .htaccess file, you might simply need to add the following lines there:
Header append X-Robots-Tag "noindex,nofollow,noarchive,nosnippet"
How about that?
[Reply]
Sorry but the code did not display in full as I have posted it. See here what I am about: http://www.webproworld.com/google-discussion-forum/91252-breaking-news-google-can-crawl-paid-links-implemented-using-javascript.html#post466614
[Reply]
O Great! The simplest way to hide affiliate links from Goggle is to make them no follow. Thanks for the tips.
[Reply]
Good run down, I think Google has been more prone to giving away page rank recently, so you have to be careful how often you link out and to whom.
[Reply]
That does not work so fine as you are claiming. Linking to a page which is disallowed via robots.
[Reply]
I mainly use redirection + Disallow Robot.txt directive.
For some types of creatives I also use iframes.
[Reply]
I usually create js file that contains a function that link to some specified link (Ex.: onclick=”myfunction(’myurl’);”).
To avoid Google from following the javascript links, I make the function request two parameters, spliting up the URL (Ex.: onclick=”myfunction(’myurlpart1′, ‘myurlpart2′);”).
Then, I disallow the js file in robots.txt.
(
Ex.: I want to link http://www.google.com:
myfunction(’gle.com’,'www.goo’);
myfunction should make it work.
)
*Of course, users with javascript disabled will not see anything happens, but taking into account analytics reports, that says that only 3% of users has no javascript support, I woudn’t care that much.
[Reply]
John S. Britsios (aka Webnauts) Reply:
September 30th, 2009 at 10:00 pm
But I do care about the 3% as that is equal to approx. 330 unique visitors per month in a low trafficed month.
[Reply]
Vinicius B P Reply:
October 1st, 2009 at 3:11 pm
Another thing that I have already done is exactly one of Ann’s suggestions: Any type of redirection + disallow directive in Robots.txt.
To make it a little bit more user friendly, the page responsible for redirecting does not redirect to anywhere, but warns users that they will be redirect to another domain and they can choose between being redirected or going back to where they were.
(
Actually, I combined this technique with javascript. Users with javascript enabled would see an float element asking if they want to be redirected. Users with no js enabled would see the page.
)
[Reply]
For wordpress sites I use the GoCodes plugin, mainly to obscure the link from the user’s status bar. As a bonus it logs the click count.
It displays the path form
siteRoot/GoFlag/pruductName/
The author definable GoFlag term causes the redirect to GoCodes wher the real address is found through the pruductName index.
[Reply]
It’s a good idea to redirect and not show the affiliate link to google. also do not use text from the main site, or if you do, show just 100-150 chars.
[Reply]
I’m a fan of the server-side redirect method when possible.
[Reply]