Link Cloaking via WordPress has never really been an easy process. Yes there are some plugins that do it but out of all the ones I have ever used or tried never really worked the way that I wanted it to. So I have finally found a way that I like and it works, so I thought I would share with you a step by step process of doing it yourself. Plus plugins can also slow your site a little bit, so learning how to really do it, is often the best!

First, you may wonder what link cloaking is and why you would want to use it?

The basics of cloaking a link is not really allowing a user to be able to tell where they will be brought to if they click by hovering a link and looking in the lower status bar! It is basically what the link shortening services do as well as shortening a link. The majority of time a site owner uses link cloaking is when using an affiliate link.

People are more likely to click a link that is directly to a site. If I put eBay.com and link it, upon a user hovering over it, they would see http://ebay.com . Affiliate marketers will still use the text eBay.com but will often link that with an affiliate link. In doing so with an affiliate link and upon hovering the linked text, the user would see something like this… http://rover.ebay.com/rover/1/711-53200-19255-0 etc.

The problem, many people know that is an affiliated link and for what ever reason, simply do not click it then! This is bad news if this is your site and you may be losing affiliate sales because of it!

So what if your users couldn’t tell the difference between an affiliate link or a link that will send them directly to a specific site? Link cloaking will help and here is how to do it! This is for self hosted WordPress blogs and you should be aware what an FTP client is.

Cloaking a Link

Step 1. Right click on your desktop, go to New and Create Folder.Public_html image

Step 2. Name this folder Go or Refer or really what you wish!

Step 3. Using your FTP client, upload your newly created folder to your public_html folder.

Step 4. If you do not have a text editor which allows you to create and edit .php files, Notepad++ is free and you can download it here.

Step 5. Open Notepad++ and enter in the following php code: <? header("Location: http://thelinklocationwhereyouaresendingpeople"); ?>

Step 6. Save As filename.php. Save the file you just created but save it pertaining to the link location you put in but keep it short. Like: ebay.php

Step 7. Upload the .php file via FTP to your folder you created and uploaded to your public_html folder (go or refer etc)

Step 8. Creating your link on your site to use that file you just created, is like linking to anything else, but your link will look like this: http://www.dotweekly.com/go/ebay.php

Your link structure will always look the same, you simply need to change the .php file name at the end of the link. An example directly on DotWeekly, when I want to link people to Whois.sc, I created a file and simply named it whois.php . So the link to Whois would be http://www.dotweekly.com/go/whois.php . People clicking the link http:/www.dotweekly.com/go/whois.php will actually be sent to http://whois.sc .

Repeat the file creation using Notepad++ for addition links and put the destination link in the file. Each file will need to be named something different. Then just remember what you saved and uploaded the .php file as and use that when linking via your WordPress site.

Tip~ I saved a php file to my desktop so I didn’t have to remember the php code, then I just open it and change the link and save the new file created with a new name. Then upload it via FTP.

The 8 step process seems like a bit much, but is really easy after you do it a couple times and have your "go" or "refer" folder created!

The downside? You have to create a file for each item you link to! Again, it really isn’t all that hard to do, it just takes a couple extra seconds to do it! You just have to decide if spending those couple extra seconds is worth cloaking the link or not. I am getting use to the process and will continue to convert the majority of links I use (affiliate or not) to this new link structure. If I were to only do it for affiliate links, then my daily readers would know that just my affiliate links are cloaked and the other are not. This would clearly point out affiliate links and defeat the purpose!

I hope this helps.

One Response to How To Hide or Cloak Links For WordPress


  1. Johan
    Feb 02, 2010

    Thanks for sharing this trick! I’ve been using a plugin called “Link Hopper” that lets you cloak links to domain.com/PREFIX/name, where you can change the prefix and name into what you want. But I will look into this manual way of doing it since I like to avoid the plugins as much as possible too.

Leave a Reply




Notify me of comments via e-mail. You can also subscribe without commenting.