Link Cloaking Plugin for WordPress

I’ve created a plugin for WordPress that can cloak outgoing links in your posts and/or pages (note : if you’d rather have a more general link cloaking tool, take a look at Link Manager).

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.
  • Configure the URL - you can set the “prefix” part of the URL (see examples below).
  • 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.
  • Update : version 1.1 available - now with static link cloaking!

Examples
Here’s a link explicitly tagged for cloaking -
<a href="http://evil-guide.tripod.com/"><!--cloak-->A Cloaked Link</a>
And here’s what it looks like in the post - A Cloaked Link
If you have configured the plugin to cloak all links (the default) you don’t need the <!–cloak–> tag inside your links.

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 Options -> Link Cloaking and modify the default settings to your liking.
  6. Go to Options -> Permalinks and click “Update Permalinks”. This ensures the plugin’s link redirection code is added to WordPress .htaccess file.

Download
Version 1.2.2 : link-cloaking-plugin.zip (9 KB)
Tested on WP 2.2 - 2.6.2.
mod_rewrite is required. If “fancy permalinks” work on your blog then you probably have this.

Related posts :

201 Responses to “Link Cloaking Plugin for WordPress”

Pages: « 7 6 5 4 3 2 [1] Show All

  1. 21
    White Shadow Says:

    Hmm, doing that may be possible, but I don’t understand how would that help against spyware?

    As for editing the files - if you’re familiar with PHP, you can take a look at the wplc_link_cloaking_plugin.php file, lines 87-90. This is where the final form of automatically cloaked links is determined. You could modify that, but then you’d need to also modify the URL rewriting rules on line 157 so that the links still work…

    If you explain how it’s supposed to work and why &afsrc=1 is good against spyware, I may be able to implement the changes myself and send you the modified file.

  2. 20
    TC Says:

    Just to clarify, when the &afsrc=1 is on the cloaked link, I mean that the link will be like this (using your example above):

    http://w-shadow.com/goto/A_Cloaked_Link/45/4&afsrc=1

  3. 19
    TC Says:

    I just came across this and am playing with it, I love what I see so far, thank you :). There is one thing that I’d like to do, for affiliate links it’s a good idea to tag &afsrc=1 at the end of a cloaked link (to protect your commissions from being stolen from parasites and spyware).

    I’m sure I could add that somewhere in the plugin files so that every link I cloak automatically gets that appended to the cloaked link. I just don’t have a clue how to do that though. Could you advise?

  4. 18
    WordPress Plugins Database » Plugin Details » Link Cloaking Plugin Says:

    [...] Visit [...]

  5. 17
    Link Cloaking Plugin Update | W-Shadow.com Says:

    [...] time ago I created a WordPress plugin that can cloak affiliate links automatically. Today I’m releasing a new version, with all-new [...]

  6. 16
    More Wordpress Landing Page Plugins | unintuitive Says:

    [...] Cloak Affiliate Links - This plugin is necessary if you care about how your links look to visitors. Instead of displaying awful-looking affiliate links, like “http://wrdz72.notascam.buynow.com=?aff=12345“, this plugin will make your affiliate links look much more natural, readable, and non-threatening. It’s not perfect - the plugin does leave a couple numbers at the end (no big deal) - but it’s much nicer than the soup of letters and numbers most affiliate links resemble. [...]

  7. 15
    White Shadow Says:

    That’s okay, it’s good that you got it sorted out :)

  8. 14
    Dolly Says:

    Sorry,
    i thought they were not working because of all the characters but I missed a step in my installation
    it actually works great

  9. 13
    Cloaking Affiliate Links With Wordpress - 5 Star Affiliate Marketing Forums Says:

    [...] cloaking in wordpress I found a goos Wordpress plugin for cloaking links here : Link Cloaking Plugin for WordPress | W-Shadow.com. It works great for me ! [...]

  10. 12
    White Shadow Says:

    Huh? That is simply not true.

    Most affiliate links are not relative, as they point to a different site. They’re most likely unambiguous for the same reason. Malformed URLs probably wouldn’t work in most browsers, so if your links work, it’s likely they are well-formed.

    From software perspective, affiliate links are no different from “ordinary” links.

  11. 11
    Dolly Says:

    Most affiliate links will not work becuase they are relative, ambiguous or malformed URLs

  12. 10
    White Shadow Says:

    HiTech,

    In this version you can’t get rid of them. They’re what allows me to keep the plugin simple and relatively fast.

    To be able to ommit the numbers I’d have to either encode all of the original URL in the cloaked link (leading to long links with weird characters in them) or store the links in a database (meaning you’d need to set up every cloaked link manually). I’ll think about adding the second feature in a future version.

  13. 9
    HiTech Says:

    How can i get rid of the numbers at the end of the cloaked link? The post id and link id?

  14. 8
    Jai Rodriguez Says:

    Thank you for an excellent plugin and for making my life easier!

    Jai

  15. 7
    White Shadow Says:

    Ramil - no, not yet. I’ll think about adding that feature. I’m not sure it’s possible/easy to do though because on most WordPress blogs the sidebar is handled by “widgets” which could be a problem.

    If you have the link in question in a post you can copy & paste the cloaked link to the sidebar and it should work unless you add/remove links to the post with that link.

  16. 6
    Ramil Says:

    Thanks for the plugin. Is it possible to cloak links in the sidebar, for example I put an affiliate link in the blogroll?

  17. 5
    HiTech Says:

    Thanks for the plugin, i think it will work well on my blog for affiliate links ;)

  18. 4
    PlugIM.com Says:

    Link Cloaking Plugin for WordPress…

    This new plugin may be useful to anyone posting affiliate links on a blog. It can cloak either all or only selected links….

  19. 3
    White Shadow Says:

    On internet marketing forums and similar sites this is often referred to as “cloaking” so I used that term here. There’s a whole bunch of related techniques, call them what you like - cloaking, masking, obfuscation.

    I’ve heard about search engine cloaking but I haven’t really investigated that topic.

  20. 2
    wesley Says:

    You mean link masking. I was thinking you had a search engine cloaking thingie going (showing different content or links to search engines)

    Thanks

  21. 1
    CBTool Blog » Automatically Cloak Links in Your Blog Says:

    [...] I’ve created a plugin for WordPress that can cloak links in your blog posts and pages. Read more and download the plugin here. [...]

Pages: « 7 6 5 4 3 2 [1] Show All

Leave a Reply