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. Daniel says:

    Hi White Shadow,

    Thank you for your fast response, really good support =)

    Now I saw that there were two .htaccess files on my server. One in the root and one in the /wordpress folder. When I updated the permalinks in wordpress admin it was the only the .htaccess in the root that was updated with the # Link Cloaker code.

    So I copied the code and paste it into the .htaccess file in the /wordpress folder and now it works perfectly. I wonder how it is that I have two .htaccess files?

    Best // Daniel

  2. White Shadow says:

    No idea about the two files; but it’s good that you got it working 🙂

  3. Daniel says:

    Yes, thank you again. What a wonderful plugin. 🙂

  4. Darrel says:

    How can you tell if your link is cloaked?

    Thanks

    Darrel

  5. White Shadow says:

    Hover your cursor over the link and look at the status bar. If the link is cloaked, you will see an URL that points to the current site. However, the link will actually lead to a different site when clicked.

  6. […] Link Cloaking PluginExcellent plugin to cloak outgoing links in your posts, pages, sidebar, etc… (see my woothemes goto-links in the sidebar) […]

  7. Dave says:

    Love the plugin but I’m having a pretty serious problem, I’m #1 on google for a particular search phrase but when you click on any of the links on this site or any others I have that are using this plugin you go nowhere and you get 404 errors. However it works perfectly fine if your using Mozilla Firefox and click any of the links they are operational and take you exactly where they should. Internet explorer on the other hand, has none of them working, bringing up 404 errors. How in the world does this work only using firefox and on none of the other browsers?? How can I fix this so it works on every one of them????

    Thanks in advance for your help,

    Dave

  8. White Shadow says:

    According to my own tests, the cloaked links work in IE, Chrome, Opera and Firefox. As far as I know, there is no credible reason why they wouldn’t work in any particular browser – with the possible exception of some kind of bug/malware in the browser itself.

  9. Dave says:

    Thanks for your quick response on this. I’m still trying to figure out how I got this to work for firefox but not IE or the others it works with. I’m thinking that I may have coded it wrong in the html for it to work in IE.

    Can you give me an example of how it should look like in raw html code, so I can be sure I did it right and used proper coding??
    Let’s say my site is pooltables.com and I want to hyperlink link some text, like billiard balls for sale, and cloak the link that’s going to another site within that linked text. Would you show me what that should like in raw html form please or rather how it should be written?

    Thanks again for your help with this!

    Dave

  10. White Shadow says:

    * With dynamic cloaking :

    .... billiard balls for sale ....
    

    * With static cloaking :
    Go to Tools -> Cloaked Links and create a new cloaked link. Then just use the cloaked URL that will be provided by the plugin in place of the original URL. The cloaked URL will look something like this : http://yourdomain.com/goto/yourtext/ , so you would use that address in your posts.

  11. Dave says:

    Thanks so much for your help with this! Have a great weekend!

  12. aofza says:

    Hey you Plugin not support wordpress 2.7

  13. White Shadow says:

    It does support WP 2.7. If it’s not working, the most common reason is you need to update the permalinks (see the post above).

  14. Walt says:

    Curious. Is it possible to automatically cloak links in the RSS feed as well as in a post?

    Or, better yet, *not* cloak links in the post, but cloak them in the feed?

    Reasoning – I am using some article directory articles in my blog. I can’t cloak those since it is a TOS violation. But, my feed could get scraped, and I’d like *those* links to point back to the actual article on my blog. Or something like that. Plus, although I am leaking some PR in the post itself, I’d rather not leak more of it in the feed.

  15. White Shadow says:

    I’m pretty sure that in the current implementation it also cloaks links in the feed. Your suggestion has been noted.

  16. GT says:

    This is a great plugin and going to be real help in a new project of mine, thanks.

    I just have a question. For security I have a different wordpress address to my blog address i.e.

    WP Address: http://www.domain.com/wp_folder/
    Blog Address: http://www.domain.com/

    As the functions are using the siteurl to build the redirects my wordpress address appears instead of my blog address for the cloaked links. I’ve tried changing ‘site url’ to ‘home’ and adding the wp_folder to htaccess but haven’t had much luck. Any suggestions?

    Thanks.

  17. White Shadow says:

    Tricky. The rewrite rules generated by the plugin are not actually fully compatible with WP 2.6, so editing them might be tricky, too.

    Anyway, I’ve uploaded a new version that could fix your problem. Maybe. You will need to update permalinks (to regenerate .htaccess) after installing it.

  18. GT says:

    Excellent! That worked a treat, just had to append the worpress folder name to the path in the .htaccess and it worked.

    Thanks for going to the trouble of looking at it

  19. […] if you use a WordPress Blog there is a good plugin for cloaking affiliate links, called ’Link Cloaking Plugin for Worpress’ (surprisingly!) which you can download for […]

Leave a Reply