Link Cloaking Plugin Update

Some time ago I created a WordPress plugin that can cloak affiliate links automatically. Today I’m releasing a new version, with all-new feature(s)!

The main improvement I’ve implemented is “static link cloaking”. The previous version of the plugin could only cloak links that you’ve actually used in a post, which is inconvenient if you want to use the cloaked link anywhere else, like forums or e-mails, because the cloaked URL might change or stop working if you edited the post. This is still true for automatically cloaked links, but now there’s a new feature available – static links.

Static Links Are Different

  • Independent from the rest of your blog’s content – add any links and use them anywhere!
  • No numbers tacked on the end.
  • The number of hits is tracked!

Here’s an actual example of how a (static) cloaked link’s URL looks –
http://w-shadow.com/goto/GTrends/ (goes to my keyword research tool).

Using Static Links
You can add, remove or view the links in the Manage -> Cloaked Links tab. This page contains a form for adding new links and a list of existing cloaked links, if any. The list also shows the number of hits for each link. Note that the plugin counts all hits, including those generated by search engines and the like. This means that the number will probably be a bit higher than the actual amount of clicks the link received.

A link is defined by a name and a destination URL. The name is what you’ll see in the cloaked URL – in the example above it’s “GTrends”. The name shouldn’t contain any special symbols, like spaces, question marks, non-latin characters and so on. For best compatibility, use only latin letters, numbers and underscores in the name field. The name is case-insensitive and must be unique for each link.

The destination URL indicates the address to which the visitor will be redirected when he clicks the link. No surprises here – just make sure the URL is correct.

Adding static cloaked links is easy – just enter the name and URL in the corresponding boxes and click “Add”. The resulting cloaked URL will look similar to this – http://your_blog_address.com/more/MyLink/. “more” is a prefix that you can set in Options -> Link Cloaking and “MyLink” is the link’s name. You can also view the cloaked URL by clicking the “show cloaked url” thingy near each links destination URL.

To delete a cloaked link, click the “Delete” link in the corresponding row.

Download : WordPress Link Cloaking Plugin, ver. 1.1 (9 KB)

Installation Notes
After you’ve uploaded and activated the plugin, you must go to Options -> Permalinks and click Update Permalinks. This is necessary even if you have the previous version installed. The cloaked links won’t work if you don’t do this! Complete installation instructions and more information about this plugin are available in the original post.

Share :
  • Reddit
  • del.icio.us
  • Digg
  • StumbleUpon
  • DZone
  • Ping.fm
  • Sphinn
Related posts :

