How to Be Crafty and Mask Affiliate Links

Fine since Matt started this whole thing on hiding links and how people do it in really silly ways like putting nonsense in the onMouseOver WindowStatus I thought why not have a little fun and throw out a nice tip on how to mask your affiliate links.

Hypothetically speaking let’s say you’ve got a thin affiliate site, and you’re of the opinion having all affiliate links out is a “bad quality” indicator, or maybe you want to redirect your links for tracking, or maybe you even buy into the whole “no follow” advertising BS. Here’s one way to do it:

You write your script on linkout.php to scan for the URL parameter and redirect accordingly via Javascript. Now lets look at this link

Now you update your script that so when it detects the “p” parameter instead of redirecting to as a straight link it grabs the affiliate link in your database for ID 12345 and redirects accordingly. Regular people will think it’s a straight link and not an affiliate link. Now let’s get even more crafty

Lets make our script even smarter if the “P” parameter starts with an “A” we go and get the affiliate link from the database, if it starts with a “B” it’s just a dummy value and we use the URL value anyway. With the goal of being a responsible programmer I’d say you should use the “url” parameter as the default value and overwrite accordingly, but I digress. Want to get even more crafty how about this

When there is an “A” or “B” in the “P” parameter we redirect via Javascript and be sure to include the Noindex, NoFollow meta tags. However but when there is a “C” in the “P” parameter we redirect via a 301 instead of javascript. You could even be a little more clever and only do the 301 if you know it’s a search engine bot.

Lastly as a responsible programmer I should also warn you about not leaving yourself open to abuse. You should check for a referrer, and strip it down to the base domain, if it’s not you take whatever action you deem appropriate. Sure the examples given here might be pretty easy to spot, but they were also highly examplified. You could totally wonk things up adding random numbers or unix time values in for the dummy values, which would really make things harder to reverse engineer. You could also put the actual landing page URL instead of the simplified version I did here just to make things look that little bit more legit to pesky humans. There are few other things you can do, but I have to keep a few things dark and mysterious. runs on the Genesis Framework

Genesis Framework

Genesis lets you to quickly and easily build amazing websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.
It's that simple - start using Genesis now!

Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.

tla starter kit


  1. Text Link Ads - New customers can get $100 in free text links.
  2. - Get a premier listing in the internet's oldest directory.
  3. Need an SEO Audit for your website, look at my SEO Consulting Services
  4. TigerTech - Great Web Hosting service at a great price.
More in Google, npb, npp, ntt, SEO
Reverse Mad Libs SEO

Here's another quick and fast tip for you ... people have habits. They are also repetitive and like to keep...

Google: Greed over a Rollback

Google recently announced they were updating the Adwords Quality Score, however it appears that there is a bug that raises...


Lodefizzle this is a zugzwang post so avert your eyes nothing to see. Trying to find the meaning of life...