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.
How to Mask Affiliate Links
Which Is Safe in Google’s Eye.
If you have any of below questions then you are at right place:
- Link Cloaking 101: What Is Link Cloaking?
- How to cloak your affiliate links?
- How to Cloak Affiliate Links on Your WordPress Site?
- Cloaking Affiliate Links – Here’s a Quick Way To Do It
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
rel=nofollow
tag. - 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: https://shareasale.com/r.cfm?b=1320634&u=528889&m=41388&urllink=&afftrack=
- Cloak link: https://crunchify.com/refer/genesis
There are two ways you could create Cloak URLs:
- Without Plugin using
.htaccess
way -> We are going to followthis approach
. - 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.
Step-1
Choose which URL Slug
you want in your URL, i.e. /refer/
, /recommend/
, /out/
, /go/
, etc.
On Crunchify we were using
/refer/
.
Step-2
Get list of all your affiliate links and choose your related URL name
. Sample.
https://crunchify.com/refer/bluehost for URL http://www.bluehost.com/track/crunfy/ https://crunchify.com/refer/genesis for URL https://shareasale.com/r.cfm?b=1320634&u=528889&m=41388&urllink=&afftrack= ... ... have this list ready if you have more affiliate links
Step-3
Open your .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 🙂
Step-4
Update .htaccess
file with below content.
## AFFILIATE LINKS ## Redirect 302 /refer/bluehost http://www.bluehost.com/track/crunfy/ Redirect 302 /refer/genesis https://shareasale.com/r.cfm?b=1320634&u=528889&m=41388&urllink=&afftrack= Redirect 302 /refer/wpengine https://wpeng.in/crunchify/ ... ... add all entries
We are using HTTP 301 redirection
. A 301 redirect
, or also known as a permanent 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 301 is recommended redirect for Cloaked URLs
.
Step-5
Open robots.txt
file and disallow all /refer/ URLs
. You don’t want Google to index all your Cloaked URLs.
User-agent: * Disallow: /refer/ Sitemap: https://crunchify.com/sitemap_index.xml
Check your changes by going to URL https://crunchify.com/robots.txt
.
Make sure you change to your domain name.
Step-6
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.
Plugins like Redirection, ThirstyAffiliate, etc are very good but those needs to be booted with WordPress and those are not as fast as .htaccess redirection.