Affiliate Hide – Free wordpress plugin to redirect affiliate links!
A very simple and useful WordPress plugin to hide/cloak and redirect affiliate links based on custom fields. All you have to do is create a custom field `URL` in your wordpress post and specify the affiliate link there. This plugin can come in handy for gallery wordpress blogs where you are listing products or themes or services. Checkout this site and see how this plugin is practically used.
This plugin masks the affiliate links like shown below.
http://yourblog.com/jump/33 ——-> http://example.com
http://yourblog.com/go/33/ ——-> http://example.com
http://yourblog/download/33 ——> http://example.com
http://yourblog.com/link/33 ——-> http://example.com
http://yourblog.com/r/33/ ——–> http://example.com
If you see the above example, the number 243 is my wordpress post id. The plugin automatically queries the custom field value `url` in the wordpress post 243 and redirects to destination url. This plugin supports with or without trailing slashes.
Download (5kb)
Installation
1. Download the plugin, upload to wordpress/wp-content/plugins/ folder and activate the plugin.
2. Go to your blog post, create custom field `redirect_url`(can be any name) and enter the destination url in the value box.

3: Go to Admin > Settings > Affiliate Hide, enter the options you want

(i) URL trigger
Enter what trigger you want. eg. link, jump, go
If you enter `go` then your destination url will be hidden and show like http://yourblog.com/go/273. Once you click this the plugin will redirect to destination site
http://yourblog.com/go/273 ----------> http://example.com
assuming that your blog post has http://example.com setup under custom field with name ‘redirect_url`
(ii) Custom Field Name
Enter `redirect_url` assuming the redirect_url is the custom field you have created in your blog post, holding the destination url.
(iii) Link Text
Indicate what anchor link text you want. eg. Visit website, Download, Visit Author etc.
Another trick is, if you want to show a graphicimage instead of text, place img tag like
<img src="http://example.com/images/download.gif">
. No other html codes allowed except img tag.
For more information visit the authors site.
(iv) Trailing slash
If you want trailing slash in the url, select `yes` else `no`
yes -------> http://yourblog.com/go/273/ (with trailing slash)
no --------> http://yourblog.com/go/273 (no trailing slash)
default is no.
Save settings!
4. Finally open your template files (single.php, archive.php or index.php)
and place the code ……
<?php
if(function_exists('affiliate_hide')) {
affiliate_hide_print();
}
?>
Just make sure it is in the loop.
Frequently Asked Questions
1. How do i customize the URL for my needs?
I can give you so many URL ideas to hide your affiliate link. For example you can use `jump` `link` or anything in the URL. All you need to do is just edit the plugin php file for modifications.
You can use it with or without trailing slash. Enable or disable it in admin settings.
http://domain.com/jump/33 ——-> http://example.com
http://domain.com/go/33/ ——-> http://example.com
http://domain.com/link/33 ——-> http://example.com
http://domain.com/r/33/ ——–> http://example.com
2. How do i change the custom field name?
Just go to wp admin > affiliate hide > custom field and update it.
3. How to specify custom keywords for affiliate links?
At present this plugin does not have this feature. If you want to specify specific keywords i would recommend GoCodes Plugin where you have to manually enter specific URLs for defined set of keywords.
Similar Posts:
- Affiliate Hide v1.0 – Free WordPress plugin to Hide & Redirect Affiliate Links
- Best affiliate plugins for WordPress!
- Using htaccess to redirect domain without http://
- How to get custom field value in WordPress?
- 20+ Beautiful Photo Slideshow Plugins for WordPress
- WordPress offline editors for blogging!
- Best & Useful WordPress Plugins For Blogs
- Best Directory Themes for WordPress
- Problem with Custom rewrite rule in WordPress
- 10 Best WordPress PLUGINS You Never want to MISS!





December 31, 2009
a detailed tutorial !
March 12, 2010
Hey thanks for releasing a great plugin but is there a way to get it to link to another custom field?
At the moment you can only change the link text or use a static image but I need it to link to a specific thumbnail for each post from another custom field.
Hope that makes sense.
March 12, 2010
Its very easy! Just open the plugin file and look for this code and put a IMG tag
function affiliate_hide_print() {
if(get_option('affiliate_hide_slash')) { $slash = '/';} else { $slash = ''; }
?>
/< ?php echo get_option('affiliate_hide_trigger');?>/< ?php echo the_id() . $slash; ?>">
IMAGE CODE
< ?php
}
March 12, 2010
Hi thanks for reply but I can’t get that to work following is my code:
function affiliate_hide_print() {
if(get_option(‘affiliate_hide_slash’)) { $slash = ‘/’;} else { $slash = ”; }
?>
<a target="_blank" href="//”>
<img src="ID, ‘Thumbnail’, true); ?>”
<?php
}
It doesn't output the image all I get is a red x?
March 12, 2010
Thanks but that’s what I’m trying wordpress stripped out my php from the comment:
http://pastebin.com/ijs9q9rt
March 12, 2010
use this function
get_post_meta($post->ID, ‘image’, true)
to output img src. wrap in php tags.
July 28, 2010
Thanks for the plugin! Will help me when I cloak my affiliate links!