Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Automatically Link Keywords with Affiliate Links in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Automatically Link Keywords with Affiliate Links in WordPress

If you have read WPBeginner’s Disclosure page, then you probably know that we do make some money from this site. We have been invited to speak at numerous blogging related conferences on the topic “How to Monetize your Blog beyond the banner ads”. We don’t have that many banner ads running on WPBeginner and quite frankly they do not make the largest percentage of income either. One of the things users often ask us: how do you make money from affiliate links. Their number one concern is that they have affiliate links on their site, but it is not making them as much as it should. Well the simple reason for that is humans are forgetful. There are way too many things going on in your head when you are writing a blog post. There are times when you will simply forget to include affiliate links. To overcome our natural forgetfulness, we use plugins to automatically replace keywords with affiliate links in our WordPress site.


You are probably wondering how and why it works? Lets say you were writing a post about email newsletters and you mentioned the brand Aweber, but you forgot to link to them. Or you were writing an article about WordPress theme providers and you threw the term StudioPress in. There are times when writing, you just forget to hyperlink these terms. Just like I did in the sentences above however our plugin caught all the keywords and replaced them with our affiliate links.

First of all, we wouldn’t recommend a service that we would not use. Secondly, we need to overcome our laziness and forgetfulness. So the solution is to use a plugin that will automatically replace words with affiliate links in WordPress.

Another advantage is that instead of linking to the affiliate link manually, you are automatically linking it. This is a GOOD thing when the vendor decides to change affiliate networks like StudioPress did a while ago. We had over 400 links pointing to their site, and if we had done that manually, we would be changing all of them MANUALLY. Using our plugin, all we did was go in the backend and change the URL at one location. All other posts were automatically updated. Yes, some may say this is for lazy people. But we like to believe this is for SMART people. Smart people use their time efficiently.

Last but certainly not least lets say a product came out in your industry that is revolutionary (such as Gravity Forms). You already have 300 articles written, and in there you have mentioned a specific keyword at least once. You can simply add the link in the plugin, and it will automatically replace the keywords in all older posts as well. So you can continue to monetize your older posts. Its a passive income, but overtime every little thing adds up.

As you can see there are a lot of advantages to this technique. Why let a company like Infolinks, Kontera, or Vibrant ads ruin the look and feel of your site with non-targeted ugly looking ads? Using the technique we are about to show you, you can provide more useful content to your users and making a passive income from it.

How to Auto-link Keywords with Affiliate links in WordPress

There are a few ways to do it. One that requires a lot less work and is more efficient. Its the method we use. We choose to use a plugin called Ninja Affiliate.

Ninja Affiliate

Ninja Affiliate Create Screen

If you look at the screen above, you can see how easy it is. All we do is enter the Link name (this is really for us to identify it by), Affiliate Destination (a link provided by the vendor), Ninja Link (your branded easy to remember link), and group. You can create as many groups you like to better organize your links.

Cloaking is something we do not believe in. Because we want our users to know which page they are going to. If you check the box Convert keywords to ninja links, you will get a textbox to fill out keywords you want to replace. You can see in the example, we have added 3 keywords. Each keyword must be added in its own line. Once you click add link, it will automatically go through your database and automatically link keywords with your affiliate links.

This could also be used for SEO purposes if you want to target a specific keyword and replace it with a link to your page.

If you have a lot of the same keyword mentioned in one post, then things can get out of hands. That is why we just set 3 links for each keyword in a post or page. It keeps the page from looking like total SPAM.

It is a paid plugin that costs $37, but it will make you 10 times that much within a week if not more.

Get MaxBlogPress Ninja Affiliate

Another way of doing this is combining two plugins: Simple URLs by StudioPress and SEO Smart Links.

Simple URLs plugin work and is great, but the other plugin is reported to be broken. It has bugs and free plugins are not very well supported. The author of SEO Smart Links have a PRO version. If you get that, then you are guaranteed to get support. We have heard good things about the PRO version.

It is a bit more expensive, but the author Vladimir Prelovac is very well-known for his expertise. He is in the AdAge Power150, and quite frankly his work is good.

We hope this will help a lot of you guys who were always wondering the secret behind our site(s). Eliminate the middle man like Infolinks, Kontera, Vibrat ads. Go out and work direct deals. Trust me, you will not regret it. Obviously, you will not be making money on CPM, but you will make a killing on sales. If you bring relevant products, then your audience will buy it. If your audience is not buying a product, then it obviously means that it is not relevant enough.

The trick to automatically linking keywords is not in the plugin. You can have the plugin active, and not make any money. You have to have the right type of products for your users and replace the right type of keywords. Don’t try to SPAM your site. Provide useful content to your audience and only add products that you will use yourself. Let us know your thoughts in the comments.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Jesus Perez says:

    Ninja Affiliate is confirmed broken on PHP 5.6 and throws back MySQL 1045 errors that will cripple your blog. The members area to download updates no longer exists, either.

  2. Wouter says:

    This sucks, support is not responding anymore and they limit my developer licence to 5 licences and because they dont respond they are not lifting this limit, very bad, do not use, this plugin does not excist anymore!

  3. Deb (GypsyOwl) Bryan says:

    Is it possible to deactivate Affiliate Ninja on ONE Landing Page inside wordpress? Great article/tutorial Thank You, Deb

  4. johnandroid says:

    I use WP Auto Affiliate Links Basic version,Pro is 79USD

  5. Ammar Ali says:

    It’s not converting keywords to affiliate links in comment section. What’s the problem?

  6. Pardeep says:

    Balkhi sir I need a plugin which convert the post content words to keywords links

  7. Danielle says:

    This is very interesting. I always wondered how people did this. I am pretty sure the plugin is the best bet for me! Thanks so much for the great information. :)

  8. Faizan Elahi says:

    Very useful article.

  9. Dragon Blogger says:

    I have done wordpress support for several blogs, be careful when using Ninja Affiliate as the more links you set the more overhead it costs on your blog in terms of RAM and CPU usage to process. You can cripple a blog on a shared or VPS hosting system with any plugin that has to manually process keywords and turn them into hyperlinks on your blog. SEO Ultimate has a deeplink feature which does the same thing but not as good click tracking as Ninja Affiliate. The tracking and writing to/from database also eats up performance too.

  10. whatiswp says:

    I’m largely not a fan of MBP plugins though, they had some pretty skeezy marketing tactics to gain subscribers. Like forcing users to subscribe to a newsletter before using the plugin (the plugin was hosted on

    Just not a fan of that kind of marketing.

    • seancojr says:

      @whatiswp I can’t help but agree with that.

      • seancojr says:

        @whatiswp Although… on second thought, there is a lot of positive talk about this group and their plugin, so maybe they’ve retracted and are operating better.

        • whatiswp says:

          they’re already left an impression on me and I won’t ever use any of their plugins, period.

          what’s to stop them from switching their tactics back to their old ways later on? I just don’t trust them at all.

    • wpbeginner says:

      @whatiswp Yes, there marketing tactics are a bit sleezy. They try to SPAM you. I recommend buying the plugin and then unsubscribing. I too was tired of their BS emails. But their product rocks.

  11. techvivekparmar says:

    @syedbalkhi @wpbeginner link not working..(at least for me)

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.