83 Responses to “Link Cloaking Plugin Update”

  1. [...] Update 19.09.2007 : vesrion 1.1 – now with static link cloaking! [...]

  2. 2
    Mattg says:

    Hi,

    any chance you could shoot me an email please?
    I’d really like to have a chat with you about this link cloak plugin.
    :)

    cheers,
    Mat

  3. 4
    S.G says:

    Hi White Shadow,

    Your plugin is great, but after trying it on a WP 2.2.3 site, it doesn’t work. When I move my cursor over it, the URL still shows the affiliate ID and such.

    So far, it has only worked for WP 2.2.1 and maybe 2.2.2.

    I’ve not tried it on WP 2.3 but it probably won’t work too?

    S.G

  4. 5
    White Shadow says:

    This site runs on WP 2.3.1 and, as you can see, it works here. I also worked fine when I had 2.2.2. I’d guess it’s conflicting with one of your other plugins, maybe.

  5. 6
    na3s says:

    Hello!

    Great plugin. I had an idea I thought I would share with you, without actually knowing if there is a hook available for it. But here is the idea anyways:

    The ability to cloak links that are included in the template (or more specifically within the loop)

    This would allow the capability to automatically create the link by setting some post-meta data and have the link show up outside the post-entry and instead within the template. Just an idea!

    Thanks again for the great plugin. =)

  6. 7
    White Shadow says:

    Hey na3s, I’m glad you like the plugin.
    Unfortunately I’m pretty sure there isn’t a hook for that.

  7. 8
    Milos says:

    Is there any chance to make it work with custom fields?

    Thanks,
    Milos

  8. 9
    White Shadow says:

    Not in the foreseeable future, no.

  9. 10
    Afizi says:

    Hi, Thanks for your great plugin.. Unfortunately I’m unable to manage it work on my blog. I’m using wordpress version 2.3.3
    When I click on the link its only redirected to my home page. Kindly pls help. Thanks in advance.

  10. [...] most recent version of the link cloaking plugin, though, adds what the author calls static cloaked links. These are what you want to use for [...]

  11. 12
    brent says:

    does this work with wordpress 2.5
    have not gotten it to work

  12. 13
    White Shadow says:

    It should work in WP 2.5, at least it does for me. If you upgraded from 2.x to 2.5 you need to update permalinks (again) for the plugin to work. Also, make sure the “link cloaker” code is at the top of .htaccess (the cloaker-related part of the file is marked as such).

  13. 14
    White Shadow says:

    It should work in WP 2.5, at least it does for me. Just remember to update permalinks, and make sure the cloaker-related code is at the top of .htaccess.

  14. 15
    brent says:

    ok thanks
    does the code in the .htaccess file need to be in the wordpress area
    ‘# BEGIN WordPress” or before that

  15. 16
    White Shadow says:

    Typically it should be at the very top of the file, though it may vary depending on your configuration. It might also work if you put it right after the “# BEGIN WordPress” bit.

  16. 17
    Abel says:

    I installed version 1.2.2 on WP 2.3.1 but I couldn’t find the Manage -> Cloaked Links tab you mentioned. Did I miss anything? Thanks.

  17. 18
    White Shadow says:

    That’s very unusual. Is the other menu – Options -> Link Cloaking – also missing, or just this one? Are you sure the plugin is active?

  18. 19
    Abel says:

    The plugin is active and I can see “Options -> Link Cloaking.” I tested the cloaked links in my posts. They are fine. But I can’t see “Manage -> Cloaked Links” and the hits.

    I downloaded from http://w-shadow.com/files/link-cloaking-plugin.zip. Is the file correct?

  19. 20
    White Shadow says:

    The download link is correct. Just to be sure, I’ll reupload the file, and you can try downloading it again.

    Maybe you can access the page directly by going to :
    yoursite.com/wp-admin/edit.php?page=link-cloaking-plugin/wplc_link_cloaking_plugin.php

    There’s probably some conflict with another plugin…

  20. 21
    Abel says:

    Reinstalled but the problem is still there.

  21. 22
    White Shadow says:

    If it’s a plugin conflict, you could try deactivating all other plugins and checking if it works then. If yes, reactivate them one by one and note which one causes the problem.

    Does the direct URL work?

  22. 23
    Curtis Penner says:

    Hi White Shadow,

    Is your plugin the same as performing a 301 redirect?

  23. 24
    White Shadow says:

    Yes, it uses “301 Moved Permanently” redirects.

  24. 25
    Walt says:

    Hi. Great idea for a plugin.

    I loaded the latest version and followed the instructions, but I’m getting… well.. unpredictable results. Although the redirects seem to wok fine for the posts, links on pages all redirect back to the “home page”. And, not all of the links in pages get cloaked. Not seeing a pattern, so I’m not quite sure what to tell you.

    It there any way to “fine tune” the plugin a bit more? For instance, can I tell the plugin I only want Clickbank and/or Amazon links to get cloaked, and let everything else just sail through like normal?

  25. 26
    White Shadow says:

    The plugin uses the same exact algorithm for pages and posts, so there shouldn’t be any difference – unless there’s a conflict with another plugin.

    There’s the “Exclusions” feature to define which links you don’t want cloaked. There’s no “Inclusions” list, though you could use selective cloaking – adding the <– cloak –&gt tags – to achieve a similar result. I might add that feature in a later version, but … don’t count on it :P

  26. 27
    earncow says:

    Ah cool tool bro :) recommended

  27. 28
    BigKahuna says:

    I am having some difficulty getting this plugin to work…I have it installed but several of the directions are in conflict with what I am seeing. For instance you say “go to Options -> Permalinks and click Update Permalinks.” I do not have any “Options” tab…is this the same as “Settings” (I am using wordpress(.org) 2.5. If I go to Settings->Permalinks there is no “Update Permalinks” setting; only a “Save Changes” at the bottom…please help…I have no idea what I am missing.

  28. 29
    White Shadow says:

    The instructions were written for WP 2.3, so in WP 2.5 it’s slightly different. In WP 2.5, “Settings” replaced “Options”, and you only need to “Save Changes” for the permalinks to be updated.

    The plugin works with WP 2.5, but you may need to manually move the cloaking-related redirection code to the top of your .htaccess file.

  29. 30
    BigKahuna says:

    I did figure out that the site didn’t have an htaccess file so I added one. I also chanced the permissions to 766. Unfortunately whatever I am doing is not updating the htaccess file with whatever code it needs to be able to utilize this plugin…hopefully I am getting closer…any help would be greatly appreciated.

  30. 31
    BigKahuna says:

    Here is what my current htaccess file looks like:

    Options All

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  31. 32
    White Shadow says:

    Try changing the permalink structure, saving the canges, and then changing back to the initial structure. This should update the file.

    Are you sure you looked in the right place for the .htaccess? In most cases, .htaccess would already be present on a WP blog.

  32. 33
    BigKahuna says:

    Ok…I tried to do what you said to do and that didn’t work. When I go to Manage -> Cloaked Links and fill in the 2 fields and select “add” a messed up version of my site shows up where I am assuming the new link should be showing. I tried to deavtivate the plugin and reactivate it but no luck.

    I am not sure about the htaccess file. I had always thought it would be in the “public_html” folder. When I looked for it there using Filezilla I didn’t see it. I found a post claiming that some WP versions omitted it and gave directions on how to include one (which I did in the “public_html” folder). Root directory (using Filezilla) looks like this:

    -Site (folder)
    -logs (folder)
    -public_html (folder)
    -home (folder)
    -wordpress (folder)
    -.htaccess (file)
    -index.php (file)

    Hope any of this helps…thx for everything thus far!

  33. 34
    BigKahuna says:

    Sorry for being such a pain…I realized something while I was typing my last response…I uploaded a file called htaccess.txt. Once I changed it to .htaccess it disappeared from the directory in Filezilla…thinking it was something I did I readded htaccess.txt, changed the permissions and renamed it to .htaccess…the file disappeared again. Now I am thinking that there are 3 copies of the file in my directory but that they are hidden…how can I unhide them?

  34. 35
    White Shadow says:

    So is your blog installed in the root directory, or the “wordpress” directory? I’m guessing it’s the second, though you might have some kind of different, advanced setup. Maybe the .htaccess should be in the “wordrpess” directory.

    Regarding the “Add” bug, it sounds like something that might be caused by an unusual site structure, but I’m not sure…

  35. 36
    White Shadow says:

    Filenames starting with a dot (”.”) are treated as “hidden” on Linux/Unix systems. You can probably make them visible by changing some settings in Flexzilla, but I’m not familiar with that software, so I can’t help you there.

  36. 37
    BigKahuna says:

    Ok found the right htaccess file and here are the contents…it looks right but I am still not getting the right results…what do you think?

    # BEGIN WordPress

    # Link Cloaker Plugin BEGIN

    RewriteEngine On
    RewriteRule promos/([^/]*)/([0-9]+)/([0-9]+)/? wp-content/plugins/plugins/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule promos/([^/]+)[/]? wp-content/plugins/plugins/wplc_redirector.php?name=$1&cloaked_url=$0 [L]

    # Link Cloaker Plugin ENDS

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  37. 38
    White Shadow says:

    Interesting. Those lines shouldn’t look like “/plugins/plugins/”… why are they like that? Either the .htaccess file is wrong, or the plugin is installed incorrectly. The plugin files should be located inside “wp-content/plugins/link-cloaking-plugin/” – in their own directory inside “plugins”.

  38. 39
    BigKahuna says:

    Thanks a ton for helping me diagnose the problem…it looks like the files got uploaded but were not in a folder…my web guy removed the plugin and reinstalled it in the folder and it worked like a charm.

  39. 40
    White Shadow says:

    @BigKahuna – Congratulations :)

  40. 41
    jan says:

    I got an error when trying to add a static link. The “hits” field in the db needed to have a default value. If you have this problem then the following sql query will solve it :

    alter table wp_cloaked_links change hits hits int(10) unsigned default 0;

    Very cool plugin though. Congrats.

  41. 42
    Pushkar says:

    How to make it work for subdirectory ? my wordpress is in /blog directory and the links are just not redirecting. So a page link like /goto/afflink don’t redirects anywhere, eventually showing 404 error as page example.com/blog/goto/afflink do not exist on my site.

  42. 43
    White Shadow says:

    @Pushkar – The plugin shouldn’t have problems with subdirectories provided .htaccess is set up correctly (and is located in that same subdirectory). I have tested it on another blog running in a second level subdirectory (like example.com/stuff/blog/) and it worked fine.

    See what’s in your .htaccess file. There’s an example of how the file should look a few comments below (except your paths will be different, of course).

  43. 44
    Pushkar says:

    Hi Thanks alot :) I got it working. I had to move the code at the top (it was at the bottom before) and things are working like a charm. Great plugin.

    Thanks again

  44. 45
    Michiel says:

    Somehow my links are not getting tracked in the manage cloaked links. I can add a link and remove it. But i thought ALL clicks where tracked? I tried turning off all plugins. no luck.
    I’m using 2.6.1 of wordpress, maybe thats a problem?

  45. 46
    White Shadow says:

    @Michiel – Tracking works for me on WP 2.6.2 (I don’t have a 2.6.1 handy). Just to make sure we’re on the same page : only links you add on that tab (Manage -> Cloaked Links) will be tracked.

    In general if a (static-cloaked) link works – i.e. redirects correctly – it should be tracked. However, the plugin might miss some clicks because if you click the link several times your browser might decide to cache it and go to the target page right away, without accessing the cloaked link again. In this case the click wouldn’t be tracked.

  46. 47
    Ryan says:

    Thank you for the plugin.
    2 suggestions for a future release (if there will be one):

    1. Ability to edit/change static links in Wordpress Admin (including destination url).

    2. Ability to use keywords with static links. Enter certain keywords and those keywords will be turned into cloaked links anywhere they appear. For example anytime “Amazon.com” appears on your site it would automatically be converted into a link using one of your static cloaked links.

    Just suggestions, but I think they could be useful! Thanks again!

  47. 48
    White Shadow says:

    Originally Posted By Ryan
    2. Ability to use keywords with static links. Enter certain keywords and those keywords will be turned into cloaked links anywhere they appear. For example anytime “Amazon.com” appears on your site it would automatically be converted into a link using one of your static cloaked links.

    This has been suggested already, but I probably won’t add it because I don’t feel like reinventing the wheel – there are already existing plugins that can do this, and you could configure them to use the cloaked URLs as the automatic links.

    Overall, there aren’t any updates planned in the near future (for this plugin), just bugfixes – if necessary. Sorry :)

  48. 49
    Andrew Clapham says:

    The plugin works great on other sites, however for this one when you click a link it redirects back to my site. I changed the theme but still does the same thing.

    I am using WordPress 2.6.2, but that version is fine on other sites.

    Any ideas?

  49. 50
    White Shadow says:

    @Andrew Clapham – This is sometimes caused by a conflict with another plugin. Are you using any plugins that add or modify links in the posts?

  50. 51
    Patrick Curl says:

    Question – will you still get credit for trackbacks when writing posts? Pingbacks are very important to the success of my blog.

    Thanks.

  51. 52
    White Shadow says:

    @Patrick Curl – Yes, trakbacks should still work fine if you mark links with <!–cloak–> or set the cloaking mode to “Cloak all”. On the other hand, trackbacks probably won’t work with statically cloaked links (i.e. the links you define in Manage -> Cloaked Links).

  52. [...] Re: Anyone Using The MaxBlogPress Ninja Affiliate WP Plugin? Have you guys tried this free plugin? I just installed it last night and it looks pretty good to me. Link Cloaking Plugin Update | W-Shadow.com [...]

  53. 54
    Steve says:

    Originally Posted By Anyone Using The MaxBlogPress Ninja Affiliate WP Plugin?[…] Re: Anyone Using The MaxBlogPress Ninja Affiliate WP Plugin? Have you guys tried this free plugin? I just installed it last night and it looks pretty good to me. ø Link Cloaking Plugin Update | W-Shadow.com ø […]

    I’m not sure where you are getting your information, but the MaxBlogPress Ninja Affiliate WP Plugin is NOT a free plugin. It costs $97.00.

  54. 55
    Paul says:

    Great plugin but hit counter not working for static links.
    Any suggestions?

  55. 56
    White Shadow says:

    @Paul -
    Hmm, do you mean it doesn’t work at all, or misses some hits?

    If it doesn’t work completely then deactivating and reactivating the plugin might help. If only some hits are not counted that’s probably because the browser caches the redirect sometimes and doesn’t actually query the cloaked URL when the user clicks it.

  56. 57
    Paul says:

    @White Shadow

    The hit counter doesn’t seem to work at all.
    Tried different settings; cleared cache, saved Permalinks, tried cloak all/specific links.

  57. 58
    White Shadow says:

    @Paul – Okay, I’ve uploaded a slightly modified version of the plugin, maybe it will solve the problem. Note : in this particular case you will need to deactivate the previous version before uploading the new one.

  58. 59
    Paul says:

    Still no joy. Thanks for trying. Must be an incompatibility somewhere. Will continue to use, but without the tracking.

  59. [...] ·     Update : version 1.1 available – now with static link cloaking! [...]

  60. [...] currently use the WordPress Link Cloaking Plugin from W-Shadow which is available for free.  As well as allowing you to cloak URL’s, it keeps [...]

  61. 62
    mike says:

    I am using the static cloaking and it does not work with firefox.

    Mike

  62. 63
    White Shadow says:

    The plugin works independently of the browser. If it works in one, it should work in all. If you have problems with FF in particular, then most likely it’s something to do with FF itself.

  63. 64
    viduph says:

    Hi, I use this static cloaking plugin for my WP 2.7, it work fine but still contain numbers at the end like http://www.example.com/go/test/4/1. How do I remove those numbers? I hate them

  64. 65
    White Shadow says:

    My guess would be you have removed your own site to the “Exceptions” list in Settings -> Link Cloaking, so the plugin is cloaking the links twice. Add your domain name to that list and the numbers should go away.

  65. 66
    viduph says:

    I already tried with domain names with and without www prefix (my blog has domain name with www prefix) but it didn’t work. :(

  66. 67
    White Shadow says:

    Interesting. Now, let me get this straight – do you get the link with numbers when creating a cloaked link in “Tools -> Cloaked Links”, or do the numbers get appended when you view a post containing the coaked link?

  67. 68
    viduph says:

    The link in “Tools -> Cloaked Links” does not contain numbers but numbers get appended when I view a post containing the coaked link and cloaked link works fine, just don’t like the numbers.

  68. 69
    White Shadow says:

    Some more ideas :

    * Is there a <!–cloak–> tag in the link? (There shouldn’t be).

    * Are you sure you’re using the static cloaking correctly? Correctly : create a static link and use the plugin-generated cloaked URL in your posts/otherwheres in place of the original URL.

    * If you put a cloaked link somewhere else than in the post – like the sidebar – are any numbers appended (probably not)?

  69. 70
    viduph says:

    Thanks, I remove tag in the link and then replace the original URL with the plugin-generated cloaked URL and it works.

  70. 71
    Belajar Blog says:

    Gocodes disappointed me.

    Glad to be here knowing your plugin. I’ll try it.
    Thanks. :)

  71. 72
    Deaw says:

    I ‘m using piwik.
    How to track outlinks from link cloaking?

    Now, no track link cloaking in actions –> outlinks by piwik

  72. 73
    Jon Lim says:

    Hi there!

    I really like the plugin, and I was excited to use it but unfortunately it doesn’t work for the purpose I was looking for. I was looking to turn this huge, affiliate link into something more manageable like this:

    http://www.musttap.com/link/0028383

    Or something similar, unfortunately as the links are custom fields in wordpress, they seem to not be affected by the cloak. Would you happen to know what’s going on?

    For clarification, I set a PHP variable to pull the custom field and put it into a link in the template:

    <a href="”>

    And it still shows up as the affiliate link.

  73. 74
    White Shadow says:

    Unfortunately the plugin doesn’t work that way. It only deals with links inside post content, so even if you format your PHP code the way you did the custom-field link still won’t be cloaked.

    I’ll add the ability to cloak any link – whether in the post content, sidebar, headers or somewhere else – eventually (probably in a commercial version). That won’t be very soon though.

  74. 75
    name says:

    It is a very good thing,

  75. 76
    Dhany says:

    This plugin is exactly what I need.
    May I suggest one small feature to add “target=”_blank”" option. So the click on the link automatically open in new window.

    Thanks!

  76. Thank you for this great plugin. This is the only cloaking plugin where you can configure global cloaking and specify exception domains. But unfortunately it redirects all cloaked links to my main page. The .htaccess is correctly modified like described in readme.txt. Do you have any suggestions?

  77. 78
    White Shadow says:

    That usually happens with links added by other plugins. Does that ring any bells?

  78. It happens to all cloaked links. Those generated by plugins but also to cloaked links directly in posts or pages. I have turned every additional rewrite rules off in .htaccess, but the plugin still redirects cloaked links to the mainpage instead of redirecting it to the target url. There isnt any other cloaking plugin out there with outstanding features like your plugin and I do not really want to miss it. Do you have any other ideas how to figure out the problem?

  79. 80
    White Shadow says:

    Send me the URL of the site where you have installed the plugin, I’ll take a look and maybe figure something out. You could also email me your .htaccess file, unless it’s secret :) My email is on the contact page.

    And sorry for the late answer, my computer broke.

  80. 82
    Steven Wilson says:

    I’m having the same problem

    “the plugin still redirects cloaked links to the mainpage instead of redirecting it to the target url”

    What was the solution?

    Thanks

  81. 83
    White Shadow says:

    No idea, André never got back to me on the issue (unless I’ve lost the email to my overzealous spam filters or something).

    Anyway, here’s what I know for sure : cloaked links redirect to the homepage when the plugin is unable to find the original URL that corresponds to the cloaked link. This usually happens when the post in question contains links generated by plugins (or other dynamically generated links).

    If that’s the case for your site then the only practical solution is either deactivating the plugin that generates the links, or getting the premium version of the link cloaker that can also handle dynamically generated links.

    If plugin-made links aren’t the problem additional testing will be necessary to localize & fix the issue.

Leave a Reply