The importance of cloaking affiliate links & how to do it

by Sushant Risodkar · 50 comments

Cloaking your affiliate link is the practice of hiding your ugly affiliate URL link from your visitors. So instead of seeing “” they’ll see “” or whatever product you are promoting. Which is, I think we can agree is much more attractive URL to make people click!

Link cloaking is important not only because it will improve the amount of times your links get clicked (many internet users are skeptical of weird links with loads of numbers) but also, it helps prevent affiliate link theft. This is when a user sees your blatant affiliate link and thinks “hmm, I think I’ll just sign up as an affiliate and save myself 50% of the sale”.

Link theft is particularly rife in the make money/affiliate marketing niche. Of course, savvy marketers will also know it’s an affiliate link when they see instead of linking directly to their website. But it isn’t AS obvious and in my experience it has increased conversions.

The easiest way to cloak your links

There’s a whole bunch of different ways to cloak your affiliate link’s. Some people have even set up businesses where they offer a link cloaking service. I recommend that you stay away from these as I have heard of several cases where the affiliates in question didn’t get the credit for a lot of sales.

I’m not going to point any fingers but I suspect some link theft is going on, or improper cloaking techniques are being utilized. Either way, I wouldn’t trust a third party (other than of course the affiliate network e.g. Clickbank) with such an important part of your business.

Also, I don’t understand why people use these services at all. Because cloaking your links couldn’t be simpler. All you need to do is create a simple PHP redirect. And of course, I’m going to show you how…

How to cloak your links step by step

For cloaking links you will obviously need your own server and knowledge on using any FTP program or you can use cPanel if you are more easy with it. And basically all we need to do to cloak our links is upload a tiny file (which I’ll show you how to create) to our website.

You’ll need to repeat this process for each website you create, but in total it takes like 2 minutes to do.

Step #1: Create a new folder on your desktop and name it recommends.

That will be the
part. Now, you don’t have to make ‘recommends’ all the time, you could name it ‘go’ for example. If I were creating a story website I might call this folder ‘go’ instead. “Recommends” is better suited to a
review page.

Step #2: Open the folder and inside create a text document.

Name this text document whatever you want the “product” part of the URL to be, but make sure it’s all one word (No spaces in the name). Often the product name or a shortened version of it is what I’ll use – but you can experiment if you like.

I just want to make this crystal clear (I’m not a techie myself, so I know how this can be tough)… Let’s say the folder was called go and the text document inside was called smartbloggerz. The cloaked link would look like this:

Step #3: Change the file extension of the text document to php.

So hit rename and on the end of the filename replace .txt with .php

IMPORTANT NOTE: You will need to enable file extensions if you can’t see the .txt part.

Here’s a guide on how to do that in Windows:

Or an alternative way could be that open the file in NotePad and then while saving it select “All Files” from the type selection and enter the file name as yourproduct.php

So far then, it should look like this:


Step #4: This is where it gets kind of tricky (well I mean not really.. but anyway)…

Open up your product.php in notepad and you’ll see a blank document. You need to enter this code, and nothing else inside it:

header(‘Location:  affiliatelinkhere’);

Just copy and paste that into the document and insert your affiliate link. Here’s exactly what the document should look like:


Ok, save that, now all we need to do is upload it to our web site server.

Step #5: Log into your FTP program or cPanel and browse to file where you saved it.

Step 6#: In your server “public_html”, if it’s your priary website then upload the folder there. The recommends folder should now be on your web server and you’re done.

By the way, make sure to test your link by actually typing in
to make sure it works! You should go straight to the merchants website when you enter that.

Also, remember that that URL will be your affiliate link (because as users are redirected through that other page you’ll get credit for the sale). So whenever  you want to add an affiliate link to your site, add that link and NOT plain the affiliate link.

I think that some marketers put off cloaking there links because it seems hard work and not really worth the trouble. But it is worth your time…There’s a reason that all the top affiliates do it. Because it does improve conversions.

You will want to do it sooner or later, and as I’ve just demonstrated to you, it really is a simple process that only takes a couple of minutes at the most.

Alright then! I’ve discussed everything you will ever need (or want) to know about cloaking your affiliate links easily. If you get any problem then just hit me a comment below.

So What about you? How do you cloak links? You use any plugin or use this same way? Well honestly I use sometimes plugins and sometime this method. But What about you? Eager to know…

Top 10 Search Terms:

• cloaking affiliate links • affiliate link cloaking • cloak affiliate links

About Sushant Risodkar

Yo! I'm +Sushant Risodkar & my nickname on web is Typhoon. I'm a 19 yrs. old young blogger from India & the owner of SmartBloggerz. If you are looking for SUCCESS as a blogger & affiliate marketer then SmartBloggerz is the right blog for you. You can follow me on Twitter or be my friend on Facebook. And hey! Don't forget to LIKE SMARTBLOGGERZ on Facebook. Read more About Sushant Risodkar.

has written 377 superb article(s) on this blog

Follow me on Twitter · Visit my website →

Haroon May 1, 2010 at 2:55 am

If you need to cloak an affiliate link . What is the easiest and most effective .
Get a free Link Cloaker ? What about tinyurl ? Any opinions on this

Typhoon May 1, 2010 at 12:29 pm

Ya, you can try any URL shortening service for cloaking your affiliate url’s..Such as or

Abigail June 22, 2011 at 6:16 am

Hi Typhoon, thanks for the great article, I am just getting started in the IM field. What is your best recommendation for free cloaking software? Thanks

Sushant Risodkar July 1, 2011 at 1:46 pm

If you are using wordpress then try the free plugin called: pretty links.

For other platforms, you can just try simple php cloacking. You can search google for it.

Abigail July 1, 2011 at 7:55 pm

thank you!

Frédéric August 29, 2012 at 6:02 pm

Hello, How do you proceed if you have a lot of affiliate links to cloak with the php script ? Could you give me the code lines ? Thank you

Previous post:

Next post: