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

    Hi, first off I love the plugin. Everything works except one feature. If you can tell me if its a setup problem, or it just cant do it that would be great.

    Masks and nofollows links in posts and pages no problem

    What I wanted was to mask/nofollow links in the sidebar as well. Currently it does not do this on my site. I tried creating a static link under “cloaked links” and then adding the masked url to the blogroll, but it just loops back to the same page instead of going to the external site.

    The best feature would be if you could select a tick box when creating a link through the standard WP interface as to whether cloaking applies.

    Can you let me know if the plugin does this? Or a work around?

    Much appreciated

  2. White Shadow says:

    @Peter – The plugin doesn’t cloak links in sidebars, or in fact anywhere else outside of post/page text.

    Creating a “static” cloaked link and adding it to the sidebar should work though. Does the “masked” link work if you simply copy & paste it to the address bar?

  3. Peter says:

    @White Shadow – Thanks, at least Im not going crazy. Yes the static link works when pasted into a browser, but not as a normal link added under the blogroll.

    Just to be clear:

    If my affiliate link is http://www.shareasale.com/r.cfm?B=113187&U=96317&M=16188
    And I create a static cloaked link as http://www.forex-trading-systems.com/goto/Automated Forex Trading/

    I put http://www.forex-trading-systems.com/goto/Automated Forex Trading/
    as the link in the blogroll, it just seems to redirect to the homepage.

    Is that the right way to do it?

    Do static cloaked links in the sidebar work for anyone else?
    I may restore my original .htaccess and reinstall the plugin to see if that helps.

    Thanks for your help

  4. White Shadow says:

    @Peter – Hmm, maybe using a cloaked link that doesn’t contain spaces would help? There’s a chance there might be a bug in the plugin that could cause problems with spaces in URLs.

  5. Peter says:

    Ok figured it out right after I posted the comment!!!

    its because I had spaces in the static clocked link “/Automated Forex Trading/”

    Did it again with “test” as the name of the static cloak and works fine.
    If your code could add hyphens where spaces are, that would fix it for nubes like me in future. I added another no follow plugin http://blog.andrewshell.org/ and that has sorted it for me.

    If you could add the simple features of Andrews nofollow plugin, I think it would be complete.

    Of course thats just some suggestions and really greatful for what you have done so far.

  6. White Shadow says:

    @Peter – I’ve modified the plugin to replace spaces with dashes as you suggested (note that this only applies to new links – existing “cloaked” links will not be updated by the plugin). You can re-download it from the same link.

    I won’t merge in the nofollow plugin though. It may be simple, but it’s not entirely relevant to the plugin’s main functionality 😛

  7. Peter says:

    Man that was fast. Thanks again.

  8. Sebastien says:

    Nice plugin. I tried it and for some reason, the redirect wouldn’t happen for a few minutes. I tried again later and it worked. I am not sure why.

    I set it up to cloak all link but a feature that would be nice is to be able to add a piece od code in my posts/pages to exclude links I don’t want to cloak. ie. ?

    Also, that would be great if I could use the cloaking feature with ads in my sidebar. Maybe for a future release?

    Thanks

    Sebastien

  9. White Shadow says:

    @Sebastien – Hmm, maybe I’ll add some kind of tag to exclude specific links (someday).

    There have been several suggestions to make it cloak links in other places (sidebars, footer, etc), but at the time I just can’t think of any practical way to do that. If you have just a few links in the sidebar you could manually create a cloaked link for each of them in Manage -> Cloaked Links.

  10. Ash says:

    I’ve suddenly started getting 404 errors with this plugin. Been trying to track the problem but not having any joy yet, is anyone else experiencing problems?

  11. White Shadow says:

    @Ash – The plugin hasn’t been modified for a while, so it seems unlikely it would be the source of the problem. Have you made any changes to your server configuration, or installed any new plugins lately?

  12. Ash says:

    @Ash – Ah traced the problem to an entry i made in the htaccess which conflicted with the rules of the plugin.

  13. Ken says:

    Hi – This is a problem-free plugin on several sites I have. Thanks!

    But, there is an exception – all I get is 404 errors (on my own site) when cklicking cloaked links on scrapbookinggems.com.

    The only config difference I’m aware of from my other sites using Link Cloaker is that on this site I have restructured my Permalinks, using a combination of Dean’s Permalinks Migration and Permalink Redirect – latest versions. I’m running WP 2.6.3.

    This config was in place before I tried using Link Cloaker. I have remembered to update permalinks, with a writable .htaccess. .htaccess is updated with the Link Cloaker redirects.

    I’ve also tried entering the Link Cloaker’s /goto/ url in the exclusion list for Permalink Redirect, but this makes no difference.

    Any suggestions?

    Ken

  14. Stephen says:

    I was using your plugin for a while but it stopped working. I wish I could remember what the problem was now but I ended up paying about $100 for a link cloaker because I’m so used to people not supporting their plugins. Now I see that you are still actively involved here so I’m sorry I didn’t report the issue sooner in detail because maybe it could have helped you here. Unfortuneately I don’t remember now exactly what it was doing except that the link cloaker stopped working. Sorry.

  15. […] first two autoblogs… 1)Is there any advantage to using GoCodes over my link cloaker of choice, Link Cloaking Plugin for WordPress | W-Shadow.com ? I ask because for some reason the titles of my posts aren’t getting cloaked, although on the […]

  16. White Shadow says:

    @Stephen – Well… what can I say? Life goes on 🙂

  17. White Shadow says:

    @Ken – Check your .htaccess again. The plugin’s rules need to be above WordPress rules in the file, otherwise you might have problems like these.

    Sorry for not replying earlier – your comment got caught by the spam filter.

  18. webripper says:

    thiiiiiiiiiiiiks man for this very great plugin you saved my ass:-)
    It works 1000%

  19. Andri says:

    It works great, I like it but the problem is the plugin only redirect to original website, can you masking the link so if visitor go to my link likes http://www.domain.com/go/cloaklink and visitor still see the link at browser not the original link.

    Thank you for the plugin, It works 100%

  20. White Shadow says:

    @Andri – It could be done, but not in this version.

Leave a Reply