Link Cloaking Plugin for WordPress
This is a plugin for WordPress that can automatically cloak outgoing links in your posts and/or pages.
Download plugin
(Note: May not be compatible with the latest version of Eclipse Link Cloaker.)
Features
- Choose what to cloak – all links, only the links you specify or no links at all.
- Choose where to cloak – posts, pages or both.
- Exception list – links pointing to domains in this list will not be cloaked. For example, this is useful if you have chosen to cloak all links but don’t want to cloak the links to your own domains.
- Compatible with all browsers – the link cloaker plugin doesn’t use JavaScript so it will work even for visitors that have disabled JS.
- “Smart” cloaking – relative, ambiguous or malformed URLs will not be cloaked. Better safe than sorry.
- If desired, you can also add your own cloaked links manually.
Examples
Lets say you’ve got a link you want to be cloaked.
<a href="http://example.com/?affiliate=me">Cloak Me</a>
Once you install the plugin, it will automatically, without requiring any configuration, turn it into a cloaked link when it’s displayed to a visitor:
<a href="http://yoursite.com/goto/Cloak_Me/12/34">Cloak Me</a>
Here’s a live example: Cloak Me
As an alternative to the fully automatic cloaking, you can switch the plugin to “selective cloaking” and tag the links you want to cloak manually:
<a href="http://example.com/?affiliate=me">Cloak Me<!--cloak--></a>
Note: The plugin does not actually edit your posts or permanently modify your links. Instead, it switches them on-the-fly whenever someone views them on your site. When editing a post in the admin panel, you will see the original, uncloaked link.
Download
Version 1.8.4 : link-cloaking-plugin.zip (16 KB)
Requirements :
- WordPress 2.8 – 3.3
mod_rewrite
. If “pretty permalinks” work on your blog then you probably have this already.
(Note: May not be compatible with the latest version of Eclipse Link Cloaker.)
Installation
- Download the link-cloaking-plugin.zip file.
- Unzip the file.
- Upload the `link-cloaking-plugin` folder to the `/wp-content/plugins/` directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- (Optional) Go to Settings -> Link Cloaking and modify the default settings to your liking.
FAQ
Why are some of my links not getting cloaked?
The most common possibilities are:
- Links in the sidebar, header, comment area and so on can’t be cloaked by the free version of the plugin. It only works on links in page/post body. Upgrade to the premium version to cloak links anywhere on the page.
- Links added using other plugins, theme features or custom fields are also supported only in the premium version.
- JavaScript links, as well as Flash and context-sensitive ads are not supported by any version of this plugin.
Why are none of my links getting cloaked?
- If using “Seletive cloaking”, make sure you have actually marked some links with the
<!--cloak-->
tag. - Double-check that the links in question aren’t added or modified by plugins, the theme, or custom fields.
- Contact me. You might have found a bug.
The exception list doesn’t seem to work. What could be the problem?
Make sure to enter only domain names in the “Exceptions” box. For example, given a link like “http://example.com/directory/page.html”, the domain name is the “example.com” part. So to prevent the plugin from cloaking that link, add “example.com” (sans quotes) to the “Exceptions” box. Entering the full URL or “http://example.com/” will not work.
Additionally, if some of your links point to example.com and some to www.example.com, you will need to add both of those to the exceptions.
Why do some cloaked links redirect me back to my homepage?
Most likely, your post(s) contain links created or modified by other plugins, the theme, or custom fields. Either remove those links, or upgrade to the premium version.
Why do some cloaked links redirect me back to my homepage?
See the previous question.
Why do cloaked links display a “Not Found” error?
- Make sure you’re using pretty permalinks.
- Your .htaccess might be out of date. To update it, go to Settings -> Permalinks and click “Save Changes”.
- Your hosting company may be blocking browser access to PHP files in the /wp-content/plugins/ directory, usually as a security measure. The free version of the plugin is not compatible with these hosts. Consider using the premium version instead.
I have a question not addressed in this FAQ. What should I do?
Either leave a comment below, or email me directly. My email address can be found on the contact page.
Related posts :
Your plugin works fine on my site. everything except the affiliate link I have placed on the sidebar – on the home page. I think it may be because there is a configuration page for the theme that I am using which allows be to place the image location and re-direct link. I have set to cloak all pages by default. I tried adding at the end. did not work. any help? thanks.
The plugin doesn’t currently cloak links outside of post content (e.g. sidebars, comments, page header of footer). But due to popular demand, this feature will be added in the next version.
I am having the same problem with 2.8.4.
I have checked the .htaccess and the code is above the wordpress code.
I am getting 404’s aswell – does it conflict with phplinkdirectory?
I’m not aware of any conflicts with that plugin. Have you tried deactivating phplinkdirectory temporarily and seeing if you still get 404 on cloaked links?
[…] Link Cloaking Plugin for WordPress […]
Hi,
I use the plugin about a year but never had cloak a link from ebay.
After having made it the plugin crashed and will not let me delete the link with the cloak i had before.
I uninstalled the plugin and reinstall again and everything was equal. I can no longer use the plugin at this site.
Someone can help me.
Regards
Unfortunately this version of the plugin doesn’t delete the saved cloaked links when you uninstall it. You need to manually remove the link from the wp_cloaked_links table in your database (this can be done with something like phpMyAdmin).
If you could post the eBay link here, I might be able to find out why it crashes the plugin, and fix the bug.
I just have to thank you for writing such a great and simple to use application. More people should know about this. I have spent hours and hours trying all sorts of cloaking plugins, you name it I downloaded it and isntalled it.
Basically every single plugin for wordpress I have tried and yours is the best.
The only flaw was that it didn’t open links in a new window, but that simple code that White Shadow posted does the trick, and it wasn’t scary at all to do. Phew.
Thanks again, great job.
OneMoreGadget
Now if I could only find a plugin that automatically fixes typos…ahem.
hello,
What can i do by custom_fields?
When i mouse over the link it is cloaked, but I get a 404. I deactivated all plug ins and still get 404. Any ideas?
Do you have a caching plugin installed? It might be serving the old cached version of the page.
Try going to the target (uncloaked) URL directly; maybe it’s simply down?
Sidebar links would be nice 🙂 Other than that, a nice handy plug-in.
That’s possible in the premium version of the plugin 😉
Hi White Shadow!
I am very curious about the premium version of Link Cloaking. Just one question as I am currently using the free Link Cloaking Plugin with manual cloaking: can I just switch to the premium version with auto cloaking or are there any preparations neccessary I should be aware of?
That depends on what you mean by “manual cloaking” :
If you mean using the <!–cloak–> tag to specify which links get cloaked, then you can just switch to the premium version with zero hassle. The new plugin is backwards-compatible and will continue to cloak the tagged links.
If you’re referring to the “static” links feature instead, there will be one additional step necessary after you’ve installed the premium version : you’ll need to go to Tools -> Cloaked Links -> Named and click the “Import” button to import those links in the new version’s database.
In general, the update process is intended to be as painless as possible, but if you have any problems you can always ask me 🙂
I am using WordPress 2.8.4. I have set up a new site with just a home page and one post, but when I click on this post it seems to default to the home page and that’s the URL that is shown. I have set up test posts so that I have several and they all do the same thing. I have tried the suggested remedy of putting the code above the wordpress code in the .htaccess file, but still the only page displaying is the home page, no matter which post I click on. And, whenever I update my permalinks the code is reinserted in its original position below the wordpress code, so that I then have the code both above and below the wordpress code.
I have deactivated all other plugins and reverted to the wordpress default theme and this problem only occurs when your plugin is activated. The plugin does cloak my affiliate links, but it seems to be diverting all post URLs to the home page.
I love what this plugin does – do you have a solution for this problem?
Seems like multiple users have been having this problem recently, but I haven’t been able to reproduce it on my own site(s). Could you give me the URL of your site in question so I can run some tests? You can send it via email ( whiteshadow@w-shadow.com ) if you don’t want to reveal it publicly.
Thanks for looking into this. I’ve sent you an email.
We installed your excellent plugin but the cloaked links all open in the same window. We want the links to open in a new window or tab instead.
We are using the “Cloak All Links” option, because editing the thousands of links in all our posts would be unworkable..
Is there a way to have them all open in a new window or a new tab?