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
- Download the link-cloaking-plugin.zip file.
- Unzip the file.
- Upload the `link-cloaking-plugin` folder to the `/wp-content/plugins/` directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- (Optional) Go to Options -> Link Cloaking and modify the default settings to your liking.
- 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.
@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
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…
@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
@Wally – Web browsers don’t normally show HTTP headers anyway. You’d need a special program or a FF extension to see them…
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.
@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.
@White Shadow – Hi, thanks for the quick reply.
It works like charm.
[...] 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 ø [...]
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
@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?….
[...] 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 [...]
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…)
@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.
@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
@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.
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.
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
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
@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?
@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
@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.
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.
@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
Man that was fast. Thanks again.
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
@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.
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?
@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?
@Ash – Ah traced the problem to an entry i made in the htaccess which conflicted with the rules of the plugin.
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
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.