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. 289
    ubuntu tips says:

    Thx for your help.. my programmer is in now and he fixed it.. i’m not sure what he means, but I figured i’d post it here anyways in hopes you can make sense of it or it can help someone else… thx for your help earlier though, great plugin my man!

    —-
    in .htaccess before Link Cloaker rules was:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^to/(.*) http://$1 [R=301,L]

    So Link Cloaker rules didn’t work, I removed this.
    ——

  2. 290
    White Shadow says:

    Oh, if that code was before the cloaker’s rules then I’m not surprised the cloaker didn’t work. The above rules would intercept and process all URLs before the plugin would have a chance to do the redirect.

  3. 291
    Henry says:

    Hey, I want to add some instructions to the robots file to disallow the links which your plugin created. Whats the best way to do this?

  4. 292
    White Shadow says:

    May I suggest an alternative first : if you enable “Nofollow cloaked links” in plugin’s settings then search engines will treat them just as if they were disallowed in robots.txt.

    If you want to go the robots.txt route, something like this should work (replace “goto” with the cloaked link prefix you use on your site) :

    User-agent: *
    Disallow: /goto/
    
  5. 293
    henry says:

    Hey thanks for that. I feel kinda stupid….I had already checked the no follow box previously…

    This plugin is great though and excatly what I needed. Do you have plans to keep this updated? People like you are what Wordpress is all about.

  6. 294
    White Shadow says:

    Well, I usually fix bugs as soon as possible, but new features are added rarely.

    Perhaps I should start selling this plugin (as in, for money), then I’d have a big incentive to keep improving it. Most other cloaking plugins are commercial already. I’m not quite sure users would appreciate a move like that :)

  7. 295
    Matt Price says:

    Hi,

    This is a great plugin and it works great for links within my posts but it does not seem to work for any other links. I have a template that has a modified single.php file that pulls a link from a custom field. Do you know if there is any way to get these links to be cloaked as well ?

    Thanks
    Matt

  8. 296
    Matt Price says:

    Just to add….

    This is the link that falls outside the “main post” within single.php

    ID, “custom_link”, true)): { ?>

    ID, $field_name, true); ?>
    <a href=”"Check Latest Price

  9. 297
    Matt Price says:

    Whoops … that didn’t show properly.

    ID, “custom_link”, true)): { ?>

    ID, $field_name, true); ?>
    <a href=”"Check Latest Price

  10. 298
    Matt Price says:

    Sorry… I am in danger of spamming these comments. (-: How do I add code to these comments ?

  11. 299
    White Shadow says:

    Use the <pre> tags when posting code. E.g. “<pre>…code…</pre>”

    That said, you can’t really cloak links outside posts. The feature has been suggested a few times before, but I still haven’t gotten around to implementing it.

    Edit : And it wouldn’t be as easy as just dropping a quick hack into the code. Unfortunately :)

  12. 300
    Matt Price says:

    Thanks anyway. I thought this might be the case after reading through other comments. I figured out how to incorporate the link within the post so problem solved. This is a fantastic tool. Many thanks

  13. 301
    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 :(

  14. 302
    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.

  15. 303
    Marco says:

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

  16. 304
    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
  17. 305
    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?

  18. 306
    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.

  19. 307
    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

  20. 308
    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.

  21. 309
    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)?

  22. 310
    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.

  23. 311
    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.

  24. 312
    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

  25. 313
    ian says:

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

  26. [...] 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 [...]

  27. 315
    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?

  28. 316
    White Shadow says:

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

  29. 317
    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

  30. 318
    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

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

Leave a Reply