Link Cloaking Plugin for WordPress
This is a plugin for WordPress that can automatically cloak outgoing links in your posts and/or pages.
Download plugin
(Note: May not be compatible with the latest version of Eclipse Link Cloaker.)
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.
- 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.
- If desired, you can also add your own cloaked links manually.
Examples
Lets say you’ve got a link you want to be cloaked.
<a href="http://example.com/?affiliate=me">Cloak Me</a>
Once you install the plugin, it will automatically, without requiring any configuration, turn it into a cloaked link when it’s displayed to a visitor:
<a href="http://yoursite.com/goto/Cloak_Me/12/34">Cloak Me</a>
Here’s a live example: Cloak Me
As an alternative to the fully automatic cloaking, you can switch the plugin to “selective cloaking” and tag the links you want to cloak manually:
<a href="http://example.com/?affiliate=me">Cloak Me<!--cloak--></a>
Note: The plugin does not actually edit your posts or permanently modify your links. Instead, it switches them on-the-fly whenever someone views them on your site. When editing a post in the admin panel, you will see the original, uncloaked link.
Download
Version 1.8.4 : link-cloaking-plugin.zip (16 KB)
Requirements :
- WordPress 2.8 – 3.3
mod_rewrite
. If “pretty permalinks” work on your blog then you probably have this already.
(Note: May not be compatible with the latest version of Eclipse Link Cloaker.)
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.
FAQ
Why are some of my links not getting cloaked?
The most common possibilities are:
- Links in the sidebar, header, comment area and so on can’t be cloaked by the free version of the plugin. It only works on links in page/post body. Upgrade to the premium version to cloak links anywhere on the page.
- Links added using other plugins, theme features or custom fields are also supported only in the premium version.
- JavaScript links, as well as Flash and context-sensitive ads are not supported by any version of this plugin.
Why are none of my links getting cloaked?
- If using “Seletive cloaking”, make sure you have actually marked some links with the
<!--cloak-->
tag. - Double-check that the links in question aren’t added or modified by plugins, the theme, or custom fields.
- Contact me. You might have found a bug.
The exception list doesn’t seem to work. What could be the problem?
Make sure to enter only domain names in the “Exceptions” box. For example, given a link like “http://example.com/directory/page.html”, the domain name is the “example.com” part. So to prevent the plugin from cloaking that link, add “example.com” (sans quotes) to the “Exceptions” box. Entering the full URL or “http://example.com/” will not work.
Additionally, if some of your links point to example.com and some to www.example.com, you will need to add both of those to the exceptions.
Why do some cloaked links redirect me back to my homepage?
Most likely, your post(s) contain links created or modified by other plugins, the theme, or custom fields. Either remove those links, or upgrade to the premium version.
Why do some cloaked links redirect me back to my homepage?
See the previous question.
Why do cloaked links display a “Not Found” error?
- Make sure you’re using pretty permalinks.
- Your .htaccess might be out of date. To update it, go to Settings -> Permalinks and click “Save Changes”.
- Your hosting company may be blocking browser access to PHP files in the /wp-content/plugins/ directory, usually as a security measure. The free version of the plugin is not compatible with these hosts. Consider using the premium version instead.
I have a question not addressed in this FAQ. What should I do?
Either leave a comment below, or email me directly. My email address can be found on the contact page.
Related posts :
this is a great plugin 🙂
it will be more helpful if the links page is paginated and an option to edit cloaked links, Thanks
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.
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)?
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.
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.
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
think ive cracked it mate, iits directing to where i point it, thanks for responding
[…] 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 […]
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?
Okay, noted that in my huge idea list. Might get implemented sometime this century 🙂
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
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
[…] Problem loest das Link Cloaking Plugin fuer WordPress. Es schreibt automatisch alle Links oder nur markierte Links in einem Post um und […]
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
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?
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?
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.
@ 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;”) :
Thanks White Shadow… it worked
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