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”

  1. [...] I’ve created a plugin for WordPress that can cloak links in your blog posts and pages. Read more and download the plugin here. [...]

  2. 2
    wesley says:

    You mean link masking. I was thinking you had a search engine cloaking thingie going (showing different content or links to search engines)

    Thanks

  3. 3
    White Shadow says:

    On internet marketing forums and similar sites this is often referred to as “cloaking” so I used that term here. There’s a whole bunch of related techniques, call them what you like – cloaking, masking, obfuscation.

    I’ve heard about search engine cloaking but I haven’t really investigated that topic.

  4. 4
    PlugIM.com says:

    Link Cloaking Plugin for WordPress…

    This new plugin may be useful to anyone posting affiliate links on a blog. It can cloak either all or only selected links….

  5. 5
    HiTech says:

    Thanks for the plugin, i think it will work well on my blog for affiliate links ;)

  6. 6
    Ramil says:

    Thanks for the plugin. Is it possible to cloak links in the sidebar, for example I put an affiliate link in the blogroll?

  7. 7
    White Shadow says:

    Ramil – no, not yet. I’ll think about adding that feature. I’m not sure it’s possible/easy to do though because on most WordPress blogs the sidebar is handled by “widgets” which could be a problem.

    If you have the link in question in a post you can copy & paste the cloaked link to the sidebar and it should work unless you add/remove links to the post with that link.

  8. 8
    Jai Rodriguez says:

    Thank you for an excellent plugin and for making my life easier!

    Jai

  9. 9
    HiTech says:

    How can i get rid of the numbers at the end of the cloaked link? The post id and link id?

  10. 10
    White Shadow says:

    HiTech,

    In this version you can’t get rid of them. They’re what allows me to keep the plugin simple and relatively fast.

    To be able to ommit the numbers I’d have to either encode all of the original URL in the cloaked link (leading to long links with weird characters in them) or store the links in a database (meaning you’d need to set up every cloaked link manually). I’ll think about adding the second feature in a future version.

  11. 11
    Dolly says:

    Most affiliate links will not work becuase they are relative, ambiguous or malformed URLs

  12. 12
    White Shadow says:

    Huh? That is simply not true.

    Most affiliate links are not relative, as they point to a different site. They’re most likely unambiguous for the same reason. Malformed URLs probably wouldn’t work in most browsers, so if your links work, it’s likely they are well-formed.

    From software perspective, affiliate links are no different from “ordinary” links.

  13. [...] cloaking in wordpress I found a goos Wordpress plugin for cloaking links here : Link Cloaking Plugin for WordPress | W-Shadow.com. It works great for me ! [...]

  14. 14
    Dolly says:

    Sorry,
    i thought they were not working because of all the characters but I missed a step in my installation
    it actually works great

  15. 15
    White Shadow says:

    That’s okay, it’s good that you got it sorted out :)

  16. [...] Cloak Affiliate Links – This plugin is necessary if you care about how your links look to visitors. Instead of displaying awful-looking affiliate links, like “http://wrdz72.notascam.buynow.com=?aff=12345“, this plugin will make your affiliate links look much more natural, readable, and non-threatening. It’s not perfect – the plugin does leave a couple numbers at the end (no big deal) – but it’s much nicer than the soup of letters and numbers most affiliate links resemble. [...]

  17. [...] time ago I created a WordPress plugin that can cloak affiliate links automatically. Today I’m releasing a new version, with all-new [...]

  18. 19
    TC says:

    I just came across this and am playing with it, I love what I see so far, thank you :) . There is one thing that I’d like to do, for affiliate links it’s a good idea to tag &afsrc=1 at the end of a cloaked link (to protect your commissions from being stolen from parasites and spyware).

    I’m sure I could add that somewhere in the plugin files so that every link I cloak automatically gets that appended to the cloaked link. I just don’t have a clue how to do that though. Could you advise?

  19. 20
    TC says:

    Just to clarify, when the &afsrc=1 is on the cloaked link, I mean that the link will be like this (using your example above):

    http://w-shadow.com/goto/A_Cloaked_Link/45/4&afsrc=1

  20. 21
    White Shadow says:

    Hmm, doing that may be possible, but I don’t understand how would that help against spyware?

    As for editing the files – if you’re familiar with PHP, you can take a look at the wplc_link_cloaking_plugin.php file, lines 87-90. This is where the final form of automatically cloaked links is determined. You could modify that, but then you’d need to also modify the URL rewriting rules on line 157 so that the links still work…

    If you explain how it’s supposed to work and why &afsrc=1 is good against spyware, I may be able to implement the changes myself and send you the modified file.

  21. 22
    Matt says:

    First of all, great plugin! Thank you!

    I’m trying to add NOFOLLOW tags to my cloaked affiliate links so the end result is:

    Test

    becomes

    Test

    Can you tell me which lines of the script I should replace, and with what?

    Thank you again!

  22. 23
    White Shadow says:

    Just to clarify, the plugin is designed so that you can add the nofollow tag to the uncloaked link and it will stay there when it’s cloaked, too.

    Now, for your question – the quick & dirty solution would be to replace line 90 (the one that starts with “return”) in the file wplc_link_cloaking_plugin.php with this line :

    return '<a href="'.$url.'" rel="nofollow">'.$matches[4].$matches[5];

    Try it out. I have a sneaking suspicion that this might cause conflicts with other link rewriting plugins (and similar), but it should work well enough in most cases.

  23. 24
    Curtis Penner says:

    Hi White Shadow,

    I found your plugin just a couple of days ago. After trying several other plugins/solutions to cloak my links…and failing to get them to work, imagine my excitement when I turned on your plugin and it worked right out of the box.

    I LOVE it!

    One question…

    Do “hits” refer to actual clicks on those links or just page views?

    Curtis Penner

  24. 25
    White Shadow says:

    Hey, I’m glad you like it :)

    “Hits” refer to the number of times a link has been followed, so you could say it’s pageviews… except the “real” pageview count is probably lower, because search engines and other bots would also be counted as “hits”.

    Creating a reliable click stats report is nontrivial and I’m not aiming for that – the “Hits” figure is there to give a general idea about the link’s popularity only. You might want to find a separate plugin for accurate stats, or use Google Analytics. You can put the Analytics code on your blog with the Ultimate Google Analytics plugin (this is what I do on this blog).

  25. [...] Cloak Affiliate Links Что умеет этот плагин: Заботитесь о виде своих [...]

  26. 27
    Dolly says:

    Having problems with the 2.3 version of word press
    it seems to be slowing down
    Also it would not write to .ht access file
    Does it have anything to do with file permissions

  27. 28
    White Shadow says:

    What do you mean “slowing down”? Anyway, it’s probably something to do with WP itself.

    If Wordpress can write to .htaccess, so can the plugin, because it works from within WP. I assume you have tried updatibg permalinks, right?

  28. 29
    amy says:

    Hi.

    Great plugin. However I am getting a 404 when I use it. Do you know how to fix it?

    Thanks.

  29. 30
    White Shadow says:

    Do you mean you get a 404 when you click a cloaked link? If so, have you updated the permalinks?

  30. 31
    amy says:

    Yeah, I updated permalinks.

  31. 32
    White Shadow says:

    Well, I don’t have any other bright ideas then. Care to give me a specific example of a link that doesn’t work?

  32. 33
    Toni says:

    a couple of things

    i am noticing problems when using text link ads… specifically, the ads don’t work. I’ve tried updating the permalinks and everything, but when i click on a text link ad, it just hits an error page…

    this could pose a big problem for people using TLA

    second of all, i wish there was a way to cloak links on the blog roll….maybe not automatically, but manually in the wp-admin.. where for example, you can set ‘blogrolllink/aff?123″ to ‘mywebsite/blablabla’

  33. 34
    White Shadow says:

    I don’t know about text link ads, but for the second idea – try going to Manage – Cloaked Links, this might be what you’re looking for.

    I don’t have any TLA ads (at the moment) on this blog, so I really have no easy way to investigate this problem. Maybe, if you have “cloak all links” enabled, it might clash with TLA… try setting it to “selective cloaking” and see if it helps.

  34. 35
    Toni says:

    text link ads provides users w/a wordpress plug-in so that they can sell context text links on their blog. So for example, an advertiser might pay you…oh i don’ t know, $4/mo (for example) for the word ‘cloaking’ in your post….

    i’ve put link cloaker on selective cloaking for now

    would it be too much work to create a drop down…or some sort of menu…in the link cloaker adminstration that lists all context links on a blog with a check box to let you cloak or uncloak? this way you don’t have to go through each post and manually cloak your links on ’selective cloaking…’

    just a thought

  35. 36
    White Shadow says:

    It’s doable, but a lot of work. I’ll keep your suggestion in mind but I can’t promise anything.

  36. i’m also getting a 404 error. I’ve updated the permalinks and htaccess accordingly.
    my wordpress version is 2.3.1
    Please help me with this a.s.a.p
    Thanks!

  37. visit my site and click on a link in a post and you’ll see.

  38. 39
    White Shadow says:

    I looked at your site. I think the the problem is in the .htaccess. Where is your .htaccess located and what does it contain?

  39. 40
    cloudstrif3 says:

    i fixed the problem, the redirect.php file had to be in another folder called plugins within the orig. plugins directory. ex. plugins/plugins/redirect.php

    one more question, after a cloaked link is clicked, is there a way to cloak the url on the address bar? is there a plugin or script that can do this?

    a close example I can give are links on phazeddl.com and how .tk domains cloak site urls.

  40. 41
    White Shadow says:

    It’s good to hear that you got it fixed, though it still is a bug – it shouldn’t require another folder.

    I don’t know any WP plugins for cloaking the link in address bar, but I’ve seen various ways to do it in general. Frames (phazeddl.com uses an IFrame), JavaScript, etc. A quick Google search returns at least one free tool.

    The easiest solution would be to modify wplc_redirector.php, remove the redirection code (the last 3 lines or so) and instead create a single frame that contains the target page. This should be easy for anyone who knows a bit of PHP/HTML, but you’re on your own here. I don’t intend to add this feature to the plugin.

  41. 42
    cloudstrif3 says:

    Can you please help on creating a frame code.
    I don’t know how to insert the html code into the redirect php file

  42. 43
    White Shadow says:

    Fine. Open wplc_redirector.php and go to the end of file. Delete all lines that start with “header….” and the line that says “exit()”. Then insert the below code after the “?>” -

    <html>
    <frameset cols="100%" rows="100%">
      <frame src="<?php echo $url; ?>" scrolling="auto" frameborder="0">
    </frameset>
    </html>

    That’s a very primitive version, but it should work. Not tested.

  43. Hello,

    I get this error. Visit my site for an example.

    Parse error: syntax error, unexpected ‘<’ in /home/halcyonr/public_html/3magin8/site/2/wp-content/plugins/plugins/wplc_redirector.php on line 39

    This is the same problem I had before when I tried to do it myself. How do you insert an html code into a php file?

    Thanks!

  44. 45
    White Shadow says:

    PHP code is between “<?php” and “?>”, everything outside these separators will be treated as HTML. You should be OK inserting HTML after the last “?>” in the file. It is also possible to output HTML (or something else) from PHP code by using the echo function.

  45. 46
    Chirs says:

    Awesome plugin! Just what I’ve been looking for :)

    Is it possible to tell the plugin to encode not only the post content but also a custom tag?

    e.g. for ach of my blog posts I have a custom tag called ‘deeplink’ – how can I get the plugin to cloak this?

  46. 47
    White Shadow says:

    If the tag is added by another plugin and shows up inside the post when the post is displayed, you can’t really cloak it (at least not without some changes to the cloaking plugin… which might lead to new bugs).

    Arrgh, I need more information to really answer your question :P Is this tag part of the post or do you enter it in an additional field on the ‘Write Post’ screen? Also, if it’s added by a plugin, which plugin? It would be easier if I could look at the source code.

  47. 48
    Chirs says:

    Hey, thanks for your quick response.

    Yes, its one of the additional tags that you enter as part of the Write screen.
    I am able to reference it in my templates using:

    ID, “deeplink”, true); ?>

  48. 49
    White Shadow says:

    Looks like your code example got messed up; you should wrap it in <pre lang=”php”> … </pre> tags for it to display correctly (you even get syntax highlighting then).

    Anyway, since you use it in your templates, there is no other way to cloak the links than to modify both the template code and the cloaking plugin. It’s complex, but doable if you’re sufficiently familiar with PHP and WordPress. I can give you a few hints on what to look for, but you’d be largely on your own.

  49. 50
    Chirs says:

    This is the code I use to reference the custom field in my templates.

    ID, “Thumbnail”, true); ?>

    Any tips would be much appreciated!

  50. 51
    Chirs says:


    php echo get_post_meta($post->ID, "deeplink", true);

  51. 52
    White Shadow says:

    Hmm, is <pre> not allowed in normal comments? (It works for me, but then I’m the admin of this blog).

    Okay, there are two things you need to do – rewrite the “deeplink” so that it’s cloaked and modify wplc_redirector.php so that it can recognize the links.

    Rewriting the link : I’d replace your template code with something like this -

    $url = get_post_meta($post->ID, "deeplink", true);
    if (isset($ws_link_cloaker)) {
    	$url = get_option('siteurl').'/'.$ws_link_cloaker->options['prefix'].
    			'/deeplink/'.($post->ID)."/0";
    }
    echo $url;

    You can put something else in place of the “deeplink” text there, like “info”, “details” or whatever you want. This will create an URL that has the same pattern as other cloaked links, yet can be recognized and treated differently because it ends with a zero (normal cloaked links end with above zero numbers). This code should also gracefully handle the situation when the plugin is no longer active, falling back to uncloaked links.

    Modifying the redirector : you’ll need to edit wplc_redirector.php for this, adding special handling for links that end with zero. This can be done in several ways… Look at the first if block, find code that looks like this -

    $link_count=preg_match_all($wplc_url_pattern, $this_post->post_content, 
    	$matches, PREG_SET_ORDER);
     
    if($link_count >= $link_num){
    	$url = $matches[$link_num-1][2];
    	$url = str_replace('&amp;','&',$url);
    } else {
    	$url = get_option('siteurl');
    }

    I’d do it like this -

    if (0 == $link_num) {
    	$url = get_post_meta($post_id, "deeplink", true);
    } else {
    	$link_count=preg_match_all($wplc_url_pattern, 
    			$this_post->post_content, 
    			$matches, PREG_SET_ORDER);
     
    	if($link_count >= $link_num){
    		$url = $matches[$link_num-1][2];
    		$url = str_replace('&amp;','&',$url);
    	} else {
    		$url = get_option('siteurl');
    	}
    }

    Well, that’s all. Unless I’ve forgotten something, or made some typos there (possible, didn’t check), it should work.

  52. 53
    Chris says:

    That worked a treat!

    I owe you a beer

  53. [...] Link Cloaking – Protect your affiliate links. This plug-in allows you cloak (hide) outgoing links in your posts and/or pages [...]

  54. 56
    bonafide says:

    ok, I’ve installed the plugin, and it seems to be working. yay! thanks for the work on this.

    What I’d like to know is why your example on link cloaking, ie the how to be evil site, which is promoting a book, doesn’t have the amazon link cloaked to something that looks way nicer?…

    oh, and could you possibly, in your copious spare time, do a single site step by step walkthrough? for all us noobs to the wonderful world of WordPress?…

    thanks for the work!

  55. 57
    White Shadow says:

    That site isn’t mine, it’s just a random site that I found one day and liked enough to use it as an example here :) I’m in no way affiliated with that website.

    What do you mean with “a single site walkthrough”? Cloaking links on a site that isn’t running on WordPress? Or something else?

  56. 58
    cloudstrif3 says:

    Thanks again for the help!
    Happy Holidays!

  57. 59
    Ben says:

    I keep getting a 404 page. This is the page – http://www.smartgeezer.co.uk/2008/rip-curl-hells-bells-reversible-beanie-hat/ – permalinks has been updated, htaccess updated, I’m pretty sure I set it up right.

    Also, the link doesn’t open in a new window, even if I add the relevant code to Line 90.

    Any ideas?

  58. 60
    Ben says:

    OK, I’ve fixed the opening in a new window (had to remove nofollow in the Link Cloaking options) but not the actual link. It just tries to open the link – http://www.smartgeezer.co.uk/goto/link/68/1 – rather than converting it to the proper cloaked link.

  59. 61
    White Shadow says:

    I’ve looked at your site and my guess is that the .htaccess rules aren’t working. Can you post the relevant part of your .htaccess here? Anything between “# Link Cloaker Plugin BEGIN” and “# Link Cloaker Plugin ENDS”.

    Alternatively, email it to me at whiteshadow {at} w-shadow (dott) com

  60. 62
    Ben says:

    # Link Cloaker Plugin BEGIN

    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]

    # Link Cloaker Plugin ENDS

    tx

  61. 63
    White Shadow says:

    Interesting. The .htaccess looks fine. What’s more, the redirector script itself works OK, as can be verified by visiting this link :
    http://www.smartgeezer.co.uk/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=68&link_num=3

    Maybe the rewriting rules don’t get executed. Is that part of .htaccess before or after lines that look like this? –

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  62. 64
    Ben says:

    The whole .htaccess which sits in the root:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^smartgeezer.co.uk [NC]
    RewriteRule ^(.*)$ http://www.smartgeezer.co.uk/$1 [L,R=301]

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

    # Link Cloaker Plugin BEGIN

    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]

    # Link Cloaker Plugin ENDS

  63. 65
    Ben says:

    You beauty! You’re right, I moved the Link Cloaker stuff to the top and now it works.

    Thanks a lot for your help and for this plugin.

  64. 67
    RichBeaver says:

    I’ve spend some time reading this article and I have to congratulate you for creating a WP plugin that’s doing this.
    I’ve wrote a small article dedicated to easy cloaking methods using JavaScript and PHP for others that are not so good with programming
    Link cloaking step by step guide

  65. Fantastic plugin mate,

    Thank you for releasing it!!!

    Have a Great 2008

  66. 69
    Christoph says:

    Hi, i wanted to use your plugin also. i uploaded it to the plugin directory, then, i activated it and updated the permalinks! but it doesn’t write any code in the htaccess file, so it doesn’t work! :( can you help me? any idea?

  67. 70
    Christoph says:

    do i maybe have to change something in the server admin menü?

  68. 71
    White Shadow says:

    I wouldn’t know about your server admin menus, but maybe you could try adding the code manually and see if it works? In most cases adding this to .htaccess should work :

    # Link Cloaker Plugin BEGIN
    
    RewriteRule more/([^/]*)/([0-9]+)/([0-9]+)/? wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule more/([^/]+)[/]? wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
    
    # Link Cloaker Plugin ENDS
    

    The above code should probably be placed *above* any code that is already there.

  69. 72
    Christoph says:

    doesn’t work :(

    my version of wordpress is 2.3.1 as i think.

    hmm… any other idea?

    my htaccess now looks like this:

    # .htaccess file create by vsa 3.2.9 webserver_rev 2.3
    AuthType Basic
    AuthName “Members Only”
    AuthUserFile /vol2/home/k102184web/.htusers
    AuthGroupFile /vol2/home/k102184web/.htgroups

    # Link Cloaker Plugin BEGIN

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

    # Link Cloaker Plugin ENDS

    # BEGIN WordPress

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

    # END WordPress

  70. 73
    White Shadow says:

    Eh, I forgot to mention to put your own option instead of “more” there; I think it’s “goto” by default.

    Other than that, I’d check if the scripts are there (yourdomain.com/wp-content/plugins/link-cloaking-plugin/) and if the redirector is actually getting called (check HTTP headers or something, if you know how).

  71. 74
    Christoph says:

    I changed it to goto, but nothing happened! hmm… how can i check, if the redirector is called? ^^ i’m not such a pro :P

  72. 75
    White Shadow says:

    Well, a simple way would be to open wplc_redirector.php in a text editor and put something – anything – before the first “<?” string. Then click a cloaked link and see if the text you placed there shows up.

  73. 76
    Christoph says:

    i put “roflmao :D ” before the first <?php and it appeard in the left corner of the whole website including the admin menu

  74. 77
    White Shadow says:

    I find that unlikely/strange. wplc_redirector.php should only be called when you click a cloaked link. Maybe you modified wplc_link_cloaking_plugin.php?

  75. 78
    Christoph says:

    oh :D you’re right :D i modified the wrong file! ;D;D

    but if i put it into the redirector.php file, nothing happens if i click on a cloaked link… he always says, that this page doenst exist oO

  76. 79
    White Shadow says:

    I think the .htaccess is to blame, because it doesn’t call the redirector… and that’s all I can say :P If I was in a situation like this I would try to mess around with the .htaccess file, trying various things, to see why it doesn’t work. However, I don’t have a tutorial for that…

  77. 80
    Jay says:

    I met same problem with Christoph…:-0, hope I can find the solution soon….

  78. 81
    BrainWaver says:

    a BIG fat thanks for this plug!!

    Was going nuts because I had only 404s in the beginning, but found the solution in the comments here – maybe you can add it to the readme that the code in .htaccess has to be at the top – by default it is added in between and wordpress (2.3.2 on my site) adds the WP defaults to the end of the file again… so editing .htaccess manually seems to be a must.

    Now just have to manually redirect the sidebar links.

    All best and again THANKS for this one!

  79. 82
    White Shadow says:

    Good idea, I’ll add it to the readme.

  80. 83
    Christoph says:

    pls try to find a solution for my problem =\
    i need your plugin very much ^^

  81. 84
    White Shadow says:

    Eh, I don’t know. Maybe you need to put the plugin code before the authentication codes? Or something?… No new ideas :/

  82. 85
    jay says:

    I put the plugin code on the top of the .htaccess, yeah,it works!! Thanks

  83. 86
    Net Predict says:

    I have seen this is a great one for a nice Wp plugins :D
    Thank You..

  84. [...] einfachste Methode ist meiner Meinung nach: Link Cloaking Plugin von W-Shadow. Einfach [...]

  85. 88
    Afizi says:

    Seems still not working with wordpress version 2.3.3 any advice?..

  86. 89
    White Shadow says:

    Check some of the comments above. You probably need to move the plugin code in .htaccess to the top of that file.

  87. [...] W-Shadow developed a Link Cloaking Plugin for WordPress and is pretty much well-supported by its developer. I suppose it’s a nice alternative to other “affiliate link manager” (as they like to call themselves, but they’re just fancy words for masking or cloaking links! ) scripts out there, and it seems pretty easy to install, although from reading the comments it also looks like you need to meddle a bit with your htaccess file to make it really work well. [...]

  88. [...] into a clickable link. You might want to use a link cloaking plugin for Wordpress such as this : ø Link Cloaking Plugin for WordPress | W-Shadow.com ø Highlighting sales, special offers, discount codes etc should help especially if they are [...]

  89. hey, nice and neat plugin. Thank you!

  90. 93
    Gary Howie says:

    I’ve been trying this plugin here

    http://www.hyperhigh.co.uk/orbounder-trampoline.html

    but every click sends me back to the home page :(

    Without the plugin activated it sends me to the right place – any advice is much appreciated!

  91. 94
    White Shadow says:

    I’ve looked at your page. The links redirect back to the homepage because the plugin can’t find the original (uncloaked) link in the post.

    This can happen if the original link was created by another plugin, or if it uses some unusual code (as opposed to the normal <a href=’….’>lalala</a> way).

  92. 95
    Gary Howie says:

    ah I see, yeah the post is pulling some of the information from a database using PHP so that could be the problem. thanks for taking a look.

  93. 96
    Telebajar.com says:

    Hi Techs,

    i have a blog where i publish Freeware posts (http://www.telebajar.com) .
    I am looking for a wp plugin to wrap
    the URL´s to the download sites so that i link to a cloaked URL and i can avoid to have broken links to non existing download URLs (outdated)
    a good example is sourceforge.net whre the download links and the mirros are always changing. Do you think this plugin will be useful for this?

    Thank a lot in advance

    Telebajador

  94. 97
    White Shadow says:

    You could use the static cloaking feature to do this. Alternatively, you could use a plugin that checks for broken links.

  95. 98
    Spitkicker says:

    Hi

    Trying out the plugin now and like it so far!

    But one thing, is it possible to use it whitout the prototype js?

  96. 99
    White Shadow says:

    prototype.js is only necessary if you use “static” cloaked links – it’s used on the AJAX-y link editing screen. Other kinds of cloaked links – like those marked with <–cloak–> – don’t need any JavaScript.

  97. 100
    Spitkicker says:

    Ok. Thanks for the answer, will try to take out the pototype then :)

    And thanks again for a nice plugin!

  98. 101
    Spitkicker says:

    I’m stupid hehe.. Did not manage to remove prototype..
    Could I ask for som pointers in what to edit? If it aint to much :)

    Thanks

  99. 102
    White Shadow says:

    Comment out this line:

    wp_print_scripts( array( 'prototype' ) );

    in wplc_link_cloaking_plugin.php. It’s around line 148.

    There’s other stuff that could/should be removed as well, but the above line is the only one you need to remove if you just want to prevent the plugin from adding prototype.js inside the <head> tags.

    I hope that makes sense :P

  100. 103
    Spitkicker says:

    Woks like a charm! Thanks a milion!

  101. 104
    Ash says:

    Does the plugin work with 2.5?

    I had it running on a blog using 2.3.3 but since upgrading its no longer working..

  102. 105
    White Shadow says:

    It works on the WP 2.5 blog that I tested it with, but you might need to update permalinks again.

  103. 106
    Ash says:

    Thanks, i update the permalinks and its working again.

    Many thanks

  104. 107
    Tim says:

    Thanks for this plugin!!

  105. 108
    xytheme says:

    Hey, great plugin you got here.
    I’ve been searching for this like forever.
    Installed and works like a charm.

    One question though, can it parse or cloak the affiliate url on referral image ads?

    If so, can you explain how to do this?

    Thanks.

  106. 109
    White Shadow says:

    If the image ad is simply a normal linked image in a post or page, then yes, the plugin should be able to cloak it automatically.

    If the ad is something complex, like Flash, JavaScript or an IFrame, or if it is located somewhere else – e.g. in the sidebar – then the plugin won’t cloak it.

  107. 110
    xytheme says:

    I got some 125×125 ads on my blog, when you hover on them, you will see the url. So, I want to cloak those links, is that possible?

    If not then I would have to create individual files and redirect the link manually.

  108. 111
    White Shadow says:

    I’m going to assume you mean they are not in your posts. In that case, you could use static cloaking for them. But yes, it involves some manual work.

  109. 112
    xytheme says:

    Well, I thought static cloaking is already in this plugin as per your post said? :P

    Thank, nevertheless it is still a great plugin.

  110. 113
    White Shadow says:

    It is. The “manual work” refers setting up each cloaked link separately :P

    Edit: Okay, let me expand on that. You can go to Manage -> Cloaked Links and add any referral links that you want cloaked. Then you can get the cloaked URL for any of those by clicking the appropriate “show cloaked url” link on that page. Finally, you need to modify your image ads to use the cloaked URLs instead of the original referral links.

  111. 114
    Bert says:

    Hello I found your plugin page on the GFY board, the thread start with this post below. Does your plugin hide affiliate links from search engines and prevent the leaking of pagerank like this script below?

    ____________________________________________
    Tip: Affiliate link redirects – Earn more money

    It’s friday and im in a good mood so thought i’d share this little tip with for any blog owners/site owners that have a lot of affiliate links on their pages.

    If you aren’t already redirecting them, well you should be and here’s how:

    Create a PHP file with the following code and your desired affiliate code/text.

    PHP Code:

    ——————————————————————————–

    http://www.realitykings.com/main.htm?id=fapgallery&p=clean‘,
    ‘college-fuckfest’ => ‘http://signupsb.triplexcash.com/cgi/click?account=560307&site=2&program=2′
    );

    if (array_key_exists($_GET['id'], $path))
    header(’Location: ‘ . $path[$_GET['id']]);

    ?>

    ——————————————————————————–

    Save it as link.php

    Then in your .htaccess file (create one if you dont have one) add:

    Code:

    ——————————————————————————–
    RewriteEngine On
    RewriteRule ^link/([/_0-9a-zA-Z-]+)$ link.php?id=$1
    ——————————————————————————–

    Now in this example i used a realitykings.com affiliate link with the anchor text reality kings.

    To include that link on my pages i would just add a link to:

    http://www.domain.com/link/reality-kings

    When clicked that will redirect to the sponsor link :)

    Remember to block the /link folder in your robots.txt file

    Benefits of this technique:

    1. SEO benefits – google isnt fond of too many affiliate codes on landing pages and it also helps prevent bleeding or diluting of your pagerank score.

    2. Prevent any pc tools or other malware stripping out or replacing your affiliate code.

    3. Earn more money!
    for example today’s nastydollars bonus day all i did was alter a few URL’s in the link.php file and now all my inthevip/vipcrew/ links all go through the reality kings tours.

    Tomorrow i can just re-edit that file rather than the 100’s of hard coded links on my sites.
    ___________________________________________________________

  112. 115
    White Shadow says:

    Yes, the plugin can do that. It can add the rel=”nofollow” attribute to cloaked links, which will prevent them from passing PR. You can enable this feature by going to Options -> Link Cloaking and checking “Nofollow cloaked links”.

    You could also do this by blocking the “link prefix” in robots.txt. By default the prefix is “goto”; it can be configured in the page mentioned above. This is basically the same thing the forum post suggests.

  113. 116
    Spitkicker says:

    Any way to make it work with the alinks plugin? It cloaks all the links created by alinks, but often if a post got 2,3 identical links only the first one works and rest kicks you back to the root of the site.

  114. 117
    White Shadow says:

    Probably there is a way, but I’m currently not inclined to seek it out.

  115. 118
    David says:

    What should i add with robots.txt prevent the search engines from spidering those links
    block them in robots.txt with:

    User-agent: *
    Disallow: ?????

  116. 119
    White Shadow says:

    If your link prefix is “goto”, you should add

    User-agent: *
    Disallow: /goto/

    In general, the form is “Disallow: /link_prefix_here/”

  117. [...] geen enkele credit naar mij, alle kudos gaan naar Janis Elsts voor het ontwikkelen van deze geli(n)kte Wordpress [...]

  118. 121
    Robert Jan says:

    This must be in my top 3 of coolest and more or less ‘hidden’ plug-ins out there. After following the instructions of updating the Permalinks (just save settings in 2.5) and moving the code to the top of the .htaccess it worked like a charm.

    I just had to dedicate an article to you. Thanks, great job!

  119. 123
    Make Money says:

    First of all I want to say great plug in. At first I had the 404. It was simply fixed by moving the lines in the .httacces file to the top of the file … works like a charm now

    # Link Cloaker Plugin BEGIN

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

    # Link Cloaker Plugin ENDS

  120. 124
    Daid says:

    If your link prefix is “goto”, you should add

    User-agent: *
    Disallow: /goto/

    In general, the form is “Disallow: /link_prefix_here/”

    Thanks for your last reply,do i had to add Disallow: /goto/ ?
    If i don’t add Disallow: /goto/ ?
    What may happen ?

  121. 125
    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.

  122. 126
    Daid says:

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

  123. 127
    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.

  124. 128
    Bert says:

    Want to say thanks again for the plugin, but nothing says thanks better than a donation. :)

  125. 129
    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)?

  126. 130
    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!

  127. [...] out this post for more [...]

  128. 133
    Sebastian says:

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

  129. 134
    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?

  130. 135
    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 ;)

  131. 136
    Authcode says:

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

  132. 137
    bloggylicious says:

    Thank You!!

  133. 138
    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?

  134. 139
    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

  135. 140
    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)
    );
  136. 141
    affboy says:

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

  137. 142
    White Shadow says:

    @affboy – yay, shameless self promotion.

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

  139. 144
    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.

  140. 145
    White Shadow says:

    @Authcode – I had some problems with this, but I think updating permalinks fixed it.

  141. 146
    Authcode says:

    @White Shadow – Managed to fix it by updating cloaking settings several times (strangely, didn’t work the first couple of times). I think the Wordpress Automatic Upgrade plugin screwed my plugin settings when it tried to restart them all unsuccessfully after the upgrade. I’ll remember to check my links next time! Cheers.

  142. 147
    Jeff says:

    I just installed the plugin on a couple of my blogs. The first blog the plugin worked great. The second one I had some problems with it. It was interferring with my other plugin “ALINKS” … a plugin to create links to certain keywords. I couldn’t figure out a way to fix the plugin for this page so I just deactivated it because I need the alinks plugin more… If you have a fix for this I’d love to hear about it!

    Otherwise great plugin!

  143. 148
    White Shadow says:

    @Jeff – It might be possible to make both plugins work together, but the links created by ALINK wouldn’t get cloaked anyway.

  144. 149
    Jeff says:

    Yeah, the links from ALINKS were getting cloaked correctly… However, all the links were off by 1. Meaning…. If I had three links in the page… the first link would direct to the second, the second would direct to the third and the third would direct to the associated tag.

  145. 150
    Ash says:

    Is is possible that this plugin can cloak urls in comments and custom fields (of posts)?

  146. 151
    Ash says:

    Found the solution to cloaking custom fields in the comments, thanks. Could’nt find anything regarding cloaking links within comments.

  147. 152
    White Shadow says:

    @Ash – Not at this time; not in the foreseeable future either :P

  148. 153
    Ash says:

    Thanks White Shadow, i’ll try and find another way around the comment links.

    I’m having difficulty cloaking banner ads i’m running from custom fields, your previous ‘hack’ for custom fields worked a treat where i had a plain url to cloak but can this be modified where the url is included within banner code in the custom field?

    Here is an example of the code (links removed) that i include in a custom field called banner468

  149. 154
    White Shadow says:

    @Ash – It’s doable, but would take a lot of thinking/hacking. I’m not up for it at the time, sorry.

    If you want to give it a try yourself, you could use the $url_pattern regexp to extract the URL from the banner and then modify the previous hack to handle these additional URLs.

  150. 155
    Hugo Santos says:

    and what about an option to automatic link insertion to a given keyword instead? :)

  151. 156
    White Shadow says:

    @Hugo Santos – There are already other plugins that can do that :P However, most of them would have compatibility problems with this plugin, unless you use them to insert “statically cloaked” links.

  152. 157
    minimaus says:

    @White Shadow

    Hi White Shadow,

    I put your plugin onto my website: http://nguyenngocminhhanh.com/

    But when clicking on cloaked link, it redirected to not_found.html.

    Could you please take a look and help me work out?

    Thanks

  153. 158
    White Shadow says:

    @minimaus – Looks like the plugin isn’t executed when you click the link. Have you updated the permalinks after setting up the plugin? If yes, check the .htaccess file and make sure the “cloaking”-related rules (they should be marked as such) come before the main WordPress rules.

    Addendum : I looked at your site more in-depth and it appears you are not using “fancy” permalinks. Might it be because mod_rewrite isn’t supported by your host? If that’s the case then this plugin will not work on your site.

  154. 159
    minimaus says:

    @White Shadow

    Many thanks. Could you please give me a recommendation of a script, plugin that overcome this host limitation.

    minimaus

  155. 160
    White Shadow says:

    @minimaus – I don’t have any specific recommendations, but you should be able to find something on Google.

  156. 161
    minimaus says:

    @White Shadow

    How the .htaccess file look like?
    Mine like this:

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    order deny,allow
    deny from all
    allow from all

    order deny,allow
    deny from all

    # BEGIN WordPress

    # END WordPress

  157. 162
    White Shadow says:

    @minimaus – Try adding these three lines between the lines that say “Begin WordPress” and “End WordPress” :

    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]

    I’m not 100% sure it’ll work, but it could make the plugin function correctly.

  158. 163
    minimaus says:

    @White Shadow

    Big big thanks to your helps, White Shadow, even it turn out that the host do not support this plug-in. Maybe i would consider to change to another hosting service.

    bigmaus

  159. 164
    Wally says:

    I’ve tried getting this plugin to work in WP 2.51 and am NOT having success. I followed the suggestions about the .htaccess file but still the links get sent to my 404 page.

    I could not find a place to “update permalinks”. In settings/permalinks the only option is to update the settings. I’ve tried clicking that to no avail.

    Mod rewrite IS available on my host.

    My blog is in a “blog” folder and I’ve tried putting the .htaccess in the root and in the folder.

    Any other suggestions would be appreciated.

    Wally

  160. 165
    White Shadow says:

    @Wally – The wording on the options page has been changed in newer WordPress versions and it doesn’t say “Update Permalinks” anymore; anyway, saving the settings should be enough.

    Just to clear this one up, the .htaccess file needs to be in the directory that the blog is installed in (or your post permalinks probably wouldn’t work).

    I would guess that the plugin-related .htaccess rules are incorrect in your case, most likely either in the prefix or path; I can’t provide any more details without knowing your directory structure and plugin configuration.

  161. 166
    Wally says:

    WS,

    My blog path is just domain.com/blog/. Then it is the normal WP setup. The path to the linkcloaker plugin is \blog\wp-content\plugins\link-cloaking-plugin and I have it set to the default settings for now.

    There wasn’t a .htaccess file in the /blog directory so I just created one with the 3 lines mentioned below in a post between the # START Wordpress and # END Wordpress. BUT… after trying to get the plugin to work the .htaccess file disappears. I guess WP must be deleting it.

    So, maybe there is another conflict and this won’t work on my blog.

    Thanks anyway.

    Wally

  162. 167
    White Shadow says:

    @Wally – Hmm, let me guess – you’re using the basic “?p=xyz” permalinks for your posts, right? In that case WP doesn’t need the .htaccess file and might be deleting it when you update permalink options (just a guess, I have never seen WP actually do that).

    But still, if you create the file manually and put the right lines in it the plugin should work. The challenge might be getting the rules right when doing it by hand.

    By the way, have you tested if you can access domain.com/blog/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php in your browser? If the plugin is correctly installed in the default location that file should redirect to your homepage (not 404).

  163. 168
    Wally says:

    WS,

    No I use the custom permalink: /index.php/%year%/%monthnum%/%postname%.html

    When I try to go to the file domain.com/blog/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php, I just get “Index of /blog/wp-content/plugins/link-cloaking-plugin”. It doesn’t list any files but all three php files are there.

    Wally

  164. 169
    White Shadow says:

    @Wally – AFAIK permalinks beginning with index.php still don’t use .htaccess/mod_rewrite.

    Ahhh, it’s already past midnight in this timezone and I can’t think of anything else useful :P

    BTW : There is a way to tell if the plugin actually gets executed when a cloaked link is clicked – it generates a HTTP 301 response and adds a “X-Redirect-Src” field to the header…

  165. 170
    Wally says:

    @White Shadow – I don’t see any extra text in my 404 page when the link doesn’t work but I use a custom 404 page.

    I notice my SocioFluid plugin doesn’t work when the link cloaker is turned on. I guess I’ll just leave it alone for now since there seems to be several confilicts or problems.

    Thanks again.

    Wally

  166. 171
    White Shadow says:

    @Wally – Web browsers don’t normally show HTTP headers anyway. You’d need a special program or a FF extension to see them…

  167. 172
    Waldo says:

    Hi,
    Thank you for the great plugin. I got a question though.

    How to make the link to “link cloak” under manage menu hidden from user other than admin?

    In wordpress under the manage menu, all links from other plugin are hidden except link cloak when I log in as a normal user.

    Thank you.

  168. 173
    White Shadow says:

    @Waldo – Okay, I’ve change it so that only users who can access Manage -> Links can get to Manage -> Cloaked Links as well. You will need to download the plugin again.

  169. 174
    Waldo says:

    @White Shadow – Hi, thanks for the quick reply.
    It works like charm.

  170. [...] Thanks, I found this plugin for wordpress that looks promising: (hope this type of link is ok) ø Link Cloaking Plugin for WordPress | W-Shadow.com ø [...]

  171. 176
    dinhnq says:

    Hi White Shadow,

    I have install plugin into my website. Unfortunately, my webhosting regularly change my .htaccess file so cloaking links send people to 404 error file.

    How can i configure plugin so whenever the .htaccess change, the plugin is just inactive ?

    Thanks for great plugin.

    dinhnq

  172. 177
    White Shadow says:

    @dinhnq – I could modify the plugin to check .htaccess before cloaking the links, but doing it on every pageload would hurt the blog’s performance. Maybe if it checked every 1000 requests or so?….

  173. 178
    Link Cloaking says:

    [...] Link Cloaking There is a free WP plugin which you can get here: Link Cloaking Plugin for WordPress | W-Shadow.com I can’t vouch for it in any way as I use a different, more comprehensive (paid) plugin, but it [...]

  174. 179
    Rip says:

    Hi! I installed this plugin and it seemed to be working, at least on links that didn’t have subid’s appended to the end of affiliate links.

    So I deactivated it, and reactivated to see if I could get it to work with affiliate links, but then it just shut down the whole site and all pages would just go straight to the home page.

    Any idea why it would do that? I had to remove the code that it added to .htaccess to get the site working again. And now I can’t put it back because the site messes up again. (Hope that wasn’t too vague…)

  175. 180
    White Shadow says:

    @Rip – The plugin redirects to the homepage when it can’t find the original URL of a cloaked link. This is most often caused by a conflict with another plugin. Specifically, plugins that add new links to posts can cause this issue.

  176. 181
    dinhnq says:

    @White Shadow

    Thanks, White.

    I have another question. If I copy post including my cloaked links to a forum e.g. http://abcde.com/goto/Here_to_go/257/10.
    when a click on forum links happen, does this count for my website http://abcde.com/ or forum website.
    i thought it would count for my website because the cloaked links need to be decoded into original affiliate links via my webhost. Is it true?
    If yes, can the affiliate agency track down the original of the click. Some programms are very strick to the registered website, some are not.

    Regards

  177. 182
    White Shadow says:

    @dinhnq – I’m not sure what your definition of “count” is in this context, so I’ll make a wild guess you mean to ask can the affiliate company find out that the visitor came from a forum.

    The way they (the company) might be able to do this is by checking the referer – a particular piece of info that is sent along with each request by most browsers. Would the referer field show the forum or your site? The answer is I’m not sure. I ran a few quick tests and it appears that it will show the forum, but I can’t guarantee that is correct for cross-domain redirects (as in your case). Also, the behaviour might be different between various browsers.

    Overall, I think there is a non-zero chance they would be able to find out.

  178. 183
    Ludovic says:

    I try to cloak all my download links on my membership website, but when ever i click on it to download an ebook or a file in general, it just gives me an error message. Can you cloak links of download link address. Like for ex: http://www.domain.com/lol.pdf and whenever it gets cloaked, and i click on that link its givs me an error message, back to 404 error page.

  179. 184
    Ludovic says:

    hi, i have a membership site, where iw ant to cloack all the download urls. I activated your cloack plugin, and it worked cloacking all the links, then later i notice when i click on a download link like http://www.domain.com/link-plugin.exe thats cloakced, it will bring up a 404.error. How can i fix this? I also, notice the rewrite rule disappear in m7y htcaccess, whenever i update permalinks

  180. 185
    Peter says:

    Hi, first off I love the plugin. Everything works except one feature. If you can tell me if its a setup problem, or it just cant do it that would be great.

    Masks and nofollows links in posts and pages no problem

    What I wanted was to mask/nofollow links in the sidebar as well. Currently it does not do this on my site. I tried creating a static link under “cloaked links” and then adding the masked url to the blogroll, but it just loops back to the same page instead of going to the external site.

    The best feature would be if you could select a tick box when creating a link through the standard WP interface as to whether cloaking applies.

    Can you let me know if the plugin does this? Or a work around?

    Much appreciated

  181. 186
    White Shadow says:

    @Peter – The plugin doesn’t cloak links in sidebars, or in fact anywhere else outside of post/page text.

    Creating a “static” cloaked link and adding it to the sidebar should work though. Does the “masked” link work if you simply copy & paste it to the address bar?

  182. 187
    Peter says:

    @White Shadow – Thanks, at least Im not going crazy. Yes the static link works when pasted into a browser, but not as a normal link added under the blogroll.

    Just to be clear:

    If my affiliate link is http://www.shareasale.com/r.cfm?B=113187&U=96317&M=16188
    And I create a static cloaked link as http://www.forex-trading-systems.com/goto/Automated Forex Trading/

    I put http://www.forex-trading-systems.com/goto/Automated Forex Trading/
    as the link in the blogroll, it just seems to redirect to the homepage.

    Is that the right way to do it?

    Do static cloaked links in the sidebar work for anyone else?
    I may restore my original .htaccess and reinstall the plugin to see if that helps.

    Thanks for your help

  183. 188
    White Shadow says:

    @Peter – Hmm, maybe using a cloaked link that doesn’t contain spaces would help? There’s a chance there might be a bug in the plugin that could cause problems with spaces in URLs.

  184. 189
    Peter says:

    Ok figured it out right after I posted the comment!!!

    its because I had spaces in the static clocked link “/Automated Forex Trading/”

    Did it again with “test” as the name of the static cloak and works fine.
    If your code could add hyphens where spaces are, that would fix it for nubes like me in future. I added another no follow plugin http://blog.andrewshell.org/ and that has sorted it for me.

    If you could add the simple features of Andrews nofollow plugin, I think it would be complete.

    Of course thats just some suggestions and really greatful for what you have done so far.

  185. 190
    White Shadow says:

    @Peter – I’ve modified the plugin to replace spaces with dashes as you suggested (note that this only applies to new links – existing “cloaked” links will not be updated by the plugin). You can re-download it from the same link.

    I won’t merge in the nofollow plugin though. It may be simple, but it’s not entirely relevant to the plugin’s main functionality :P

  186. 191
    Peter says:

    Man that was fast. Thanks again.

  187. 192
    Sebastien says:

    Nice plugin. I tried it and for some reason, the redirect wouldn’t happen for a few minutes. I tried again later and it worked. I am not sure why.

    I set it up to cloak all link but a feature that would be nice is to be able to add a piece od code in my posts/pages to exclude links I don’t want to cloak. ie. ?

    Also, that would be great if I could use the cloaking feature with ads in my sidebar. Maybe for a future release?

    Thanks

    Sebastien

  188. 193
    White Shadow says:

    @Sebastien – Hmm, maybe I’ll add some kind of tag to exclude specific links (someday).

    There have been several suggestions to make it cloak links in other places (sidebars, footer, etc), but at the time I just can’t think of any practical way to do that. If you have just a few links in the sidebar you could manually create a cloaked link for each of them in Manage -> Cloaked Links.

  189. 194
    Ash says:

    I’ve suddenly started getting 404 errors with this plugin. Been trying to track the problem but not having any joy yet, is anyone else experiencing problems?

  190. 195
    White Shadow says:

    @Ash – The plugin hasn’t been modified for a while, so it seems unlikely it would be the source of the problem. Have you made any changes to your server configuration, or installed any new plugins lately?

  191. 196
    Ash says:

    @Ash – Ah traced the problem to an entry i made in the htaccess which conflicted with the rules of the plugin.

  192. 197
    Ken says:

    Hi – This is a problem-free plugin on several sites I have. Thanks!

    But, there is an exception – all I get is 404 errors (on my own site) when cklicking cloaked links on scrapbookinggems.com.

    The only config difference I’m aware of from my other sites using Link Cloaker is that on this site I have restructured my Permalinks, using a combination of Dean’s Permalinks Migration and Permalink Redirect – latest versions. I’m running WP 2.6.3.

    This config was in place before I tried using Link Cloaker. I have remembered to update permalinks, with a writable .htaccess. .htaccess is updated with the Link Cloaker redirects.

    I’ve also tried entering the Link Cloaker’s /goto/ url in the exclusion list for Permalink Redirect, but this makes no difference.

    Any suggestions?

    Ken

  193. 198
    Stephen says:

    I was using your plugin for a while but it stopped working. I wish I could remember what the problem was now but I ended up paying about $100 for a link cloaker because I’m so used to people not supporting their plugins. Now I see that you are still actively involved here so I’m sorry I didn’t report the issue sooner in detail because maybe it could have helped you here. Unfortuneately I don’t remember now exactly what it was doing except that the link cloaker stopped working. Sorry.

  194. [...] first two autoblogs… 1)Is there any advantage to using GoCodes over my link cloaker of choice, Link Cloaking Plugin for WordPress | W-Shadow.com ? I ask because for some reason the titles of my posts aren’t getting cloaked, although on the [...]

  195. 200
    White Shadow says:

    @Stephen – Well… what can I say? Life goes on :)

  196. 201
    White Shadow says:

    @Ken – Check your .htaccess again. The plugin’s rules need to be above WordPress rules in the file, otherwise you might have problems like these.

    Sorry for not replying earlier – your comment got caught by the spam filter.

  197. 202
    webripper says:

    thiiiiiiiiiiiiks man for this very great plugin you saved my ass:-)
    It works 1000%

  198. 203
    Andri says:

    It works great, I like it but the problem is the plugin only redirect to original website, can you masking the link so if visitor go to my link likes http://www.domain.com/go/cloaklink and visitor still see the link at browser not the original link.

    Thank you for the plugin, It works 100%

  199. 204
    White Shadow says:

    @Andri – It could be done, but not in this version.

  200. [...] Affiliate Link URL’s? There is also various link cloaking plugins for wordpress available. Link Cloaking Plugin for WordPress | W-Shadow.com [...]

  201. 206
    Jessica says:

    You are awesome for sharing such a great plugin with us! Thanks!

  202. 207
    PotPieGirl says:

    Hi =)

    I’ve been using this plugin on many of my sites and I love it – thank you!

    Problem – today I upgraded my first blog to WordPress 2.7 and now ALL my cloaked links are broken.

    Any insight?

    I sure hate to have to go wandering the web to find all the places I put these cloaked links…lol!

    Your help would be most appreciated!

    Thank you!

    Jennifer
    ~PotPieGirl

  203. 208
    White Shadow says:

    @PotPieGirl – Oh, I guess you probably need to check the .htaccess, see if the link cloaker code is still there and update permalinks if it isn’t.

    I’ve upgraded to WP 2.7 too and the cloaked links still work fine.

  204. 209
    PotPieGirl says:

    @White Shadow

    Oh, THANK YOU!!!! Something so simple and it worked like a charm – AND saved me a ton of work!!!!

    Jennifer
    ~PotPieGirl

  205. [...] the URL – you can set the “prefix” part of the URL (see examples [...]

  206. 212
    Mario says:

    Would be nice to have. “Cloak all links except tagged with ;)

  207. 213
    White Shadow says:

    @Mario – Yes, yes… ;)

  208. 214
    Peter says:

    Thought I’d mention. I just started a wordpress 2.7 blog. I used the link cloaker plugin but it wouldn’t work.

    So I resaved my permalinks and it worked fine, anyone having 2.7 problems should try resaving permalinks. Got the tip above, thanks.

  209. 215
    Michael Smith says:

    Hi… AWESOME PLUGIN!

    Works great… I just thought I’d mention that I also use Blog Mechanics Keyword Linker Simply because it is not case restrictive and adds a “no-follow” to the links. (http://www.dijksterhuis.org/wordpress-plugins/keyword-link-plugin/)

    However, I notice that Link Cloaker won’t cloak the links that BM Keyword Link generates… any thoughts on that?

  210. 216
    White Shadow says:

    @Michael Smith – As a rule, this plugin won’t cloak links generated by other plugins. This is because it would be very hard to detect those links.

  211. [...] On Number 6: Link Cloaking Plugin. If you promote affiliate stuff like, clickbank or cj.com and you dont want to protect you affiliate links then this is “the” plugin to do just that, i love plugins that are just plain simple and this one is, you go to tools ad your affiliate link and then you get a link like http://www.yoursite.com/goto/affiliateprogram, you see very simple. [...]

  212. [...] sites that will either be flipped, or that I want to keep separate from my main sites, the free Link Cloaking Plugin is a brilliant [...]

  213. 219
    Marc says:

    first of all: thank you for the plugin!

    is there a chance to use wild-cards in the “cloaked links”?

    merry christmas!

  214. 220
    White Shadow says:

    @Marc – I’ll add that to the idea list :)

  215. 222
    YourDealz.de says:

    I use this great plugin but some links createt with the plugin AmazonSimpleAdmin doenst work. They only link to my Site.
    How can I fix this?
    AmazonSimpleAdmin is from here: http://www.ichdigital.de/amazonsimpleadmin

    Please help me

  216. 223
    Edson says:

    Hi Everyone

    anyone else having problems with the plugin and the new version of wordpress? I just noticed that all my links inside my posts are not working anymore so I had to turn off the plugin.

    Let me know if anyone else is having this problem.

    Thanks
    Edson

  217. 224
    White Shadow says:

    @Edson – As someone suggested a few comments below, try updating permalinks again. That should help.

  218. [...] Link Cloaking Plugin: Özellikle bol dış link verdiğiniz sitelerde veya affiliate programları tanıtımı yaptığınız sitelrde link adresini saklaması nedeni ile çok faydalı. Tek eksiği istatistik tutmaması ve aynı başlık altındaki terimlere ortak bir link belirleyememesi Umarım ileride bu özellikler eklenir. [...]

  219. 226
    White Shadow says:

    @ YourDealz.de – I repeat : no, this plugin won’t cloak links generated by other plugins. This is not a bug. It simply can’t be done in the current implementation.

  220. 227
    Alex says:

    White Shadow, thank you for a great plugin. I have it configured and working on my blog, now I am having a weird problem on another blog I am configuring. Is it possible that it works properly with some WP themes but not with others? For this new blog I am configuring I decided to use AjaxBerlee theme and it doesn’t work with it. If I select some other theme it appears to be working fine. This theme uses AJAX, so the URL doesn’t always change in the address bar when you navigate posts and pages of the blog. Clicking on any external cloaked links gives me a page not found message. Any thoughts?

  221. 228
    White Shadow says:

    I’m guessing the theme uses some non-standard mechanism for loading posts and the plugin can’t figure out which post/page is currently visible, leading to invalid cloaked links. I’ll take a look at the theme tomorrow, but can’t promise anything – analysing other people’s code usually isn’t easy.

  222. 229
    Alex says:

    I ended up using a different theme. I just wanted to give you heads up and I was curious what you think might be causing this. I think using these AJAXy themes could hurt my SEO ratings anyways, that’s why I switched themes.

  223. 230
    White Shadow says:

    Ahha, I actually didn’t get anywhere with that theme. And I agree that AJAX is probably bad for SEO.

  224. 231
    Marc says:

    Great help, thanks.

  225. 232
    Prashant says:

    Plugin tested with WP 2.7 and it works though you will need to update the permanent link tab once you have upgraded to 2.7.

  226. 233
    John says:

    The plugin looks great, but I have slightly different requirements. Can you point me to a plugin that would actually CHANGE the outgoing links (not just cloak them for the user) to links pointing to my own domain?

    So basically I’m blogging using an RSS feed and the posts contain lots of outgoing links. I’d like these links to be changed to http://www.mydomain.com/link-1234.html or something which would then re-direct users to the actual page. I’m guessing this would have some SEO benefit by not having too many outgoing links in the posts.

    Is my logic here wrong, or is there a plugin that does this?

    Thanks!

  227. 234
    White Shadow says:

    I think your logic is a bit confused, yes.

    You want a plugin that will rewrite all external links to look like internal ones. However, when the user clicks on such link, they should be redirected to the actual external page. As I see it, this is exactly what Link Cloaker does (except the URLs don’t end in .html).

    Or did you perhaps mean that you want a plugin that would create actual HTML pages that contain nothing but a meta redirect/Javascript redirect? IMHO that would have no SEO benefit and would look weird from the user’s perspective.

    If your main concern is SEO and having too many external links, just check “Nofollow cloaked links” in the plugin’s configuration. This way the cloaked links won’t “count” from the search engine’s perspective.

  228. 235
    uhubuhu says:

    Plugin tested with WP 2.7 and works just fine.

    Still there is a problem with the images. Let me explain.
    I use two plugins for them.
    jQuery-Lightbox(http://www.pedrolamas.com/projectos/jquery-lightbox) and Add Lightbox (http://mdkart.fr/blog/plugin-add-lightbox-pour-wordpress/)
    The Add Lightbox plugin automatically adds the rel=”lightbox[ID_OF_THE_POST]” to images linked in a post using the code href=(’|\”)([^>]*).(bmp|gif|jpeg|jpg|png)(’|\”)(.*?)>(.*?)/i. BUT it cannot do that since they have already being cloaked. :(
    Any way of getting the lot working in harmony/
    Thanx in advance. Great work

  229. 236
    John says:

    Your cloaker works fine for affiliate links in the posts. However, I noticed that the affiliate links are NOT cloaked in the side widgets.

    How can I do this?

    Thank you,

    John

  230. 237
    White Shadow says:

    @ uhubuhu : That’s a bit hard to fix properly in the current release. As a workaround, giving the cloaking hook a later priority might help. To do that, open wplc_link_cloaking_plugin.php and on line 38 change the 2 to 20. The new line should look like this :

    add_filter('the_content', array(&$this,'content_filter'), 20);

    @ John : Currently this plugin can’t automatically cloak links in widgets. However, you could create “static” cloaked links (Tools -> Cloaker Links) and use the cloaked URLs in the widgets.

  231. 238
    Todd says:

    This plug in looks great! Does it also have click tracking so you can track how many people are clicking your affiliate links?

  232. 239
    White Shadow says:

    @ Todd : Yes, but only for “static” links, i.e. automatically cloaked links aren’t tracked.

  233. 240
    Erskine says:

    Hey. I’m having a bit of a problem with the plugin on Wordpress 2.7. I’m trying to cloak my links in the side bar. I’ve used the static cloaking tool and have manually copied and pasted the links into the blogroll, but I get a 404 error when clicking on the links. Any ideas?

  234. 241
    White Shadow says:

    Most likely it’s something to do with .htaccess rules. Do automatically cloaked links work (in posts)? If not, update your permalinks and ensure the cloaking-related rules are near the top of the .htaccess.

  235. 242
    Erskine says:

    @White Shadow – Thanks! Totally works. And also, thanks for the quick reply.

  236. [...] Link Cloaking: Automatically cloaks outgoing links in your posts and pages. You can also add static cloaked links manually. [...]

  237. 244
    Justin G says:

    works like a champ. I have 2.7 and it worked without any refreshing. Thank you for this simple yet invaluable plugin.

  238. 245
    Daniel says:

    Hi,
    I’m having trouble with the Link Cloaking plugin. I have tried every way but I only got 404 pages from the links.

    I have wordpress 2.7, PHP Version 5.2.2 and the following plugins installed:

    All in One SEO Pack
    Easy AdSenser
    Google Analytics for WordPress
    Google XML Sitemaps
    My Category Order
    Sociable
    WassUp
    WordPress Database Backup
    WP-PostViews

    My .htaccess file:

    # Link Cloaker Plugin BEGIN

    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]

    # Link Cloaker Plugin ENDS

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

    Would be very grateful if I could get some expert help.

    Sincerely
    // Daniel

  239. 246
    White Shadow says:

    Looks like your wp-content folder is in a different location than the plugin expects (this is probably a bug). For now, you could try changing two lines in the .htaccess like this :

    RewriteRule goto/([^/]*)/([0-9]+)/([0-9]+)/? /wordpress/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule goto/([^/]+)[/]? /wordpress/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]

    I’m not sure if the forward slash is required before “wordpress”, so try removing it if still doesn’t work.

  240. 247
    Daniel says:

    Hi White Shadow,

    Thank you for your fast response, really good support =)

    Now I saw that there were two .htaccess files on my server. One in the root and one in the /wordpress folder. When I updated the permalinks in wordpress admin it was the only the .htaccess in the root that was updated with the # Link Cloaker code.

    So I copied the code and paste it into the .htaccess file in the /wordpress folder and now it works perfectly. I wonder how it is that I have two .htaccess files?

    Best // Daniel

  241. 248
    White Shadow says:

    No idea about the two files; but it’s good that you got it working :)

  242. 249
    Daniel says:

    Yes, thank you again. What a wonderful plugin. :-)

  243. 250
    Darrel says:

    How can you tell if your link is cloaked?

    Thanks

    Darrel

  244. 251
    White Shadow says:

    Hover your cursor over the link and look at the status bar. If the link is cloaked, you will see an URL that points to the current site. However, the link will actually lead to a different site when clicked.

  245. [...] Link Cloaking PluginExcellent plugin to cloak outgoing links in your posts, pages, sidebar, etc… (see my woothemes goto-links in the sidebar) [...]

  246. 253
    Dave says:

    Love the plugin but I’m having a pretty serious problem, I’m #1 on google for a particular search phrase but when you click on any of the links on this site or any others I have that are using this plugin you go nowhere and you get 404 errors. However it works perfectly fine if your using Mozilla Firefox and click any of the links they are operational and take you exactly where they should. Internet explorer on the other hand, has none of them working, bringing up 404 errors. How in the world does this work only using firefox and on none of the other browsers?? How can I fix this so it works on every one of them????

    Thanks in advance for your help,

    Dave

  247. 254
    White Shadow says:

    According to my own tests, the cloaked links work in IE, Chrome, Opera and Firefox. As far as I know, there is no credible reason why they wouldn’t work in any particular browser – with the possible exception of some kind of bug/malware in the browser itself.

  248. 255
    Dave says:

    Thanks for your quick response on this. I’m still trying to figure out how I got this to work for firefox but not IE or the others it works with. I’m thinking that I may have coded it wrong in the html for it to work in IE.

    Can you give me an example of how it should look like in raw html code, so I can be sure I did it right and used proper coding??
    Let’s say my site is pooltables.com and I want to hyperlink link some text, like billiard balls for sale, and cloak the link that’s going to another site within that linked text. Would you show me what that should like in raw html form please or rather how it should be written?

    Thanks again for your help with this!

    Dave

  249. 256
    White Shadow says:

    * With dynamic cloaking :

    .... <a href="http://someothersite.com/" rel="nofollow"><!--cloak-->billiard balls for sale</a> ....

    * With static cloaking :
    Go to Tools -> Cloaked Links and create a new cloaked link. Then just use the cloaked URL that will be provided by the plugin in place of the original URL. The cloaked URL will look something like this : http://yourdomain.com/goto/yourtext/ , so you would use that address in your posts.

  250. 257
    Dave says:

    Thanks so much for your help with this! Have a great weekend!

  251. 258
    aofza says:

    Hey you Plugin not support wordpress 2.7

  252. 259
    White Shadow says:

    It does support WP 2.7. If it’s not working, the most common reason is you need to update the permalinks (see the post above).

  253. 260
    Walt says:

    Curious. Is it possible to automatically cloak links in the RSS feed as well as in a post?

    Or, better yet, *not* cloak links in the post, but cloak them in the feed?

    Reasoning – I am using some article directory articles in my blog. I can’t cloak those since it is a TOS violation. But, my feed could get scraped, and I’d like *those* links to point back to the actual article on my blog. Or something like that. Plus, although I am leaking some PR in the post itself, I’d rather not leak more of it in the feed.

  254. 261
    White Shadow says:

    I’m pretty sure that in the current implementation it also cloaks links in the feed. Your suggestion has been noted.

  255. 263
    GT says:

    This is a great plugin and going to be real help in a new project of mine, thanks.

    I just have a question. For security I have a different wordpress address to my blog address i.e.

    WP Address: http://www.domain.com/wp_folder/
    Blog Address: http://www.domain.com/

    As the functions are using the siteurl to build the redirects my wordpress address appears instead of my blog address for the cloaked links. I’ve tried changing ’site url’ to ‘home’ and adding the wp_folder to htaccess but haven’t had much luck. Any suggestions?

    Thanks.

  256. 264
    White Shadow says:

    Tricky. The rewrite rules generated by the plugin are not actually fully compatible with WP 2.6, so editing them might be tricky, too.

    Anyway, I’ve uploaded a new version that could fix your problem. Maybe. You will need to update permalinks (to regenerate .htaccess) after installing it.

  257. 265
    GT says:

    Excellent! That worked a treat, just had to append the worpress folder name to the path in the .htaccess and it worked.

    Thanks for going to the trouble of looking at it

  258. [...] if you use a Wordpress Blog there is a good plugin for cloaking affiliate links, called ’Link Cloaking Plugin for Worpress’ (surprisingly!) which you can download for [...]

  259. 267
    Jill Tovey says:

    Hi, I’ve just installed the plugin and the cloaking looks to be working but it’s not redirecting – just goes to a 404. I have updated the permalinks and I’ve also tried altering the directories in the .htaccess to see if it makes a difference but no luck so far, this is what I currently have in the .htaccess file

    # Link Cloaker Plugin BEGIN

    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]

    # Link Cloaker Plugin ENDS

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

  260. 268
    White Shadow says:

    The .htaccess looks fine at first glance, but it also appears you don’t have the latest version of the plugin (1.2.6). Download and install it again, then update permalinks, too. The latest version uses slightly different rewrite rules that should be more compatible with some non-standard WP installations.

  261. 270
    M Bhatti says:

    What is No Follow cloaked links?

  262. 271
    White Shadow says:

    This option inserts the rel="nofollow" into the cloaked links. Nofollow’ed links are ignored by search engines, which can be sometimes useful for SEO purposes. You might nofollow a link if you don’t want search engines to count it as a “vote” for the linked site.

  263. 272
    steve says:

    Maybe I missed the whole picture here, but if I write an article in wordpress and I’m linking to an affiliate, I just link whatever text I like with the affiliate url. How does this plugin do anything different than that? I would like to hide the url when I get to my affiliate! Did I miss something? I’m probably too dumb to understand the difference.

  264. 273
    White Shadow says:

    When you use a normal link the user can hover the cursor over the link and see that it goes to an affiliate site. With this plugin, the link will look as if it points to another page on your site (e.g. “yoursite.com/goto/1/2″).

    However, the user will see the URL of the affiliate site when he actually goes there. If you want to prevent that you’d need to open the link inside a frame, which is currently not possible with this plugin.

  265. 274
    Txn says:

    Hi

    Just installed the plugin and it works great. However, I have an issue. I want the destination url to NOT reveal the affiliate link but just to show the merchant’s url. For example, if I cloaked http://www.clickbank.com/aff?3 to http://www.abc.com/goto/clickbank/, when I click on the cloaked link, it brings me to the merchant’s page with my ugly affiliate link showing on the browser url. This is the part that I’m most worried about in terms of aff hijacking. Is there a way to have the destination url to not show the aff link but just the merchant’s url?

    THanks very much
    Txn

  266. 275
    White Shadow says:

    Not really. Only the merchant him/herself can implement this – they could use a redirect to go to record whatever aff. data they need and then send the visitor to a “clean” URL. It’s not hard to do but many sellers just aren’t that tech savvy/don’t care.

    Alternatively, there’s the frame idea I posted about above, but it’s not implemented yet.

  267. 277
    Sarah says:

    Great plugin! Thank you! One future suggestion that would be great is to be able to categorize the statics links (i.e. I’d like to basically reproduce my categories list into the static links so that I can easily find the ones I need.)

  268. 278
    Sarah says:

    Hello again! I just posted yesterday, but I have a question. Is there any way we can edit the affiliate link without having to delete the old one and re-add it?

  269. 279
    White Shadow says:

    Sorry, that’s not possible in this version.

  270. 281
    Top-Marx says:

    Ignore the above as the use of html has made my post confusing!!!

    I’m trying to find out if linkcloak will cloak script language javascipt banner ads, as it doesn’t appear to do so with my site?

    Cheers

  271. 282
    White Shadow says:

    It doesn’t cloak javascript ads. In fact, I suspect there is no way to cloak script-generated ads efficiently unless you write a custom cloaking script for each ad service.

  272. 283
    Henry says:

    Having some problems with the pluing in Wordpress 2.7.

    When plugin is activated, I find I am unable to upload images, add catergories or tags. Deactivating the pluing allows it though.

  273. 284
    White Shadow says:

    This could happen if the plugin outputs an error message when loaded during an AJAX request. I’ll need to know the error message to fix it, but extracting the message from the AJAX stuff can be a bit tricky.

    Personally, I’d go with a HTTP sniffer and examine the traffic manually. But that might be overkill in your case, so here’s something simpler to try – check your WordPress directories for error_log or similarily named files. In many server configurations PHP errors are recorded in these files, so you may find the error message in there. Check the root directory, wp-admin, and the plugin’s directory.

  274. 285
    ubuntu tips says:

    i’m getting the same 404 errors with that this guy is, on the latest 2.7.1:

    February 20, 2009 at 15:08
    Hi, I’ve just installed the plugin and the cloaking looks to be working but it’s not redirecting – just goes to a 404. I have updated the permalinks and I’ve also tried altering the directories in the .htaccess to see if it makes a difference but no luck so far, this is what I currently have in the .htaccess file

    —-

    i did everything according to your directions. I had this issue before and fixed it but I don’t recall what I did to make it happen.. Can you assist? Thx for this killer plugin.

  275. 286
    White Shadow says:

    Can you post the relevant part of the .htaccess here? It would be much easier to figure it out if I knew what the rewrite rules look like for your site. (You can also email it to me at whiteshadow [at] w-shadow [dot] com if you don’t want to disclose this information publicly)

  276. 287
    ubuntu tips says:

    sure, and thx..

    # BEGIN WordPress

    # Link Cloaker Plugin BEGIN

    RewriteEngine On
    RewriteRule out/([^/]*)/([0-9]+)/([0-9]+)/? http://example.com/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule out/([^/]+)[/]? http://example.com/wp-content/plugins/link-cloaking-plugin/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

  277. 288
    White Shadow says:

    Hmm, everything looks fine and the URLs are correct, but it still doesn’t work. Let’s try this : replace the plugin’s rules with these :

    RewriteEngine On
    RewriteRule out/([^/]*)/([0-9]+)/([0-9]+)/? /wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule out/([^/]+)[/]? /wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
  278. 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.
    ——

  279. 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.

  280. 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?

  281. 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/
    
  282. 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.

  283. 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 :)

  284. 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

  285. 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

  286. 297
    Matt Price says:

    Whoops … that didn’t show properly.

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

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

  287. 298
    Matt Price says:

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

  288. 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 :)

  289. 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

  290. 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 :(

  291. 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.

  292. 303
    Marco says:

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

  293. 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
  294. 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?

  295. 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.

  296. 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

  297. 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.

  298. 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)?

  299. 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.

  300. 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.

  301. 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

  302. 313
    ian says:

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

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

  304. 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?

  305. 316
    White Shadow says:

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

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

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

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

  309. 320
    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

  310. 321
    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?

  311. 322
    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?

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

  313. 324
    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.

  314. 325
    Vicky says:

    Thanks White Shadow… it worked

  315. 326
    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

  316. 327
    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?

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

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

  319. 330
    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.

  320. 331
    volcomjon says:

    hi there, can you tell me how I can cloak links that dont appear in the post body – but are part of custom keys added to each post? I see the plugin reads through the actual body of posts and pages etc – but I have constructed my aff links using custom keys – and am calling them in the single post page.

    I cant add static cloaks for all my links, so how do I get this to work?

  321. 332
    volcomjon says:

    oh – and just to add, im sure its pretty important – im trying to cloak a link which is an image – NOT text.

    how can I do this in single.php (I am using custom keys as mentioned in my previous post)

  322. 333
    White Shadow says:

    Short answer : Can’t be done.

    Long answer : A feature like this has been suggested several times, but I’m presently too lazy to update this particular plugin. I’d need to completely rewrite the cloaking algorithm to let it support cloaking arbitrary custom fields.

    That said, if you only wan’t one specific field then it’s doable (but not easy). You might even find some relevant code examples in one of the older comments here. Basically, you need three things :

    * A piece of code that grabs the link from the custom field and displays it in a special cloaked form (e.g. http://example.com/goto/custom/field_name/ ).

    * An appropriate rule in .htaccess that ensures wplc_redirector.php will be called when a link like that is clicked (you can use the two existing cloaker rules as a starting point).

    * Modify wplc_redirector.php to fetch the field name from the request, load the post in question, get the field value and redirect the user to that URL.

    Good luck ;)

  323. 334
    volcomjon says:

    hi, thanks for the reply, im afraid all of that is way above me and wouldnt have the first clue where to start (regardless of your tips :) ) if anyone can help me out – in terms of supplying instructions or code, that would be great. Im using a standard name throughout all posts for the custom key (deeplink) – and it never changes

    fingers crossed

  324. 335
    Brandon says:

    This is a seriously awesome plugin!

    Thank you sooo much!

  325. 336
    Michiel Ebberink says:

    @ sebastian If you want to exclude a category you can replace some code in wplc_link_cloaking_plugin.php and leave the include on page unchecked.

    Its just my simple hack, Its probably not the best way to do t, but saves time.

    Replace:

    function content_filter($content){
    if (is_page()){
    if(!$this->options['is_page']) return $content;
    }

    else if(!$this->options['is_post']) {
    return $content;
    };

    with:

    function content_filter($content){
    if (is_category(’YourCategoryslug’)){
    if(!$this->options['is_page']) return $content;
    }

    if (is_page()){
    if(!$this->options['is_page']) return $content;
    }

    else if(!$this->options['is_post']) {
    return $content;
    };

  326. [...] Das Link Cloaking Plugin von und Janis Elts kann automatisch alle Links oder nur bestimmte Links “versteckt” werden. So können zum Beispiel Links von Partnerprogrammen “getarnt” werden. Das Plugin ist getestet bis WordPress 2.7.1 VN:F [1.2.3_620]Bitte warten…Rating: 0.0/10 (0 votes cast) Bookmarks setzen: Diese Icons verlinken auf Bookmark Dienste bei denen Nutzer neue Inhalte finden und mit anderen teilen können. [...]

  327. 338
    Roger says:

    Hi
    I have been using the link cloaking plugin successfully in the post body etc. However I would like to use it in the sidebar as well using a text widget. I haven’t been able to get it to work so far. Is there a way to do this.
    Thanks for your help. Roger

  328. 339
    White Shadow says:

    At this time, you can only use static cloaking in the sidebar. That is, manually create a cloaked link in Tools -> Cloaked Links and then use the cloaked URL in the widget.

  329. 340
    Rainer says:

    Das sollte man beachten!!
    Links in der Sitebar werden mit diesem Plugin nicht gecloakt.
    Downloadlinks die z.B. auf eine externe zip Datei zeigen, funktionieren gekloakt nicht mehr.
    Wer solche Links in seinem Blog anbietet, sollte die Funktion „einzelnes cloaken“ wählen.

  330. 341
    Deaw says:

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

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

  331. [...] redirect. For each cloaked link I use a plugin called Link Cloaking Plugin. You can get it here: Link Cloaking Plugin for WordPress | W-Shadow.com Once it has been installed I cloak all links I want to use and then place the cloaked link in any [...]

  332. [...] you use Wordpress, there is a good plugin for cloaking affiliate links, called ’Link Cloaking Plugin for Worpress’ (surprisingly!) which you can download for [...]

  333. [...] Link Cloaking Plugin by Janis Elsts ‘Tis a dastardly contraption for fooling your visitors into thinking your [...]

  334. [...] Affiliate link cloaking with Wordpress I am using this one on a WP 2.7.1 install Link Cloaking Plugin for WordPress | W-Shadow.com Perfect and [...]

  335. 346
    saiful says:

    cool plugin. i heard this is one of the useful plugin for seo purpose

  336. 347
    Your Netbook says:

    I’ve been using this plugin for a while now and it’s always worked well.

    This week I had to re-install my site due to a plugin crash (not yours) and when I re-installed the Link Cloaker all my links started to go to my most recent post and not to the merchants page.

    I have had to de-activate the plugin now so as not to lose sales but do you have any idea what has gone wrong?

    Phil…

  337. 348
    White Shadow says:

    You probably need to update your .htaccess with the cloaker’s rules. To do that, go to Settings -> Permalinks and click “Save Changes”.

    If that doesn’t help, open the .htaccess and make sure the plugin’s code is at the top of the file. It’s the part that begins with “# Link Cloaker Plugin BEGIN” and ends with “# Link Cloaker Plugin ENDS”.

  338. 349
    Your Netbook says:

    The first suggestion worked perfectly. It’s something that I know I should have thought about but you tend to panic and think it’s something else though.

    Thanks for your help.

    Phil…

  339. 350
    3dogs says:

    Does this problem have issues with sub-domains in urls (other than www)? Everything is working perfectly except for some rover.ebay.com urls. I’ve put echo’s and var_dumps in strategic places within the script to see what goes where, and the rover.ebay.com urls never even get to the rewrite_link function. Could this be a regex issue (which is like a foreign tongue to me)?

  340. 351
    3dogs says:

    Boy, I fat -fingered (or perhaps fat-brained) that post. Change “Does this problem” to “does this plugin”.

  341. 352
    White Shadow says:

    I don’t think sub-domains are the problem here – in fact, a link pointing to “http://rover.ebay.com/” gets cloaked just fine on my test site.

    Could you post the full HTML for one of the problematic links (i.e. the entire “<a href= …. </a>” code) so I can test it myself?

  342. 353
    Michael says:

    Hi J – ,

    Editing this behind a password…I have Ad boxes for my affiliate marketing. Pulling my hair out trying to get this to work. Here is a live demo of the WP Theme I’m using: http://www.gabfirethemes.com/demos/blognews/.

    I have ads placed in the header, footer, the right sidebar (iTunes one) and the top Ad Spot 125×125 box so far. None are cloaked although I’ve got the Plugin installed.

    Do I need to design a widget for this to work? I’ve tried to use the cloaked URL in the code that I need to upload, but that doesn’t work.

    Do I need to go “static” or use in the affiliate code?

    thanks for your help.

    Michael

  343. 354
    Michael says:

    The last sentence should read….

    Do I need to go “static” or use “” in the affiliate code?

    I didn’t put quotes around “cloak” and it disappeared!

  344. 355
    White Shadow says:

    In this case you should use the so-called “static” links which can be defined in Tools -> Cloaked Links. Enter your normal affiliate URLs in that tab and then click on “show cloaked url” to get a cloaked URL for each link. Then use those cloaked URLs in your ads.

  345. 356
    rogersnz says:

    Hi

    I have been using your plugin for some time and it works really well in posts and pages.
    However I need to create a cloaked link in the sidebar. I have created a static link under Tools/Cloaked Links. However I am not sure exactly where or what to put it in my code in the sidebar.
    Have looked on this site for some examples but haven’t seen any so far.
    Can you please provide a couple of examples? That would be really great.

    Thanks, Roger

  346. 357
    White Shadow says:

    Just use the cloaked URL (the one you see when you click “show cloaked url” on that page) in the same way as you would use the original affilate link. There is nothing more to it.

  347. 358
    Michael says:

    Static Cloak did not solve the issue I’m having. I know it is not the plugin though. Trying to cloak some Amazon Affiliate html code, for example the hypothetical below. This is the entire html code.

    Tried cloaking the following:

    http://rcm.amazon.com/e/cm?t=gigfy-04&o=1&p=26&l=ur1&category=kindle&banner=8675309ad=ifr

    with and without the question marks and several other variations.

    To make things more challenging, when you do a “mouse-hover” the redirect shows “http://www.amazon.com/andsfkadskfa;sldkjfaksjdf;kajsdf” which I’ve also tried to cloak.

    Do I need to create a subdomain or subdirectory for this? I’ve tried a simple .php script where it went something like:

    mydomain/index.php?title=new page name

    where “new page name” ‘cloaked’ the above html code from Amazon.

  348. 359
    White Shadow says:

    I’m afraid I don’t quite understand what you’re trying to say. This may be because some HTML code was automatically stripped from your comment. If you want to post code, try surrounding it with <pre></pre>

    Did you try to cloak an entire HTML code block using this plugin? That would not work; the plugin isn’t designed for that. It only cloaks links, or – more specifically – URLs. It doesn’t deal with link titles, HTML code, JavaScript, Iframes or anything else like that.

    If the hypothetical HTML code contains an URL, you could take that URL, make a cloaked version of it, and modify the HTML to use the cloaked URL instead.

  349. 360
    Tor Gunnar says:

    Will you at a later time update the plugin so it will work inside your template aswell?

    That will be awsome and im sure your donate button will get 100% more used ;)

  350. 361
    White Shadow says:

    I’ve thought about it, but it would be very tricky to do and probably cause conflicts with some other plugins like WP-SuperCache. Perhaps someday :)

  351. [...] This is done through the use of a Wordpress plugin. [...]

  352. 364
    Michael Hartzell says:

    Rick,

    All the way from http://www.internetmarketingforums.net.

    This is great information. You have a knack.

    Just a shout out and will give it a tweet too!

    mike

  353. [...] To use the plugin, get the zip file from this link -> Installation -> Download the link-cloaking-plugin.zip file. Then, upload and activate the [...]

  354. 368
    tomron says:

    i dowloaded your plugin sometime ago and im using it all the time. its great so far so thanks a lot for it…now here comes the question:there is a simple tracking implemented in this plugin, it shows you how many times cloaked link have been clicked.unfortunately it shows you overall number of clicks for a link…what if i want to see how many clicks were made daily?so lets say i have these 50 links, i would like to see some kind of general DAILY summary how many times links have been clicked.i know it may be too much to implement it in the plugin but maybe you have some idea how to track it using some analytics or other tracking plugin…i was trying to figured it out but wasnt luck yet…any ideas would be much appriciated!
    so how do you daily track your cloaked links?anyone happy to help?

  355. 369
    White Shadow says:

    I think there might be a way to do it with Google Analytics. The “/goto/” (or whatever prefix you have) should look like a normal directory to GA and thus the details should be available in GA -> Content -> Content Drilldown. Unfortunately I can’t test this myself, as I have very few cloaked links on this site.

    If it doesn’t work right away you can probably force GA to track those clicks using something similar to the code that this plugin uses to track outgoing links.

  356. 370
    Paul Palmer says:

    Does anyone get an Internal Server Error when the plugin is activated? Mine does and I don’t know whats wrong.

  357. 371
    tomron says:

    thanks a lot for your fast response.
    Unfortunately /goto/ doesnt show in content drilldown…i tired to find it there before and no no :( ga doesnt track /goto/ at least for me…its something to do with “outbound” links (although your links are outbound as they are cloked they seem to be inbound)
    so tehre is a solution for outbound clicks and you kind fo mention it…you need to tag all your links with onclick parameter.The problme is that i have quite a lot of cloaked links all over the place, and tagging them manually seems like a waste of time. i havent tried oratranslplant plugin yet, i was trying to do the same with yoast – ga for wordpress plugin that is supposed to tag all outbound links automaticlly but it seems it doesnt like links your plugin create…so i dont know really…i thought you may have some solution you are using yourself or other people figured out how to do that. ill try plugin you mentioned and see what happens.thanks anyway!

  358. 372
    White Shadow says:

    You might also be able to adapt this script for your needs.

  359. 373
    Larry says:

    I am having a similar problem to Your Netbook above, but the solution seems to be different. I have resaved the permalinks and the code appears in the htaccess file as it is supposed to (code appears below). The links are cloaked in the status bar, but when you click one, it redirects to my homepage.

    Does it matter that the affiliate links use this format already?:

    ?url=

    (as in this CJ affiliate link:) http://www.anrdoezrs.net/click-(feed-id)-(my-aff-id)?url=http://www.merchant-site.com/

    # Link Cloaker Plugin BEGIN

    RewriteEngine On
    RewriteRule goto/([^/]*)/([0-9]+)/([0-9]+)/? http://tickets-below-face-value.com/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule goto/([^/]+)[/]? http://tickets-below-face-value.com/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]

    # Link Cloaker Plugin ENDS
    # BEGIN WordPress

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

    # END WordPress

  360. 374
    White Shadow says:

    The plugin redirects to the homepage when it can’t find the original link in the source post. Links in the “?url=” format should be fine (I checked).

    This problem usually happens when the link is added by another plugin. Does that give you any clues?

  361. 375
    Larry says:

    Thanks White Shadow. I think it might.

    I am using ExecPHP, which allows me to put php inside the post and executes it for me. The affiliate links are generated dynamically by the php script inside the post or pulled directly from the database.

    Any way to get the cloaker to work anyway?

  362. 376
    White Shadow says:

    This has been a common request and will be added in a future version. However, that version may very possibly be commercial.

  363. 377
    Richard says:

    Hi,
    Please can you help.
    I have spent many hours trying to get the link cloaking plugin to work.
    I have read all of the recent forum posts and have done all the things that are talked about. Updated permalinks , checked htaccess files they are all OK and still no success.
    I have tried creating posts in two different domains that I have. One is on wordpress version 2.8.1 and the other on 2.8.2. They have different themes – one is dateless sniper and the other is on Semiologic. But there is no difference.
    I do not know which way to turn next. When I am creating a post should I be able to see the cloaking process within the link because at the moment the link just looks like a normal link when viewed in the html window.
    I await your comments.

  364. 378
    White Shadow says:

    So what exactly doesn’t work? Is it that links don’t get cloaked, or that they don’t redirect properly?

    A cloaked link will look the same when creating or editing a post. The actual cloaking happens when the post is displayed on the blog (this should also work in the post preview, if you use that).

    If you can’t get any links to cloak, check the settings page – maybe you’ve got selective cloaking turned on when what you really want is the “cloak everything” option. Or maybe the exclusion list contains something that it shouldn’t.

  365. 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.

  366. 380
    Tim Scot says:

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

  367. 381
    White Shadow says:

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

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

  369. 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

  370. 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).

  371. 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)

  372. 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

  373. 387
    Marco says:

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

  374. 388
    White Shadow says:

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

  375. 389
    Sebastian says:

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

  376. 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!

  377. 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.

  378. 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?

  379. 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.

  380. 394
    Walt says:

    That did the trick. Thanks!

  381. 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?

  382. 396
    White Shadow says:

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

  383. 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.

  384. 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?

  385. 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.

  386. 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?

  387. 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).

  388. 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?

  389. 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.

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

  391. 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?

  392. 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?

  393. 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”?

  394. 409
    Walt says:

    Hmmm. I copied and pasted it as it shows up. When I view the source, there are no other tags associated with the href. I dunno – I’ll put some echo’s in and see where it’s dropping out. Maybe there’s another filter that’s doing something before it gets to the link cloaker.

  395. 410
    Sue says:

    Your plugin works fine on my site. everything except the affiliate link I have placed on the sidebar – on the home page. I think it may be because there is a configuration page for the theme that I am using which allows be to place the image location and re-direct link. I have set to cloak all pages by default. I tried adding at the end. did not work. any help? thanks.

  396. 411
    White Shadow says:

    The plugin doesn’t currently cloak links outside of post content (e.g. sidebars, comments, page header of footer). But due to popular demand, this feature will be added in the next version.

  397. 412
    Carl says:

    I am having the same problem with 2.8.4.

    I have checked the .htaccess and the code is above the wordpress code.

    I am getting 404’s aswell – does it conflict with phplinkdirectory?

  398. 413
    White Shadow says:

    I’m not aware of any conflicts with that plugin. Have you tried deactivating phplinkdirectory temporarily and seeing if you still get 404 on cloaked links?

  399. [...] Link Cloaking Plugin for WordPress [...]

  400. 415
    Ricardo says:

    Hi,
    I use the plugin about a year but never had cloak a link from ebay.
    After having made it the plugin crashed and will not let me delete the link with the cloak i had before.
    I uninstalled the plugin and reinstall again and everything was equal. I can no longer use the plugin at this site.

    Someone can help me.

    Regards

  401. 416
    White Shadow says:

    Unfortunately this version of the plugin doesn’t delete the saved cloaked links when you uninstall it. You need to manually remove the link from the wp_cloaked_links table in your database (this can be done with something like phpMyAdmin).

    If you could post the eBay link here, I might be able to find out why it crashes the plugin, and fix the bug.

  402. 417
    OneMoreGadget says:

    I just have to thank you for writing such a great and simple to use application. More people should know about this. I have spent hours and hours trying all sorts of cloaking plugins, you name it I downloaded it and isntalled it.

    Basically every single plugin for wordpress I have tried and yours is the best.

    The only flaw was that it didn’t open links in a new window, but that simple code that White Shadow posted does the trick, and it wasn’t scary at all to do. Phew.

    Thanks again, great job.

    OneMoreGadget

  403. 418
    OneMoreGadget says:

    Now if I could only find a plugin that automatically fixes typos…ahem.

  404. 419
    janPeter says:

    hello,

    What can i do by custom_fields?

  405. 420
    mike says:

    When i mouse over the link it is cloaked, but I get a 404. I deactivated all plug ins and still get 404. Any ideas?

  406. 421
    White Shadow says:

    Do you have a caching plugin installed? It might be serving the old cached version of the page.

    Try going to the target (uncloaked) URL directly; maybe it’s simply down?

  407. 422
    Chelle says:

    Sidebar links would be nice :) Other than that, a nice handy plug-in.

  408. 424
    furam says:

    Hi White Shadow!
    I am very curious about the premium version of Link Cloaking. Just one question as I am currently using the free Link Cloaking Plugin with manual cloaking: can I just switch to the premium version with auto cloaking or are there any preparations neccessary I should be aware of?

  409. 425
    White Shadow says:

    That depends on what you mean by “manual cloaking” :

    If you mean using the <!–cloak–> tag to specify which links get cloaked, then you can just switch to the premium version with zero hassle. The new plugin is backwards-compatible and will continue to cloak the tagged links.

    If you’re referring to the “static” links feature instead, there will be one additional step necessary after you’ve installed the premium version : you’ll need to go to Tools -> Cloaked Links -> Named and click the “Import” button to import those links in the new version’s database.

    In general, the update process is intended to be as painless as possible, but if you have any problems you can always ask me :)

  410. 426
    Anna says:

    I am using Wordpress 2.8.4. I have set up a new site with just a home page and one post, but when I click on this post it seems to default to the home page and that’s the URL that is shown. I have set up test posts so that I have several and they all do the same thing. I have tried the suggested remedy of putting the code above the wordpress code in the .htaccess file, but still the only page displaying is the home page, no matter which post I click on. And, whenever I update my permalinks the code is reinserted in its original position below the wordpress code, so that I then have the code both above and below the wordpress code.

    I have deactivated all other plugins and reverted to the wordpress default theme and this problem only occurs when your plugin is activated. The plugin does cloak my affiliate links, but it seems to be diverting all post URLs to the home page.

    I love what this plugin does – do you have a solution for this problem?

  411. 427
    White Shadow says:

    Seems like multiple users have been having this problem recently, but I haven’t been able to reproduce it on my own site(s). Could you give me the URL of your site in question so I can run some tests? You can send it via email ( whiteshadow@w-shadow.com ) if you don’t want to reveal it publicly.

  412. 428
    Anna says:

    Thanks for looking into this. I’ve sent you an email.

  413. 429
    Joseph says:

    We installed your excellent plugin but the cloaked links all open in the same window. We want the links to open in a new window or tab instead.

    We are using the “Cloak All Links” option, because editing the thousands of links in all our posts would be unworkable..

    Is there a way to have them all open in a new window or a new tab?

  414. 430
    White Shadow says:

    Not in the free version, sorry.

  415. 431
    Mark says:

    Have dropped you an email as I’m getting the 404 error aswell!

  416. 432
    Mark says:

    Actually cancel my help, like a plonker I didn’t read all the “Read Me” file and hadn;t manually updated the .htaccess file. It all works OK now :)

  417. 433
    White Shadow says:

    Oh well, I’m glad that it works. Please disregard my email that I sent literally five seconds before you posted that comment :P

  418. 434
    s says:

    If I were to use the default which would cloak all links… some of my links are inserted for better seo (anchor text links to internal pages) would google still see them as anchor text links?

  419. 435
    White Shadow says:

    Internal links are excluded from cloaking by default, even if you use the “Cloak all links” setting. You would have to remove your domain name from the exclusion list in Settings -> Link Cloaker to enable internal link cloaking.

    But to answer your actual question – yes, I think they would still count as anchor text links even if they were cloaked.

  420. 436
    Jeff says:

    None of the sites I put in the exceptions box are excluded, including my site. What should I do? I really like that feature.

  421. 437
    Bookshop24-7 says:

    Excellent plugin, thank you! I had trouble with it at first, but after reading through some of these comments I realized that, like a previous commenter I had not read the ReadMe file and so hadn’t updated my permalinks. Once I did that, everything seems to be working beautifully! Thank you for a great plugin!

  422. [...] Link-Cloaking-Plugin : It is easy to install and use. And it doesn’t use JavaScript so it will work even for visitors that have disabled JS. In addition it is pretty much well-supported by its developer. [...]

Leave a Reply