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.
  • Works with plugin-created links.
  • 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 Settings -> 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 : go to Settings -> Permalinks and click “Save Changes”.

Download

Version 1.8.2 : link-cloaking-plugin.zip (10 KB)

Requirements :

  • WordPress 2.8 – 3.0.1
  • 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
  • Twitter
Related posts :

594 Responses to “Link Cloaking Plugin for WordPress”

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

  1. 295
    Marco says:

    Hey White Shadow,
    thanks for the good work.

    I have one remark though. It seems your plugin doesnt work with wp Super Cache :(

  2. 296
    White Shadow says:

    Really? I’ve been using WP Super Cache on this site for months and so far the plugin seems to be working fine. E.g. the example link in the post above (“A Cloaked Link”) redirects correctly when I try to click it.

  3. 297
    Marco says:

    Could you paste your .htaccess? Do i have to put Linkcloak b4 or after Wp Super Cache?

  4. 298
    White Shadow says:

    It’s after WP Super Cache but before WP core rules in my .htaccess :

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
     
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
     
    # END WPSuperCache
     
    # BEGIN WordPress
     
    # Link Cloaker Plugin BEGIN
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule goto/([^/]*)/([0-9]+)/([0-9]+)/? wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule goto/([^/]+)[/]? wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
    </IfModule>
    # Link Cloaker Plugin ENDS
     
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
    # END WordPress
  5. 299
    dmhf says:

    Thanks for your plugin. Unfortunately I’ve moved to a new host which doesn’t support mod_rewrite. Is there any chance that this plugin would work with a .htaccess file?

  6. 300
    White Shadow says:

    That would require pretty large changes in the plugin. I’ll add this to the list of possible improvements, but it’s unlikely to get implemented in the near future.

  7. 301
    Karthick says:

    this is a great plugin :)

    it will be more helpful if the links page is paginated and an option to edit cloaked links, Thanks

  8. 302
    ian says:

    hi, im having difficulties with this plugin. every link i attempt to add goes to the same page regardless of the url i have entered. it was working fine for the first 5 or so links. i didnt add any plugins in this time. Do you have any ideas how to fix this, it is driving me nuts. Any help would be very much appreciated.

  9. 303
    White Shadow says:

    Do you mean the “static” links? What page are you being redirected to (i.e. is it your homepage, or a different link you added before)?

  10. 304
    ian says:

    not the static links. origionally it redirected to my homepage but now it is redirecting to the last link i was able to put in to an external site.

  11. 305
    White Shadow says:

    Interesting. I went to check your site, but it looks like you’ve just reinstalled WP. If you still have these problems I’d like to see an example post where the incorrect redirect happens.

  12. 306
    ian says:

    ok mate ive reinstalled and its just going to the homepage from the links now, however the first link i put up worked but the links i put after that all redirected to the page of the origional link!? i have deleted these links and now if you check my homepage you will see links that return to the homepage, so i really dont know what to do. i would appreciate any advice you can offer me

  13. 307
    ian says:

    think ive cracked it mate, iits directing to where i point it, thanks for responding

  14. [...] you would have to create many files. An easier way to cloak links with your blog is by using a link cloaking plugin. Visit that site to learn more about [...]

  15. 309
    chujeck says:

    hi

    great plugin. work like a charm here.

    one improvement would be great though….for people who manage a lot of aff links…maybe some bulk option or csv import?im thinking here about static link cloaking.so i can setup up more cloaking links then one at the time..i think csv would be working great, in one column wp cloaked links in other aff links.what do you think?

  16. 310
    White Shadow says:

    Okay, noted that in my huge idea list. Might get implemented sometime this century :)

  17. 311
    chujeck says:

    Cool!take your time :) I figured out it can be easily achieved “manually” by importing csv file into the cloaked_links table in mysql using phpadmin.works great!

    thanks again for your plugin and have a lovely day!
    chujeck&cipka

  18. 312
    Vicky says:

    Hi, i am using the plugin and it works great, i was wondering if there was a way to add an option of doing a _blank for the window. Can i open any plugin file and add it there on my own so that all link open in new window. thanks

  19. [...] Problem loest das Link Cloaking Plugin fuer WordPress. Es schreibt automatisch alle Links oder nur markierte Links in einem Post um und [...]

  20. 314
    Neal Walters says:

    Not sure what to do on this install step:
    Go to *Options -> Permalinks* and click *Update Permalinks*. This ensures the plugin’s link redirection code is added to WordPress .htaccess file.

    I’m running 2.7.1 and don’t know where the “*Options” is. I went to “Settings/Permalinks”.

    What shoudl the .htaccess look like after the update?

    Thanks,
    Neal

  21. 315
    ian says:

    Hi, sorry to ask but im not sure whats happening with the plugin. It does not cloak my text links and they wont click through. If you look at my homepage you will see this, however, it does cloak the last couple of text links on the page. I hadn’t checked to see if the links were working for some time so i dont know when this happened or why. i have tried deactivating all other plugins and it appears they have no impact on this problem. Any ideas?

  22. 316
    ian says:

    Ok, so it appears that your plugin does not cloak html text links from affiliate windows deep linking tool. I have just made them myself to overcome this. Not sure if this is just a problem with my site? anyone else had the same difficulties?

  23. 317
    White Shadow says:

    I’m guessing the deep linking tool is a plugin, right? The cloaker doesn’t work with links that are dynamically added by other plugins; this is by design and not easy to change.

    I might change this eventually, but currently there’s no workaround.

  24. 318
    White Shadow says:

    @ Vicky :
    Yes, you can edit the wplc_link_cloaking_plugin.php file and insert this code before line 102 (the one that says “return $link;”) :

    $link=str_replace('<a ','<a target="_blank" ', $link);

    @ Neal :
    Indeed, “Settings/Permalinks” is the right page in WP 2.7.x. The .htaccess file should contain a new code block that begins with “# Link Cloaker Plugin BEGIN” and ends with “# Link Cloaker Plugin ENDS”; the actual rewrite rules will vary depending on your blog’s configuration.

    The code should be above the WordPress’ own code in the file.

  25. 319
    Vicky says:

    Thanks White Shadow… it worked

  26. 320
    Neal Walters says:

    So back to the instructions “Go to *Options -> Permalinks* and click *Update Permalinks*. This ensures the plugin’s link redirection code is added to WordPress .htaccess file.”.

    I go to Settings/Permalink Settings and the only button is “Save Changes”. I don’t get what I’m supposed to do here. Does just clicking “Save Changes” do something magical if I don’t change anything on the screen?
    So my .htaccess is not getting changed. It simply contains this:
    # BEGIN WordPress

    # END WordPress

    So I went to Tools “Static Cloaked Links” and it build this link:
    http://freecsharptutorials.com/goto/LearnVisualStudio/

    I put that link on the home page for you to see as “Test Link: Learn Visual Studio”.
    It gives a 404 page not found.

    So what am I missing here?

    Thanks
    Neal

  27. 321
    White Shadow says:

    Yes, it should update the .htaccess even if you don’t actually change anything. It worked that way in older versions and it works on my WP 2.8-bleeding-edge install, so most likely that’s not the problem.

    However, your .htaccess looks suspiciously empty; did it really contain just those two lines, or did my comment filters eat the rest?

  28. 322
    Neal Walters says:

    Yes, the .htaccess is empty except for the two lines that start with the pound sign.
    Is there something I can manually type in there to get this up and running?
    I’m still confused how clicking “Save Changes” would know how to update the .htaccess file.

    Thanks,
    Neal

  29. 323
    Neal Walters says:

    Ok, if I change the Permalink Settings to “Day and Name”, then the htaccess is updated and the cloaking works fine. However, if I change it back to “Default”, then the .htaccess goes back to the two line file. So it appears that the Default settings don’t work with the cloaking? Is that correct? Or a new issue?

    Thanks,
    Neal

  30. 324
    White Shadow says:

    Oops, so it appears WP will ignore plugin-created .htaccess rules if you set the permalinks to “Default”. I’d say this is a WP bug.

    For now, select any other permalink setting to get around this problem. Hopefully I’ll be able to add a more transparent workaround to the plugin … eventually.

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

Leave a Reply