Link Cloaking Plugin for WordPress

I’ve created a plugin for WordPress that can cloak outgoing links in your posts and/or pages.

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.
  • As of version 1.1, static link cloaking.

New! The premium version of this plugin is now available and includes several new features :

  • Cloak links in any part of your site, including the comment section and the sidebar.
  • Five new cloaking types – for example, you can display the cloaked URL in a frame, or use a special redirect that hides the referrer.
  • Improved link management and click statistics.
  • Free automatic updates.
  • And more. Check out EclipseCloaker.com for complete details.

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. Re-save your permalink settings to insert the plugin’s link redirection code to the WordPress .htaccess file :
    • WP 2.7 and above : Go to Settings -> Permalinks and click “Save Changes”.
    • Older versions of WP : Go to Options -> Permalinks and click “Update Permalinks”.

Download

Version 1.3 : link-cloaking-plugin.zip (9 KB)

Requirements :

  • WordPress 2.2 – 2.8.4
  • mod_rewrite. If “pretty permalinks” work on your blog then you probably have this already.
Share :
  • Reddit
  • del.icio.us
  • Digg
  • StumbleUpon
  • DZone
  • Ping.fm
  • Sphinn
Related posts :

438 Responses to “Link Cloaking Plugin for WordPress”

Pages: « 15 6 7 8 9 10 11 12 13 [14] 15 » Show All

  1. 379
    White Shadow says:

    [I got your email, but couldn't respond to it - my email got bounced with a "No such user" error message. So I'm posting my comment here.]

    Ah, I see.

    However, that behaviour is *by design* – it’s supposed to show the
    original URL in the address bar when you actually visit that page. The
    cloaking is currently only useful to hide the destination of the link from
    people browsing your site and, say, hovering their cursor over a link to
    see where it leads – not for fooling those who actually click the link.

    I’m currently working on an improved version of the plugin that will have
    the option to display the linked page inside a frame, which would create
    the effect you desire.

  2. 380
    Tim Scot says:

    How exactly do you make his plugin work, when you have fancy permalinks. Please help.

  3. 381
    White Shadow says:

    Generally you just have to update your permalinks (click “Save Changes” on the permalink settings without actually changing anything).

  4. [...] first commercial WordPress plugin later this month. The plugin will be an improved version of the Link Cloaking plugin and will include a bunch of new and exciting features, like cloaking links anywhere on the site (as [...]

  5. 383
    Sham says:

    Hi,

    Does your plugin work with WP 2.8.4? I just upgraded and I think the plugin no longer works. My cloaked links now show 404 pages

  6. 384
    White Shadow says:

    Yes, 2.8.4 should work fine. You probably need to update your permalinks again (and check the .htaccess to make sure the cloaker code is above the WP code).

  7. 385
    Sham says:

    Hi,

    I’ve rechecked my htaccess and nothing wrong there. Why I think it doesnt work with WP 2.8.4 is because I have 2 sites, one is WP 2.7.1 and the other I upgraded to WP 2.8.4.

    The one with WP 2.7.1 is still working fine. The one with WP 2.8.4 is NOT :(

    I also have a site on another server and this one also the plugin failed to work after I upgraded to WP 2.8.4.

    When I meant fail, it means Failed to redirect….so ends up with a Page Not Found (404)

  8. 386
    White Shadow says:

    This site also runs on WP 2.8.4 as well, so I’m quite sure the plugin should be compatible with it.

    Could you perhaps email me your .htaccess and site URL? Maybe that would help me find some clues. My email is whiteshadow (@) w-shadow (.) com

  9. 387
    Marco says:

    I realised a “bug” in your script. If the URL has an space inside the link wont be cloaked.

  10. 388
    White Shadow says:

    @Marco : Fixed. You can download the updated version via the download link in the post above.

  11. 389
    Sebastian says:

    It would be nice if you can extend your plugin with “link cloaking in comments”!

  12. 390
    Walt says:

    Hi. Me again.

    I left a comment a few weeks ago about how the plugin was not cloaking rover.ebay.com stuff on my blog (although it seems to be working for everything else). Well, over the weekend I upgraded the plugin to 1.2.7 and now it’s working again. Not sure why it stopped, but things are ok now. Except…

    Now sure if you recall, but at one point I asked why the plugin didn’t seem to function with my version of the_excerpt_reloaded (I say “my” version – it’s essentially unchanged other than I overrode the defaults in the plugin). I am forcing the plugin to display an excerpted version of the_content.

    Question – it’s pulling the content as $post->post_content? Does that pull the content before your plugin has filtered it?

    Any help or insight would be greatly appreciated!

  13. 391
    White Shadow says:

    The cloaker filters the post in the “the_content” hook. If the excerpt plugin deals with $post->post_content directly (without calling the aforementioned hook), the cloaker probably won’t catch the post and thus won’t cloak it.

    Try modifying the excerpt plugin so that it calls

    $excerpt = do_action( "the_content", $excerpt );

    before it outputs the excerpt. Obviously you’ll need to replace “$excerpt” with whatever variable the plugin uses.

  14. 392
    Walt says:

    Hmmm.

    Right before

    return $output;

    I added

    $output = do_action( “the_content”, $output);

    Now all I get is titles (no excerpt). Did I misunderstand?

  15. 393
    White Shadow says:

    My mistake, it should be apply_filters(”the_content”, $output). do_action is almost the same thing but it doesn’t return any output.

  16. 394
    Walt says:

    That did the trick. Thanks!

  17. 395
    Walt says:

    However… I have a new problem. I have 2 links on the same page that (should) point to the same destination. The first one looks like:

    /goto/visit_the_product_s_homepage_/4561/1

    That one works

    The second link, which is associated with an image looks like

    /goto/link/4561/2

    That one does not work. It just goes back to the blog’s home page. I tried to remove the /link part but that made no difference.

    Any ideas?

  18. 396
    White Shadow says:

    I’ve uploaded another update; maybe it will work now.

  19. 397
    Walt says:

    I downloaded the release. It still seems to work the same. Here’s some clues (I hope).

    I turned off the plugin completely. All (original) links worked as expected. When I turned it back on, the same thing as reported earlier was happening. The first rewritten link was working, the second with the /link in the URL was not.

    Now, here’s the weird part. That particular post had a URL in the post plus a linked image. A similar post, that only had a single linked image, worked just fine. And, that linked image also had the /link in the URL.

    So, it would appear that it’s not the /link that is throwing everything off, but the /2 that is doing it.

  20. 398
    White Shadow says:

    Well, the plugin will redirect a cloaked link to the homepage when it can’t find the original URL in the post. In this case, although it found and cloaked the image link at first, for some reason it couldn’t find the link again when it was time to redirect the user to the target page.

    This usually happens when one of the links in the post is created by another plugin. Does that ring any bells?

  21. 399
    Walt says:

    Hmmmm. I see where you’re going with this. Yes, there is a plugin that adds the first link when the post is rendered. So, in the rendered post your plugin finds 2 links, but in the original version of the post there is actually only one.

    The two displayed links are actually identical, but the link cloaker apparently just counts links regardless of what it finds.

    I’m not entirely sure how to handle it other than just drop the automatic insertion of the first link.

  22. 400
    Walt says:

    OK. So, I tested it out. You were correct. Does this mean that any modifications to templates could have the same result?

  23. 401
    White Shadow says:

    Links inserted via template manipulation wouldn’t get cloaked at all.

    Stuff like this will be fixed in the “Pro” version – among other things, it will be able to cloak any link, regardless of how it was added and where it’s located – but that version will be commercial (though the price will probably be relatively modest).

  24. 402
    Walt says:

    Will it be handled via database in the Pro version? Or some other mechanism?

    Any thoughts as to when pro might be available?

  25. 403
    White Shadow says:

    Yes, all the links the plugin encounters and needs to cloak will be stored in a database. That is, both the automatically cloaked links and cloaked links that are explicitly defined by the user will be stored in one place. The analytics will be slightly improved, there will four or five redirection mechanisms, etc.

    This version should be feature-complete and usable in a week or so, but I’m not sure how long the other stuff associated with this release will take – e.g. updating documentation and maybe even coming up with something akin to a sales page.

  26. [...] You can download the plugin and get more information here: WordPress Link Cloaking Plugin [...]

  27. 405
    Walt says:

    Hi, me again. Got another “mystery” for you (or, maybe it won’t be for you :) .

    I have some feeds that are posting to my blog. One of the links won’t cloak. You can view the format of it in the website link I posted.

    Anyway, it is formatted as

    http://www.avantlink.com…………..&url=http://www.fetchdog.com……..

    Since it is the only type of link I have that has two domains inside the url, I’m wondering if that is throwing the cloaking off?

  28. 406
    White Shadow says:

    The URL shouldn’t matter, unless it’s invalid. I tested the cloaker with URLs that contain two domains and it worked fine for me. Can you show me the full URL, or, better yet, the entire <a href=….>…</a> tag?

  29. 408
    White Shadow says:

    It still cloaks correctly in my tests. Maybe it’s not the URL itself but rather something in the tag that’s causing this? Is the URL properly quoted? Are there any additional parameters in the tag, like rel=”nofollow” or target=”_blank”?

Pages: « 15 6 7 8 9 10 11 12 13 [14] 15 » Show All

Leave a Reply