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

  1. Download the link-cloaking-plugin.zip file.
  2. Unzip the file.
  3. Upload the `link-cloaking-plugin` folder to the `/wp-content/plugins/` directory.
  4. Activate the plugin through the ‘Plugins’ menu in WordPress.
  5. (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 :

802 Responses to “Link Cloaking Plugin for WordPress”

  1. Les says:

    Hi there!

    Thanks for an amazing plugin. However, I’ve run into a problem that I can’t seem to solve.

    I’m trying to use the plugin to cloak Ebay links. These links are supposed to direct users to relevant parts of eBay.

    Now when I enter the URL contained in the link into the browser directly, it goes properly to the search results I’ve defined in the link. But when I activate the plugin, all my links now go incorrectly to the eBay home page.

    I’ve tried everything to get these to work properly, but to no avail. Do you know how I can get it to work?

    Any help would be greatly appreciated. Thanks!

  2. White Shadow says:

    Could you show me a few example links?

  3. Les says:

    Oops never mind…

    I think I found the problem. There was probably something wrong with my HTML editor and when I pasted the link in, it must have messed up the code somehow. I just went to the WP admin interface, clicked the HTML editor there, and inserted the link. Everything seems to be working fine now.

    Thanks for the reply!

  4. Dan says:

    if I am doing the selective cloaking where do I put the tag. I tried putting it in the link when I hit the hyperlink chain option in wordpress where you do your post.

    That didn’t work. Where do I put it?

    I really would like to have “cloak all links” but when I put things in the exception field they are still cloaked. I tried deactivating and reactivating and it didn’t help.

    I went to permalinks under settings and there is no button to “update permalinks” it only says “save changes”. Your other post said to go to “options” and then update permalinks. I don’t see any “options” tab. I only see permalinks under settings.

    Thanks

  5. White Shadow says:

    Put the tag inside, or after, the link text. This should be done in HTML view. Example:

    cloaked link

    Keep in mind that the exception list is for domain names, not links in general. That is, “example.com” will work, but “http://example.com/” won’t do anything at all.

    The installation instructions are a bit outdated. The “Settings” menu was called “Options” in older versions of WordPress, and the button on the permalink configuration page was called “Update Permalinks” once. I’ll update the readme to reflect the new Dashboard organization.

  6. Joe says:

    Lots of links cloaked using this plugin just reload the page rather than take the user to the desired website.

    Any ideas why?

    See this page: http://carbatterycharger.org.uk/halfords-fully-automatic-car-battery-charger/

  7. White Shadow says:

    I see two cloaked links on that page. When I click any of them, I get redirected to a product listing on http://www.halfords.com. As far as I can tell, this is the expected result.

    Tested in IE 8, Opera 10.61 and Chrome 6.0.

  8. Joe says:

    Thanks for looking.

    If I log out of WordPress then click on the links it works but if I am logged in then it takes me to the domain level.

    Cheers!

  9. White Shadow says:

    I guess you might have some sort of plugin conflict then.

  10. sholeh says:

    thank’s Shadow….

  11. Dave says:

    Hi,

    Loving the plugin so far thanks! However, clicks don’t seem to be registered by WP Stats since I installed this. Is this expected behaviour as they are now clicks on my domain rather than external links? Is there any way to fix this?

    Thanks,
    Dave

  12. White Shadow says:

    Yes, that is to be expected.

  13. kevin says:

    Hi there,

    I’ve been tried a lots of masking and cloaking wordpress plugins, however no one can mask or cloak custom field links. Can your plugin mask custom field links?

    Thanks,

    Kevin

  14. White Shadow says:

    The free version can’t mask custom field links, but the paid version can.

    Well, unless the custom field links use JavaScript or something of that sort; I don’t think I’ve seen any plugins that could mask JS links.

  15. kevin says:

    Hi there,

    Thanks for your quick response. I mean that I’ve use custom field template plugin to format my post, and in my post I put [variables] into my links. so that’s why I do not know even paid version can sort it out or not.

    example:

    [Link_1]

    Can this format work?

    Thanks

    Kev

  16. kevin says:

    Hi, sorry can I you see example in your source code.

  17. White Shadow says:

    Yes, I can see the source code.

    Most likely the paid version of the cloaker will be able to cloak those links. The cloaker plugin is designed to process the page/post after all other plugins have already executed, so by the time it starts looking for links to cloak, the custom field template plugin will have already replaced the [variables] with the actual values.

  18. kevin says:

    Hi there, In that case. I’m going to give it a try. Thanks for your kindly explanations.

  19. kevin says:

    BTW. What’s different between your powerful cloaker and Pretty Link Pro.

    Thanks

    Kev

Leave a Reply