Best way to hide and cloak your affiliate links?

by Yang Yang on September 19, 2009

One may first think of using JavaScript to do this by dynamically changing the windows status bar URL, but unfortunately this trick doesn’t work across Firefox browsers.

The truth is the visitor or clicker will eventually find out that they’ve been referred to the affiliate merchant by you from the ultimate landing URL – sometimes this may be totally redirected to the clean home page of the merchant, but many’s the time it’s not.

So the one thing you can make sure is the reader of your site must click through your affiliate link to get to the merchant. And the following snippet will help you achieve this. Start a index.php file and put this in:


In which is your referral link. Save this file somewhere in your domain such as /go/example. The next time you want hide and cloak the real affiliate URL, or at least make it look more neat, just point your readers to /go/example and they will be automatically redirected to the affiliate link.

Another good way – via Javascript, to hide or cloak the status bar URL

Another way of doing this is to rely on JavaScript for changing the href property of the a tag when the visitor clicks on the affliate link:

<a onclick="javascript:document.location='';return false;" rel="nofollow" href="">Example</a>

The potential problem of this approach is that if the visitor browser’s Javascript capabilities are turned off, you will not be credited for your referral because they will be using the plain href link.