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. White Shadow says:

    If you don’t disallow the links and don’t use the nofollow attribute on them, they (the links) will pass the mystical “link power”, or whatever they call it. That is, your links will (slightly) help the target website to rank better.

    Whether this is good or bad for your own website is highly controversial, and I’m not expert enough to comment on that.

  2. Daid says:

    Thanks for your reply, i know some where google don’t like website with a lot of affiliate links : )

  3. Bert says:

    Hello,

    The start out working great then the redirects started to fail. Here is the error in Firefox.

    The page isn’t redirecting properly
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    Any ideas of what it could be? Thank you for the your time,
    Bert

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

  4. Bert says:

    Want to say thanks again for the plugin, but nothing says thanks better than a donation. ๐Ÿ™‚

  5. White Shadow says:

    Hey Bert, thanks for the donation ๐Ÿ™‚

    As far as I know, FF shows this error when a script redirects to itself several times, like in a loop. That should never happen with this plugin, but there’s always a possibility of a stealthy bug. Can you give me an example link that has this problem (so that I can investigate)?

  6. Bert says:

    I sent you an email with the details of the issue. Once we figure out what happen we can post the answer here for the benefit of all endusers. Thanks again!

  7. Sebastian says:

    perfect plugin, working with every wordpress version since 2.5.1 for me.

  8. Authcode says:

    This is a great plugin – thanks – but is there any way it can be modified to also mask links in the RSS feed? Can WP plugins even run on the RSS feed?

  9. White Shadow says:

    @Authcode – Yes, it probably can. I think you would only need to apply the plugin’s the_content filter to the_content_rss and/or the_excerpt_rss, too.

    I don’t know if that makes any sense to you ๐Ÿ˜‰

  10. Authcode says:

    @White Shadow – Not really! ๐Ÿ™‚ But I’ll see what I can do (or break). Thanks again for a great plugin.

  11. gulflee says:

    The Plugin shows “could not be activated because it triggered a fatal error.”” in wordpress 2.3.1 ? is there any things have to be fix?

  12. gulflee says:

    the problem occur here
    WordPress database error: [Table ‘localhost_name.wp_cloaked_links’ doesn’t exist]
    SELECT * FROM wp_cloaked_links ORDER BY name ASC
    any ideal ? tq

  13. White Shadow says:

    That SQL query is executed only on the static link management page, so it can’t be running at activation.

    I don’t know what, exactly, causes the crash on activation, but apparently the required table wp_cloaked_links doesn’t get created. You could try creating it manually :

    CREATE TABLE wp_cloaked_links (
    	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    	name VARCHAR( 150 ) NOT NULL ,
    	url TEXT NOT NULL ,
    	hits INT UNSIGNED NOT NULL,
    	UNIQUE KEY name (name),
    	PRIMARY KEY id (id)
    );
  14. affboy says:

    Here is a easy tool can cloak, even encrypt links.
    FYR
    http://Hide-Affiliate-Links.com/

  15. White Shadow says:

    @affboy – yay, shameless self promotion.

  16. […] expert Hi I am currently experimenting with the ‘link cloaking plugin’ available here: ๘ Link Cloaking Plugin for WordPress | W-Shadow.com ๘ It automatically cloaks all links barr your own domain by default. Thats from memory but pretty […]

  17. Authcode says:

    I’m running version 1.2.2 of this plugin which seems to have stopped working after I upgraded WordPress to version 2.6. Is anyone else getting this? All my cloaked links goto my blog’s 404 page – I’ve had to deactivate for now.

Leave a Reply