Hiding Affiliate Links
Posted on March 5th, 2008 in Blogging Tips |
I don’t know if you’re thinking the same, but in the past I always wondered how other blogs masked their affiliate links so that you did not know that they were passing you onto an affiliate site to earn them a few bucks (or in some cases, a lot of bucks). I thought you might want to know how to do that trick to, it takes a few minutes and it’s easier than you think.
Why Hide Affiliate Links?
Personally, I think hiding affiliate links cleans your website up a bit and that’s why I do it. If you hover over a link you can be presented numbers, letters and a link that you don’t even know belongs to your website. It can deter visitors away from clicking it as they don’t know where they will end up. Hiding your affiliate links with a link that looks like it goes to somewhere in your website is far more attractive for someone to click.

One Simple Edit if your Affiliate Network changes Codes
A nice feature about hiding affiliate links in the way I’m going to tell you is if your affiliate network changes the code that is on your site, you can quickly change the code in one file that is stored and it changes for every affiliate link on your website. This saves time and stops dead links on your website, thus hopefully generating you more money.
Improve Your SEO
Good dislikes sites with a lot of affiliate links on it, it sees your website as promoting something that will not help many people. Hiding your affiliate link will erase this problem as it the URL looks like it is going to another part of your website.
How to Hide Affiliate Links with a Re-direct
There are 5 simple steps to hiding your affiliate links..
1. Create a folder, name is anything you want but shorter is better. e.g. web, go, link.
This is where your link files will be placed.
2. Your now going to need to create the .php file that will re-direct to your affiliate link. Open up notepad and paste the following code in the blank file.
You will need to replace youraffiliatelink with the link that is provided by your affiliate network. Simply extract the link that is after the a href=” and finishes before “. Once you have done this you need to save the file as a .php, don’t forget to select “All Documents” if your saving in notepad as you will just save the file as a .txt document.
3. You now need to place your php file into the folder so it’s ready to be uploaded. Make sure your php is named nicely. Like if you’re referring someone to some free wallpapers, you would name it “getwallpapers” maybe? The decision is in your hands.
4. Your nearly done, you now need to upload this straight to your web hosting. Do not place it within any other folders; just upload it straight to your index so you don’t have to make the link any longer than it should be.
5. It’s time to re-direct people. Now you’ve uploaded the folder with your php file in, if you type http://www.yourdomain.com/web/linkname.php into your web browser, you’ll see it re-directs to your affiliate link. All you need to do now is in the original code that your affiliate network provides you with (link and image code), you need to replace the affiliate link (remember the bit inside the a href=” and ” with your link which will be http://www.yourdomain.com/web/linkname.php. Hopefully you’ll end up with something like this.
Just create another .php file and follow the steps to hide another affiliate link.
If your having any trouble don’t forget you can contact me and I’ll respond as soon as I can.
If you liked this post, why not Subscribe to My Feed?













Isn’t this technically illegal with Google?
At the very least it seems a bit black hat.
Judge’s last blog post..“Witness” Silently Hypnotic
As far as I’ve learnt Google does not mind people hiding affiliate links. Many bloggers including famous bloggers hide their affiliate links.
Great post
As for it being blackhat… not at all. Do you even know what blackhat means?
Yea i thought google did not like hiding affiliate links. Myabe not though.
Guitar Hero Aerosmith’s last blog post..Email Subscriptions Now Available on GHN