Link Cloaking Plugin for WordPress
I’ve created a plugin for WordPress that can cloak outgoing links in your posts and/or pages.
Features
- Choose what to cloak – all links, only the links you specify or no links at all.
- Choose where to cloak – posts, pages or both.
- Configure the URL – you can set the “prefix” part of the URL (see examples below).
- Exception list – links pointing to domains in this list will not be cloaked. For example, this is useful if you have chosen to cloak all links but don’t want to cloak the links to your own domains.
- Compatible with all browsers – the link cloaker plugin doesn’t use JavaScript so it will work even for visitors that have disabled JS.
- “Smart” cloaking – relative, ambiguous or malformed URLs will not be cloaked. Better safe than sorry.
- As of version 1.1, static link cloaking.
New! The premium version of this plugin is now available and includes several new features :
- Cloak links in any part of your site, including the comment section and the sidebar.
- Works with plugin-created links.
- Five new cloaking types – for example, you can display the cloaked URL in a frame, or use a special redirect that hides the referrer.
- Improved link management and click statistics.
- Free automatic updates.
- And more. Check out EclipseCloaker.com for complete details.
Examples
Here’s a link explicitly tagged for cloaking -
<a href="http://evil-guide.tripod.com/"><!--cloak-->A Cloaked Link</a>
And here’s what it looks like in the post – A Cloaked Link
If you have configured the plugin to cloak all links (the default) you don’t need the <!–cloak–> tag inside your links.
Installation
- 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 Settings -> 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 : go to Settings -> Permalinks and click “Save Changes”.
Download
Version 1.8.2 : link-cloaking-plugin.zip (10 KB)
Requirements :
- WordPress 2.8 – 3.0.1
mod_rewrite. If “pretty permalinks” work on your blog then you probably have this already.
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.
@White Shadow – Thanks! Totally works. And also, thanks for the quick reply.
[...] Link Cloaking: Automatically cloaks outgoing links in your posts and pages. You can also add static cloaked links manually. [...]
works like a champ. I have 2.7 and it worked without any refreshing. Thank you for this simple yet invaluable plugin.
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
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 :
I’m not sure if the forward slash is required before “wordpress”, so try removing it if still doesn’t work.
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
No idea about the two files; but it’s good that you got it working
Yes, thank you again. What a wonderful plugin.
How can you tell if your link is cloaked?
Thanks
Darrel
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.
[...] Link Cloaking PluginExcellent plugin to cloak outgoing links in your posts, pages, sidebar, etc… (see my woothemes goto-links in the sidebar) [...]
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
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.
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
* With dynamic cloaking :
* 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.
Thanks so much for your help with this! Have a great weekend!
Hey you Plugin not support wordpress 2.7
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).
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.
I’m pretty sure that in the current implementation it also cloaks links in the feed. Your suggestion has been noted.
[...] Link Cloaking [...]
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.
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.
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
[...] 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 [...]
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]
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.
[...] [...]
What is No Follow cloaked links?