Tag Archives: blogging

Hidden Affiliate Links WordPress Plugin

There is a new version of this plugin. Please download it from the plugin page

This post is about a wordpress plugin that will help you to manage your hidden affiliate links a lot easier then what others have suggested.

If you don't know why you should hide the affiliate links then continue reading, but if you already know this then skip to the plugin part of the post.

One of the best monetization methods for blogs is using affiliate programs.Money making blogs don't get their income from a single source like adsense, they also use affiliate links for a lot of services like Text Link Ads and other products.

Why hide your affiliate links?

Many bloggers think it's good to hide the affiliate links, not because they don't want their visitors to know they are affiliated but because of other reasons like:

  • Changing your affiliate links is a lot less work because you have to change in just one place then on hundreds of pages where you use those links
  • It hides the ugly part of affiliate codes. People tend to not trust long links with a lot of characters and unknown codes. A nicely formated and clean link is more likely to be clicked then one that contains an affiliate code in it.
  • It kind of forces them to click the link instead of just typing the link (without your affiliate code ) in the browser.
  • better SEO, the links don't look like affiliate links, the redirect is done from a html page that has noindex on it so search engines shouldn't look at it.

Methods to hide Affiliate links

There are a lot of methods to do this like:

  • writing a .htaccess rule
  • doing a http redirect from a script. Setting the HTTP location header to the destination url.
  • doing a redirect from the meta of a html page
  • doing a redirect from javascript by setting the window.location to the destination URL

Those methods are not hard to use but they do involve write a small piece of code and require this for each affiliate link. I will not show you in details any of those methods because there's a better, easier way to do this.

My Method to hide affiliate links

I wrote a plugin for wordpress that will let you define such redirects from a nice (AJAXy ) web interface inside your wordpress admin.

The plugin installs just like any other wordpress plugin and once installed you can start defining your affiliate link without having to write any code.

The plugin uses a meta and javascript redirect inspired by a post on John Chow dot Com about hiding affiliate links for better seo


The plugin is released under GPL and the usual "No Warranty" disclaimer applies


Hidden affiliate links v0.1.zip
Hidden affiliate links v0.1.tar.gz


The script was tested on wordpress 2.2.3, so it you use any other version and it doesn't work let me know about and problems and I'll try to write a fix. If you use a previous version you should really upgrade to the latest version of wordpress.
Copy hidden-affiliate-links.zip and unzip or copy hidden-affiliate-links folder in wp-content/plugins then go to wp-admin -> Plugins and activate the Hidden Affiliate Links plugin

Using the plugin

After you activate the plugin you can go to wp-admin -> Manage -> Hidden Affiliate Links and add/edit/delete hidden affiliate links. For each link you have to define a slug, a destination link/code and a description.Manage Hidden Affiliate Links

The "slug" is what the link looks like on your blog, the link/code is the part where the visitor will be redirected and the description is something to remind you what's this link about, but it's also used in the title of the page that's doing the redirect ( in case the redirect does not succeed ).

For example if the slug is go/tla and the link/code is my affiliate link for Text Link Ads http://tinyurl.com/2kasce then if you write a post on your blog and you use a link like http://patchlog.com/go/tla in your post, anyone that clicks that link will be redirected to http://tinyurl.com/2kasce

Why link/code and not just Link? In case you want to hide an affiliate link where you cannot just do a redirect, like adsense referral links that are generated by javascript, then you will have to put the javascript instead of the link.
Because you cannot redirect to a link that is generated by javascript ( because there's no link until the javascript executes ) you'll have to redirect to a page where the javascript is inserted and will execute to generate the link. In this case the user will have to actually click the generated link. So if you put anything else then a link ( starting with http or https ) in the link/code box then the script will think this is a code and will not try to redirect to the code but to a page containing the code. You can customize the look of that page by modifying : redirect_code.php

In case the redirect does no succeed for some reason then you will see a page with the affiliate link in it and the title of the page will be the one specified in the description for the link. You can also customize that page by modifying: redirect_link.php

Advanced Feature

The script is very easy to use but if you want some power and you have some knowledge of writing regular expressions then here's how you can use it. The slug part can be any regex, and anything that will match that regular expression will be redirected to the real affiliate link.

For example I could make the slug like this: (.+)/tla and everything that ends in /tla like http://patchlog.com/go-to/tla or http://patchlog.com/recommended/tla, would be redirected to my text-link ads affiliate link. Or something like go/(tla|text-link-ads) would match both links like http://patchlog.com/go/tla and http://patchlog.com/go/text-link-ads

I hope you like the plugin and let me know of any questions or problems you might have. Feedback is highly appreciated in the comments section of this post.

If you like the plugin you might want to subscribe to my full RSS feed, other great plugins might be on the way.


there's a new version that can also automatically replace keywords you define with hidden affiliate links Click here to get it.

About me update

The first thing I did when I started this blog was to look for plugins to give wordpress more functionality and then I started writing posts.

I'm still looking for cool plugins and sometimes write my owns and from time to time I still write on the blog ( not as much as I would like to  because I don't have the time ).

Since  January when I started the blog I have written 73 posts ( this one included ), an average of about 2 posts per week.  Many of this blog's visitors (more then 50% ) come from search engines, looking for a solution to some problem they have, others come from blogs that have linked to me or where I have commented .  The blog gets about 100 visits/day. That's not much comparing to other blogs that get thousands but I thought some of those visitors might want to know who I am so I thought I should write something about that on my "About page"

I didn't  put anything on that page when I started the blog , I just left the default text that came with wordpress.  Many high profile bloggers say it is important for people to know you ( this is a blog after all, and the blog should have something to do with it's author ) and an "about page" is a good way to start.

I didn't think that it was that important because at the beginning I didn't think the blog will have many visitors and I'm not even sure it's purpose was to get visitors or that they would want to know who writes the blog.

Anyway, now it's there so you can take a look if you are interested, there's not much about me, but I will be updating it with more details when I (or you the reader ) think it is necessary.

What do you think about it ? Do you have an "about me" page ?

making money online

This is a little out of topic on my blog, but lately I've been reading a few blogs about internet marketing, seo, web site monetization methods and other topics related to making money online.

John Chow is one of those bloggers making big money from their online blog and web sites. I read his blog to find out about the latest techniques and trends.

He writes on his blog John Chow dot Com about how he makes money from his ad network and his tech site thetechzone.com and gives tips and suggestions about how to increase your blog traffic and popularity. He basically shares his experience, telling you what worked for him, and what may work for you.

He gives advices about how to make money online  and how to  write on your blog but he also writes about cars, technology and dining so you'll get quite a lot of topics on his blog.

John Chow dot Com is blog that helps you make money online. If you do a review of his blog, he’ll link to you so his readers can check you out.