Affiliate Cloaking is a very popular term for WordPress blogging platform. It is most common practice for blogger to have affiliate links on their blog. On Crunchify we have made some changes recently on affiliate links and would like to share all steps which we performed to have nice Cloaking URL for affiliate links.
Mask Affiliate Links Which Is Safe in Google’s Eye.
First of all let me share some basic principles on affiliate marketing:
- If you are using some valuable services and wanted to share the same with your users then it’s always a good idea to refer using affiliate link.
- Over usage of affiliate links on blog may kill your blog and user base.
- Earning money from affiliate links should never be your goal. You have to focus on your contents. Follow Google Webmaster tutorial for more details on
- You should never refer to a friend / user to a service which you never used in the past.
- Please stay away from SPAM affiliate services.
- It’s perfectly fine for users to know that you are referring via affiliate links. Please don’t try to fool visitors.
What is Cloak URL?
Let’s start with a sample.
- Affiliate link:
- Cloak link:
There are two ways you could create Cloak URLs:
- Without Plugin using
.htaccessway -> We are going to follow
- With WordPress Plugin
I prefer not to install additional plugin for this usage. We will go over all detailed steps on how to create successfully Cloak URLs with some basic rules in mind.
URL Slug you want in your URL, i.e.
On Crunchify we are using
Get list of all your affiliate links and
choose your related URL name. Sample.
https://crunchify.com/refer/godaddy-hosting for URL http://www.dpbolvw.net/click-7777009-10602879-1424793676000
https://crunchify.com/refer/genesis for http://www.shareasale.com/r.cfm?b=460184&u=528889&m=28169&urllink=&afftrack=
... have this list ready if you have more affiliate links
.htaccess file located at your blog’s base directory. Commonly located at under
public_html folder. You may see bunch of things in that file. I’ve written a article on How to speed up WordPress and by following that tutorial we have added lots of things into it.
Please make a copy of it. This is important 🙂
.htaccess file with below content.
## AFFILIATE LINKS ##
Redirect 302 /refer/godaddy-hosting http://www.dpbolvw.net/click-7777009-10602879-1424793676000
Redirect 302 /refer/genesis http://www.shareasale.com/r.cfm?b=460184&u=528889&m=28169&urllink=&afftrack=
Redirect 302 /refer/wpengine http://www.shareasale.com/r.cfm?b=661244&u=528889&m=41388&urllink=&afftrack=
... add all entries
We are using HTTP
302 redirection. A
302 redirect, or also known as a
temporary redirect, should be put in place if you want to redirect your site visitors into another webpage but you plan to bring the redirected page back after some time.
The redirected page will still retain its PageRank, MozRank, Page Authority and Traffic Value – and the detour page will not accumulate any.
So 302 is recommended redirect for Cloaked URLs.
robots.txt file and
disallow all /refer/ URLs. You don’t want Google to index all your Cloaked URLs.
Check your changes by going to URL
https://crunchify.com/robots.txt. Make sure you change to your domain name.
Now you are all set to place your affiliate cloaked URLs. Check your URLs on your site.
If you want you could also add
rel=nofollow to your affiliate Cloak links. Follow this tutorial if you want to get some detailed information on rel=”nofollow”.
This is just a one time process and you are all set. There are number of other WordPress Plugins also available but I want to setup this at very robust and faster way. Check out below screenshot. Redirection in
52 ms. It’s lightning fast.
Join the Discussion
Share & leave us some comments on what you think about this topic or if you like to add something.