Link Cloaking Plugin Update
Some time ago I created a WordPress plugin that can cloak affiliate links automatically. Today I’m releasing a new version, with all-new feature(s)!
The main improvement I’ve implemented is “static link cloaking”. The previous version of the plugin could only cloak links that you’ve actually used in a post, which is inconvenient if you want to use the cloaked link anywhere else, like forums or e-mails, because the cloaked URL might change or stop working if you edited the post. This is still true for automatically cloaked links, but now there’s a new feature available – static links.
Static Links Are Different
- Independent from the rest of your blog’s content – add any links and use them anywhere!
- No numbers tacked on the end.
- The number of hits is tracked!
Here’s an actual example of how a (static) cloaked link’s URL looks -
http://w-shadow.com/goto/GTrends/ (goes to my keyword research tool).
Using Static Links
You can add, remove or view the links in the Manage -> Cloaked Links tab. This page contains a form for adding new links and a list of existing cloaked links, if any. The list also shows the number of hits for each link. Note that the plugin counts all hits, including those generated by search engines and the like. This means that the number will probably be a bit higher than the actual amount of clicks the link received.
A link is defined by a name and a destination URL. The name is what you’ll see in the cloaked URL – in the example above it’s “GTrends”. The name shouldn’t contain any special symbols, like spaces, question marks, non-latin characters and so on. For best compatibility, use only latin letters, numbers and underscores in the name field. The name is case-insensitive and must be unique for each link.
The destination URL indicates the address to which the visitor will be redirected when he clicks the link. No surprises here – just make sure the URL is correct.
Adding static cloaked links is easy – just enter the name and URL in the corresponding boxes and click “Add”. The resulting cloaked URL will look similar to this – http://your_blog_address.com/more/MyLink/. “more” is a prefix that you can set in Options -> Link Cloaking and “MyLink” is the link’s name. You can also view the cloaked URL by clicking the “show cloaked url” thingy near each links destination URL.
To delete a cloaked link, click the “Delete” link in the corresponding row.
Download : WordPress Link Cloaking Plugin, ver. 1.1 (9 KB)
Installation Notes
After you’ve uploaded and activated the plugin, you must go to Options -> Permalinks and click Update Permalinks. This is necessary even if you have the previous version installed. The cloaked links won’t work if you don’t do this! Complete installation instructions and more information about this plugin are available in the original post.
[...] Update 19.09.2007 : vesrion 1.1 – now with static link cloaking! [...]
Hi,
any chance you could shoot me an email please?
I’d really like to have a chat with you about this link cloak plugin.
cheers,
Mat
Email sent
Hi White Shadow,
Your plugin is great, but after trying it on a WP 2.2.3 site, it doesn’t work. When I move my cursor over it, the URL still shows the affiliate ID and such.
So far, it has only worked for WP 2.2.1 and maybe 2.2.2.
I’ve not tried it on WP 2.3 but it probably won’t work too?
S.G
This site runs on WP 2.3.1 and, as you can see, it works here. I also worked fine when I had 2.2.2. I’d guess it’s conflicting with one of your other plugins, maybe.
Hello!
Great plugin. I had an idea I thought I would share with you, without actually knowing if there is a hook available for it. But here is the idea anyways:
The ability to cloak links that are included in the template (or more specifically within the loop)
This would allow the capability to automatically create the link by setting some post-meta data and have the link show up outside the post-entry and instead within the template. Just an idea!
Thanks again for the great plugin. =)
Hey na3s, I’m glad you like the plugin.
Unfortunately I’m pretty sure there isn’t a hook for that.
Is there any chance to make it work with custom fields?
Thanks,
Milos
Not in the foreseeable future, no.
Hi, Thanks for your great plugin.. Unfortunately I’m unable to manage it work on my blog. I’m using wordpress version 2.3.3
When I click on the link its only redirected to my home page. Kindly pls help. Thanks in advance.
[...] most recent version of the link cloaking plugin, though, adds what the author calls static cloaked links. These are what you want to use for [...]
does this work with wordpress 2.5
have not gotten it to work
It should work in WP 2.5, at least it does for me. If you upgraded from 2.x to 2.5 you need to update permalinks (again) for the plugin to work. Also, make sure the “link cloaker” code is at the top of .htaccess (the cloaker-related part of the file is marked as such).
It should work in WP 2.5, at least it does for me. Just remember to update permalinks, and make sure the cloaker-related code is at the top of .htaccess.
ok thanks
does the code in the .htaccess file need to be in the wordpress area
‘# BEGIN WordPress” or before that
Typically it should be at the very top of the file, though it may vary depending on your configuration. It might also work if you put it right after the “# BEGIN WordPress” bit.
I installed version 1.2.2 on WP 2.3.1 but I couldn’t find the Manage -> Cloaked Links tab you mentioned. Did I miss anything? Thanks.
That’s very unusual. Is the other menu – Options -> Link Cloaking – also missing, or just this one? Are you sure the plugin is active?
The plugin is active and I can see “Options -> Link Cloaking.” I tested the cloaked links in my posts. They are fine. But I can’t see “Manage -> Cloaked Links” and the hits.
I downloaded from http://w-shadow.com/files/link-cloaking-plugin.zip. Is the file correct?
The download link is correct. Just to be sure, I’ll reupload the file, and you can try downloading it again.
Maybe you can access the page directly by going to :
yoursite.com/wp-admin/edit.php?page=link-cloaking-plugin/wplc_link_cloaking_plugin.php
There’s probably some conflict with another plugin…
Reinstalled but the problem is still there.
If it’s a plugin conflict, you could try deactivating all other plugins and checking if it works then. If yes, reactivate them one by one and note which one causes the problem.
Does the direct URL work?
Hi White Shadow,
Is your plugin the same as performing a 301 redirect?
Yes, it uses “301 Moved Permanently” redirects.
Hi. Great idea for a plugin.
I loaded the latest version and followed the instructions, but I’m getting… well.. unpredictable results. Although the redirects seem to wok fine for the posts, links on pages all redirect back to the “home page”. And, not all of the links in pages get cloaked. Not seeing a pattern, so I’m not quite sure what to tell you.
It there any way to “fine tune” the plugin a bit more? For instance, can I tell the plugin I only want Clickbank and/or Amazon links to get cloaked, and let everything else just sail through like normal?
The plugin uses the same exact algorithm for pages and posts, so there shouldn’t be any difference – unless there’s a conflict with another plugin.
There’s the “Exclusions” feature to define which links you don’t want cloaked. There’s no “Inclusions” list, though you could use selective cloaking – adding the <– cloak –> tags – to achieve a similar result. I might add that feature in a later version, but … don’t count on it
Ah cool tool bro
recommended
I am having some difficulty getting this plugin to work…I have it installed but several of the directions are in conflict with what I am seeing. For instance you say “go to Options -> Permalinks and click Update Permalinks.” I do not have any “Options” tab…is this the same as “Settings” (I am using wordpress(.org) 2.5. If I go to Settings->Permalinks there is no “Update Permalinks” setting; only a “Save Changes” at the bottom…please help…I have no idea what I am missing.
The instructions were written for WP 2.3, so in WP 2.5 it’s slightly different. In WP 2.5, “Settings” replaced “Options”, and you only need to “Save Changes” for the permalinks to be updated.
The plugin works with WP 2.5, but you may need to manually move the cloaking-related redirection code to the top of your .htaccess file.
I did figure out that the site didn’t have an htaccess file so I added one. I also chanced the permissions to 766. Unfortunately whatever I am doing is not updating the htaccess file with whatever code it needs to be able to utilize this plugin…hopefully I am getting closer…any help would be greatly appreciated.
Here is what my current htaccess file looks like:
Options All
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Try changing the permalink structure, saving the canges, and then changing back to the initial structure. This should update the file.
Are you sure you looked in the right place for the .htaccess? In most cases, .htaccess would already be present on a WP blog.
Ok…I tried to do what you said to do and that didn’t work. When I go to Manage -> Cloaked Links and fill in the 2 fields and select “add” a messed up version of my site shows up where I am assuming the new link should be showing. I tried to deavtivate the plugin and reactivate it but no luck.
I am not sure about the htaccess file. I had always thought it would be in the “public_html” folder. When I looked for it there using Filezilla I didn’t see it. I found a post claiming that some WP versions omitted it and gave directions on how to include one (which I did in the “public_html” folder). Root directory (using Filezilla) looks like this:
-Site (folder)
-logs (folder)
-public_html (folder)
-home (folder)
-wordpress (folder)
-.htaccess (file)
-index.php (file)
Hope any of this helps…thx for everything thus far!
Sorry for being such a pain…I realized something while I was typing my last response…I uploaded a file called htaccess.txt. Once I changed it to .htaccess it disappeared from the directory in Filezilla…thinking it was something I did I readded htaccess.txt, changed the permissions and renamed it to .htaccess…the file disappeared again. Now I am thinking that there are 3 copies of the file in my directory but that they are hidden…how can I unhide them?
So is your blog installed in the root directory, or the “wordpress” directory? I’m guessing it’s the second, though you might have some kind of different, advanced setup. Maybe the .htaccess should be in the “wordrpess” directory.
Regarding the “Add” bug, it sounds like something that might be caused by an unusual site structure, but I’m not sure…
Filenames starting with a dot (“.”) are treated as “hidden” on Linux/Unix systems. You can probably make them visible by changing some settings in Flexzilla, but I’m not familiar with that software, so I can’t help you there.
Ok found the right htaccess file and here are the contents…it looks right but I am still not getting the right results…what do you think?
# BEGIN WordPress
# Link Cloaker Plugin BEGIN
RewriteEngine On
RewriteRule promos/([^/]*)/([0-9]+)/([0-9]+)/? wp-content/plugins/plugins/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
RewriteRule promos/([^/]+)[/]? wp-content/plugins/plugins/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
# Link Cloaker Plugin ENDS
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Interesting. Those lines shouldn’t look like “/plugins/plugins/”… why are they like that? Either the .htaccess file is wrong, or the plugin is installed incorrectly. The plugin files should be located inside “wp-content/plugins/link-cloaking-plugin/” – in their own directory inside “plugins”.
Thanks a ton for helping me diagnose the problem…it looks like the files got uploaded but were not in a folder…my web guy removed the plugin and reinstalled it in the folder and it worked like a charm.
@BigKahuna – Congratulations
I got an error when trying to add a static link. The “hits” field in the db needed to have a default value. If you have this problem then the following sql query will solve it :
alter table wp_cloaked_links change hits hits int(10) unsigned default 0;
Very cool plugin though. Congrats.
How to make it work for subdirectory ? my wordpress is in /blog directory and the links are just not redirecting. So a page link like /goto/afflink don’t redirects anywhere, eventually showing 404 error as page example.com/blog/goto/afflink do not exist on my site.
@Pushkar – The plugin shouldn’t have problems with subdirectories provided .htaccess is set up correctly (and is located in that same subdirectory). I have tested it on another blog running in a second level subdirectory (like example.com/stuff/blog/) and it worked fine.
See what’s in your .htaccess file. There’s an example of how the file should look a few comments below (except your paths will be different, of course).
Hi Thanks alot
I got it working. I had to move the code at the top (it was at the bottom before) and things are working like a charm. Great plugin.
Thanks again
Somehow my links are not getting tracked in the manage cloaked links. I can add a link and remove it. But i thought ALL clicks where tracked? I tried turning off all plugins. no luck.
I’m using 2.6.1 of wordpress, maybe thats a problem?
@Michiel – Tracking works for me on WP 2.6.2 (I don’t have a 2.6.1 handy). Just to make sure we’re on the same page : only links you add on that tab (Manage -> Cloaked Links) will be tracked.
In general if a (static-cloaked) link works – i.e. redirects correctly – it should be tracked. However, the plugin might miss some clicks because if you click the link several times your browser might decide to cache it and go to the target page right away, without accessing the cloaked link again. In this case the click wouldn’t be tracked.
Thank you for the plugin.
2 suggestions for a future release (if there will be one):
1. Ability to edit/change static links in Wordpress Admin (including destination url).
2. Ability to use keywords with static links. Enter certain keywords and those keywords will be turned into cloaked links anywhere they appear. For example anytime “Amazon.com” appears on your site it would automatically be converted into a link using one of your static cloaked links.
Just suggestions, but I think they could be useful! Thanks again!
This has been suggested already, but I probably won’t add it because I don’t feel like reinventing the wheel – there are already existing plugins that can do this, and you could configure them to use the cloaked URLs as the automatic links.
Overall, there aren’t any updates planned in the near future (for this plugin), just bugfixes – if necessary. Sorry
The plugin works great on other sites, however for this one when you click a link it redirects back to my site. I changed the theme but still does the same thing.
I am using WordPress 2.6.2, but that version is fine on other sites.
Any ideas?
@Andrew Clapham – This is sometimes caused by a conflict with another plugin. Are you using any plugins that add or modify links in the posts?
Question – will you still get credit for trackbacks when writing posts? Pingbacks are very important to the success of my blog.
Thanks.
@Patrick Curl – Yes, trakbacks should still work fine if you mark links with <!–cloak–> or set the cloaking mode to “Cloak all”. On the other hand, trackbacks probably won’t work with statically cloaked links (i.e. the links you define in Manage -> Cloaked Links).
[...] Re: Anyone Using The MaxBlogPress Ninja Affiliate WP Plugin? Have you guys tried this free plugin? I just installed it last night and it looks pretty good to me. Link Cloaking Plugin Update | W-Shadow.com [...]
I’m not sure where you are getting your information, but the MaxBlogPress Ninja Affiliate WP Plugin is NOT a free plugin. It costs $97.00.
Great plugin but hit counter not working for static links.
Any suggestions?
@Paul -
Hmm, do you mean it doesn’t work at all, or misses some hits?
If it doesn’t work completely then deactivating and reactivating the plugin might help. If only some hits are not counted that’s probably because the browser caches the redirect sometimes and doesn’t actually query the cloaked URL when the user clicks it.
@White Shadow –
The hit counter doesn’t seem to work at all.
Tried different settings; cleared cache, saved Permalinks, tried cloak all/specific links.
@Paul – Okay, I’ve uploaded a slightly modified version of the plugin, maybe it will solve the problem. Note : in this particular case you will need to deactivate the previous version before uploading the new one.
Still no joy. Thanks for trying. Must be an incompatibility somewhere. Will continue to use, but without the tracking.
[...] · Update : version 1.1 available – now with static link cloaking! [...]
[...] currently use the WordPress Link Cloaking Plugin from W-Shadow which is available for free. As well as allowing you to cloak URL’s, it keeps [...]
I am using the static cloaking and it does not work with firefox.
Mike
The plugin works independently of the browser. If it works in one, it should work in all. If you have problems with FF in particular, then most likely it’s something to do with FF itself.
Hi, I use this static cloaking plugin for my WP 2.7, it work fine but still contain numbers at the end like http://www.example.com/go/test/4/1. How do I remove those numbers? I hate them
My guess would be you have removed your own site to the “Exceptions” list in Settings -> Link Cloaking, so the plugin is cloaking the links twice. Add your domain name to that list and the numbers should go away.
I already tried with domain names with and without www prefix (my blog has domain name with www prefix) but it didn’t work.
Interesting. Now, let me get this straight – do you get the link with numbers when creating a cloaked link in “Tools -> Cloaked Links”, or do the numbers get appended when you view a post containing the coaked link?
The link in “Tools -> Cloaked Links” does not contain numbers but numbers get appended when I view a post containing the coaked link and cloaked link works fine, just don’t like the numbers.
Some more ideas :
* Is there a <!–cloak–> tag in the link? (There shouldn’t be).
* Are you sure you’re using the static cloaking correctly? Correctly : create a static link and use the plugin-generated cloaked URL in your posts/otherwheres in place of the original URL.
* If you put a cloaked link somewhere else than in the post – like the sidebar – are any numbers appended (probably not)?
Thanks, I remove tag in the link and then replace the original URL with the plugin-generated cloaked URL and it works.
Gocodes disappointed me.
Glad to be here knowing your plugin. I’ll try it.
Thanks.
I ‘m using piwik.
How to track outlinks from link cloaking?
Now, no track link cloaking in actions –> outlinks by piwik
Hi there!
I really like the plugin, and I was excited to use it but unfortunately it doesn’t work for the purpose I was looking for. I was looking to turn this huge, affiliate link into something more manageable like this:
http://www.musttap.com/link/0028383
Or something similar, unfortunately as the links are custom fields in wordpress, they seem to not be affected by the cloak. Would you happen to know what’s going on?
For clarification, I set a PHP variable to pull the custom field and put it into a link in the template:
<a href="”>
And it still shows up as the affiliate link.
Unfortunately the plugin doesn’t work that way. It only deals with links inside post content, so even if you format your PHP code the way you did the custom-field link still won’t be cloaked.
I’ll add the ability to cloak any link – whether in the post content, sidebar, headers or somewhere else – eventually (probably in a commercial version). That won’t be very soon though.
It is a very good thing,
This plugin is exactly what I need.
May I suggest one small feature to add “target=”_blank”" option. So the click on the link automatically open in new window.
Thanks!
Thank you for this great plugin. This is the only cloaking plugin where you can configure global cloaking and specify exception domains. But unfortunately it redirects all cloaked links to my main page. The .htaccess is correctly modified like described in readme.txt. Do you have any suggestions?
That usually happens with links added by other plugins. Does that ring any bells?
It happens to all cloaked links. Those generated by plugins but also to cloaked links directly in posts or pages. I have turned every additional rewrite rules off in .htaccess, but the plugin still redirects cloaked links to the mainpage instead of redirecting it to the target url. There isnt any other cloaking plugin out there with outstanding features like your plugin and I do not really want to miss it. Do you have any other ideas how to figure out the problem?
Send me the URL of the site where you have installed the plugin, I’ll take a look and maybe figure something out. You could also email me your .htaccess file, unless it’s secret
My email is on the contact page.
And sorry for the late answer, my computer broke.
[...] http://w-shadow.com/blog/2007/09/19/link-cloaking-plugin-update/ [...]
I’m having the same problem
“the plugin still redirects cloaked links to the mainpage instead of redirecting it to the target url”
What was the solution?
Thanks
No idea, André never got back to me on the issue (unless I’ve lost the email to my overzealous spam filters or something).
Anyway, here’s what I know for sure : cloaked links redirect to the homepage when the plugin is unable to find the original URL that corresponds to the cloaked link. This usually happens when the post in question contains links generated by plugins (or other dynamically generated links).
If that’s the case for your site then the only practical solution is either deactivating the plugin that generates the links, or getting the premium version of the link cloaker that can also handle dynamically generated links.
If plugin-made links aren’t the problem additional testing will be necessary to localize & fix the issue.
Great plugin, but I do have one quick question….
I really don’t want or need to cloak all out-bound links on my site, just those from one particular affiliate program:
http://www.affiliateprogram.com/this_info_is_different_for_every_link
Is there a way to use the static links feature in a way that allows me to cloak every link from the top-level domain: http://www.affiliateprogram.com even though every instance of that link after the “.com/” is unique?
Basically, I don’t want to auto-cloak everything, I just want to auto-cloak every link for http://www.affiliateprogram.com... but every link is slightly different with the exception of the “primary” domain.
Thanks!
Unfortunately that’s not possible in free version. The closest thing would be to switch to selective cloaking and tag each link you want cloaked with <!–cloak–>.
The premium version does have an option to cloak only links to specific top-level domains (the inclusion list).
I will HAPPILY pay more for the premium version if it will allow me to use that feature. So basically, if I upgrade, I uncheck the “cloak” everything option… and then I have the option somewhere to only cloak links that have a specific top-level domain (regardless of the variations that exist in this link…
examples:
http://www.shareresults.com/cid/12345/sid/12345
http://www.shareresults.com/cid/9876/sid/87537
and so on….
I will go ahead and buy the premium if I can simply say:
cloak everything for http://www.shareresults.com but leave everything else alone.
Is this the case?
THANKS!!!
Pretty much. Specifically, here’s how you could do it in the premium version :
I even whipped up a quick screenshot to illustrate.
That’s perfect!! I’m sold.
Thanks for the help!
Was using the plugin happily – and was working fantastically until the last WP upgrade which borked it. Tried reinstalling it fresh, but still 404’s all content – checked HTA and all seems fine. Any ideas?
Update permalinks & make sure that the plugins code is at the top of the .htaccess. I’d have to see your site to suggest anything more specific.
I clicked your demo link, found full display of target url in the address box. That is NOT “cloaking”. The more tedious frame redirect shows the calling page in the final address box. How can I achieve this more directly in WP?
By the way, meta refresh, PHP redirect, 301 redirect all reveal full url in final address box. Frame rdr is the only open source method I have found that does not.
“Cloaking” can mean more than one thing.
The paid version has an option to use frame redirects. Or you could manually modify the free version to output the necessary frame HTML instead of redirecting.
hi.. @rishill or for those who having error page 404 here is the solution.. u may try it..
add this to your .htaccess file :>
BEGIN WordPress
# Link Cloaker Plugin BEGIN
RewriteEngine On
RewriteRule ^goto/([^/]*)/([0-9]+)/([0-9]+)/?$ http://yourbloglink.com/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
RewriteRule ^goto/([^/]+)[/]?$ http://yourbloglink.comt/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
# Link Cloaker Plugin ENDS
thanks..
do visit me at myblog sometime.. and thanks for this great plugin!! btw its also work on WPMU.. i already test it