previous post
(Can Sponsored Posts improve LA...)
next post
(Does the world need another social...)
Apr 14

We wanted a plugin that would help us to make money from our site about how to Register Domain Names. We make money from every Google Adsense click as well as commissions on any web hosting packages that we sell.

We wanted a WordPress plugin that automatically converted specific keywords like BlueHost into affiliate links to the company’s product page. This post is for people who…

  1. use affiliate links in their blogs and are tired of manually entering the link every time.
  2. want a convienient way to update all of the affiliate links in their blog whenever they change affiliate programs or ads?
  3. want a plugin that can deal with Affiliate links, but not pay pro prices.
  4. don’t mind editing some lines of plugin code

WP Affiliate Pro seemed like a great plugin with lots of analytic features for affiliate marketers to use. It tracked how many clicks your links got. You could add thousands of affiliate links without editing the posts or any HTML knowledge. And, you got advanced affiliate link hiding so visitors couldn’t right click on a link to see the final destination.

The only problem was WP Affiliate Pro costs $97. I’m sure you get a great return on investment, but we’re on a tight budget. We already spend too much on advertising and we didn’t want to spend any money on our Domain Names site. Maybe, one day we’ll try the plugin.

We looked for a free version of the WP Affiliate Pro plugin, but couldn’t find anything. So, instead we installed Adam Brown’s KB Linker plugin. It’s a neat little piece of code that lets you enter in a list of words and tell it where you want to link each keyword to.

  • Adam set it up so that every time he mentions a city, it automatically links to a map of that city.
  • He also proposed that it could be used for SEO to improve the amount of internal cross-linking you have between posts.
  • Adam documented the plugin very well so that even an amature like me could have a go at tweaking the plugin to do what I want. With a few minor changes, KB Linker is also an excellent plugin for affiliate marketers to use to manage their external affiliate links.

Here’s what the plug-in does (straight out of the box):

  • Automatically find your keywords and convert them into links. You enter in a list of keywords and websites that you want to link together and it will find those keywords in your posts and comments. For example, wordpress->http://wordpress.org/ would link WordPress to the official website every time it found wordpress in a post.
  • Setup whether you want the links to open in the same window or a new window. For example, if we wanted our WordPress link to open in a new window, we would enter the target (_blank) after the keyword / website pair. For example,wordpress->http://wordpress.org/ _blank
  • You can enter in a whole list of keywords to automatically link up at one time. (You don’t have to enter each keyword - website pair individually, which is you have to do with the cross-linker plugin.)
  • You can choose whether your links have a title. (For example, when you roll your mouse over the link, it displays, “More Information about WordPress >>”) Unfortunately, you have to turn this on or off by editing the php code of the plugin.

Here’s how we tweaked the plugin. (We only want to use the KB linker plugin for our affiliate links. We can do our internal linking by hand.)

  • Made every automatic link open up in a new window. (As a general rule, we want our affiliate links to open in a new window so that our great WebDiggin content doesn’t get lost.)
  • Turned the titles always off. (We didn’t want our affiliate links to look any different from the links we made by hand.)
  • Turned the PageRank link juice off in each link. (Affiliate links don’t need the PageRank value, so we added a nofollow to each link.)
  • Hid the affiliate links so that the destination website wasn’t obvious. (When you roll over a link, normally it shows the destination location at the bottom of your browser. We tweaked the plugin so that it displays a destination of your choice.)

You need to be comfortable editing the php code of a plugin to make these changes.

  1. Download the latest version of the KB Linker Plugin. (We are using version 1.102)
  2. Upload it into your plugins directory and activate it.
  3. From the Plugins menu, Find the KB Linker Plugin and click on edit. This will open up the plugin editor.
    KB Linker Plug In Mod Step 1
  4. This is where you can edit the plugin. If you make a mistake, WordPress will deactivate the plugin and you’ll have to upload it again. (To be honest, we made the changes on our computer and then uploaded the new version to our blog, but you can do it either way.)

PART ONE. Adding the code to hide your affiliate links.

  1. The first change is around line 115. Search for the phrase, “first, let’s check” and you should see these lines of code:
  2. // first, let’s check whether we’ve got a “target” attribute specified.

    if (false!==strpos( $url, ‘ ‘ ) ){ // Let’s not waste CPU resources unless we see a ‘ ‘ in the URL:
    $target = trim( substr( $url, strpos($url,’ ‘) ) );
    $target = ‘ target=”‘.$target.’”‘;
    $url = substr( $url, 0, strpos($url,’ ‘) );
    }else{
    $target=”;
    }

  3. Change the line that says$target = ‘ target=”‘.$target.’”‘;to

    $target = ‘ onmouseover=”window.status=\”.$target.’\';return true;” ‘;
  4. That hides your link so that when they roll the mouse over your link, it doesn’t show the proper destination.

