beginnersbook.com

  • Home
  • All Tutorials
    • Learn Servlet
    • Learn JSP
    • Learn JSTL
    • Learn C
    • Learn C++
    • Learn MongoDB
    • Learn XML
    • Learn Python
    • Learn Perl
    • Learn Kotlin
  • Core Java
  • OOPs
  • Collections
  • Java I/O
  • JSON
  • DBMS

How to cloak affiliate links without any plugin

By Chaitanya Singh | Filed Under: On Page SEO

Few days back, I shared how to cloak affiliate links in WordPress using plugin. Here I am going to share a simple yet effective way to hide your affiliate link. For this you won’t be needing any plugin. Which means it works for WordPress and Blogspot both.

It is always good to do  things by yourself instead of using plugins as plugin may get outdated one day but these tricks will work forever.

how to cloak affiliate links, A method for wordpress and blogspot both

Simple steps to cloak affiliate links

Step 1: You need to create a folder in your root directory. You can just go to your cpanel and create a folder in root directory (public www folder). The folder name can be anything. Suppose the folder name is “loves” then the structure would be something like:

http://www.yourdomainname.com/loves/

Step 2: In this step, you would need to create a new folder inside folder named “loves”. for example you are a affiliate member of “Hostgator” and want to promote “Hostgator”. Then create a folder named “Hostgator” inside folder “Loves”.

Structure:

http://www.yourdomainname.com/loves/Hostgator/

Step 3: Create a index.php file inside affiliate folder (in this case it’s Hostgator) and paste the below code in the file.

<?php

header( ‘Location: your actual affiliate link here’ ) ;

?>

Step 4: It’s done. you have your cloaked affiliate link, which is “http://www.yourdomainname.com/loves/Hostgator/“. Use it anywhere. Don’t forget to add “nofollow” attribute while using link.

 Benefits of cloaking affiliate links

  1. It will increase affiliate link CTR as people will more likely to click on these links. Actual affiliate links looks ugly and spammy and generally people won’t click on them.
  2. Cloaking will protect you from search engine penalty. Tip: Always use {rel=”nofollow”} while using cloaked link.

Lets take above example again:

your actual affiliate link would be like:
http://www.hostgator.com/1234?Id

After following above steps it would look like:
http://www.yourdomainname.com/loves/Hostgator

You need to use it in this way:
<a href="http://www.yourdomainname.com/loves/Hostgator" rel= "nofollow" target= "_blank"> Anchor text </a>

Let me know if you face any issue while following above steps to cloak affiliate links.

Image courtesy of pakorn at FreeDigitalPhotos.net

Enjoyed this post? Try these related posts

  1. Broken link checker wordpress plugin – Search engine optimization
  2. How to speed up website: Is website loading speed matters??
  3. How to check keyword density
  4. Interlink posts with Insights WordPress Plugin – SEO
  5. How to Display Related posts with thumbnails in WordPress without any plugin
  6. What do you need to take care while auto interlinking your posts?

Comments

  1. Parish says

    August 20, 2013 at 2:21 PM

    This is a easy way. Nice tutorial.

    Reply
  2. Jeanine says

    March 13, 2017 at 7:36 PM

    Great article with helpful tips. I have now set up the cloaking, but I was wondering about the following. Since all the links are redirects, it takes some seconds to load the links. Therefore I would like to show an “exit page” that says something like: Just waiting to redirect you to.. (shop name).. just a few seconds..

    Do you have a tip on how to show an exit page like that?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

SEO

  • Write SEO Articles
  • Open Graph Meta Tags
  • SEO Friendly Images
  • SEOPressor Review
  • Auto Interlink Posts

WordPress

  • Free plugins to add Open Graph Tags
  • Free plugins to add Captcha
  • Set thumbnails automatically
  • Display related Posts WP
  • Change Post excerpt length WP

Website

  • Add Facebook like button
  • Add Google plus button
  • Add Twitter button
  • Create Free Website on blogspot

Copyright © 2012 – 2021 BeginnersBook . Privacy Policy . Sitemap