I’d written a post on DIY Link Cloaking a while back that showed how to write your own link cloaking script, and integrating it with WordPress.
That script was very basic, and required editing the PHP file to add new cloaked links. Lately I’ve found a great plugin that, with the most recent version, allows you to do the very same sort of link cloaking, but from inside the WordPress dashboard. The plugin has two main features.
First, you can set it to cloak all the links in posts and/or pages. This really isn’t desirable, since most links are not ones that need to be cloaked. You want to cloak affiliate links, so they don’t look like affiliate links, but you don’t want to cloak links to sites you’re recommending. If you cloak those links, they don’t get any SEO benefit from the link.
The most recent version of the link cloaking plugin, though, adds what the author calls static cloaked links. These are what you want to use for affiliate links.
To use the plugin, get the zip file from the link above, and upload and activate the plugin. Then go to Options->Permalinks and click Update Permalinks. This allows the plugin the chance to modify the .htaccess file, needed to actually do the link cloaking.
Also go to Options->Link Cloaking, and select the radio button that says “Selective Cloaking”. This will prevent the plugin from cloaking every external link in all your posts and pages.
Now you’re ready to create some cloaked links. Go to Manage->Cloaked Links, and enter the name and destination of the link. The name should not have spaces, and the destination is the ugly affiliate link you’re trying to hide. Click the Add button, and after a moment you’ll see the cloaked link listed. Click “show cloaked link” to see the link you should put into your blog post. It’ll look something like this:
If you want something other than “goto” used, you can change that in Options->Link Cloaking. Unfortunately, you can only have one prefix. It’d be very nice to be able to specify multiple prefixes, and select which one to use for a particular cloaked link. That way I could use “goto” or “recommends”, depending on what I was linking to.
Even without that feature, this is still a great link cloaking solution for WordPress blogs. It doubles as an ad tracker, too, since it tells you how many times each cloaked link has been clicked.
And it’s free, so go get the link cloaking plugin. No more excuses for having ugly affiliate links on your blog!