PART TWO. Add the code that puts the no follow in your links.

  1. The next change is on line 143. Search for the phrase, “set the title attribute” and you should see these lines of code:

// set the title attribute:

if (KBLINKER_USE_TITLES)

$title = ‘ title=”‘.$kblinker_title_text[’before’].$keyword.$kblinker_title_text[’after’].’”‘;

// now that we’ve taken the keyword out of any links it appears in, let’s look for the keyword elsewhere.

if ( 1 != $plurals ){ // we do basically the same thing whether we’re looking for plurals or not. Let’s do non-plurals option first:

$content = preg_replace( ‘|(?<=[\s>;”\’/])(’.$keyword.’)(?=[\s<&.,!\’”;:\-/])|i’, ‘<a href=”‘.$url.’” class=”kblinker”‘.$target.$title.’>$1</a>’, $content, 1); // that “1″ at the end limits it to replacing the keyword only once per post.

  1. Change where it says $content = preg_replace( ‘|(?<=[\s>;”\’/])(’.$keyword.’)(?=[\s<&.,!\’”;:\-/])|i’, ‘<a href=”‘.$url.’” class=”kblinker”‘.$target.$title.’>$1</a>’, $content, 1); so that it says$content = preg_replace( ‘|(?<=[\s>;”\’/])(’.$keyword.’)(?=[\s<&.,!\’”;:\-/])|i’, ‘<a ref=”nofollow” href=”‘.$url.’” class=”kblinker”‘.$target.$title.’>$1</a>’, $content, 1);
  2. This adds the no follow to your links.
  3. Click on update files to save your changes to the plugin.

PART THREE. Test your plugin.

  1. Your KB Linker plugin should now be modified to have a nofollow in the link and to hide your affiliate link. But check to make sure it is working correctly.
  2. Click on Options and then KB Linker and you should be able to enter in your affiliate links. You’ll want to use the format:key word or phrase->http://affiliatelink.com www.advertiser.comSo after you put in your affiliate link, leave a space and then type in the website address you want to show up when they roll their mouse over the link.
  3. Check out your new links. If you click on them, do they work correctly? When you roll your mouse over them, do they hide the affilaite link? If you look at the page source, is the nofollow in there?
  4. If you want to see an example of how our modified KB Linker plugin works, check out our domain names website. If you check out the links for GoDaddy.com, BlueHost, and HostMonster, you should see that the website address doesn’t show up when you roll your mouse over the link(or just says GoDaddy.com, for example). But if you roll your mouse over the other links, it should tell you the address of where you are about to go.

Bottom Line: We’re trying to modify the KB Linker Plugin so that we can use it for our affiliate links. We’ve tweaked the code in two spots so that the links always open in a new window, with nofollow, and the destination website is hidden when you roll the mouse over it. We’re not code monkeys, so there may be mistakes in our code. But, we’re willing to mess around with it to save $100 from buying the WP Affiliate Pro Plugin. (Once we start to make a profit, then we’ll consider investing in a proper plugin.)

Question: How do you put in your affiliate links into your blog? Do you do it by hand, or do you have a plugin that automates it for you?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

3 Responses to “A Free version of WordPress Affiliate Pro Plugin”

  1. WebDiggin Says:

    Oops, my bad. The KB Linker plugin only works on your posts. It doesn’t work on your comments. So, that’s one way the WP Affiliate Pro plugin is better. Maybe once we save up 10,000 clicks from AdSense, we can give it a shot…

  2. Andi Eko Says:

    Hey, really nice plugin :) Is that in this post you’ve already use the plugin ?
    But I still won’t pay for plugin :)
    Andi Eko’s last blog post..Gamblux Online Casinos

  3. WebDiggin Says:

    WP Affiliate Pro costs around $100. We didn’t buy it either. But we might some day.

    Adam’s KB Linker plugin is free, but even with the way we modified it, there are still some problems. (It only seems to work on the first keyword. So if we’re making a link to bluehost, it’ll automatically turn the first bluehost into a link, but not the second one.

    It also seemed to have some problems with our archives list.

    At this point, we’ve started to just add the link in ourselves.

Leave a Reply

Related Posts

ss_blog_claim=b734c69ef5a7cfe5ec76e92a2b196f51