Home About

September 23rd, 2008

WordPress Keyword Link Plugin - 80

This is a little WordPress 2.3+ plugin that helps you to automatically link defined keywords to certain articles on your own blog, or elsewhere on the internet.

A plugin that allows you to define keyword/link pairs. The keywords are automatically linked in each of your posts. This is usefull for improving the internal cross referencing pages inside your site or to automatically link to external partners (SEO).

Example:  “A visit to the UK is not complete without a visit to Stonehenge.”

Would become:  “A visit to the UK is not complete without a visit  to <A href=”link”>Stonehenge</a>.”

You can decided for each link if you would like to:

  • Add a “No Follow”
  • Match only on the first mention
  • Open a new window on clicking the link
  • Match any case (ignore case) in the keyword

It is possible to CSS style links:

  • If the link is an affiliate you would like to disclose
  • Any other link tagged by the plugin

To help maintain longer keyword lists it is also possible to import and export lists of keywords to a comma seperated values (CSV) file, handy if you would like to edit the list of keywords in a spreadsheet. 

Features 
  • Optional: Only link the first instance of a keyword [default is all]
  • Optional: Open a new window for a link
  • Optional: Mark a link as “nofollow”
  • Optional: Ignore case when matching [Rome,ROME,ROMe]

Screenshot

Installation

  1. Just download the ZIP file, and unpack it in the /wp-content/plugins directory.
  2. Activate the plugin
  3. Enter your keyword-link pairs in the option panel for the plug-in.

v0.6

  • It is now possible to use apostrophes in keywords (the boy’s hat)
  • You can import and export the keyword list to and from a comma seperated filed

v0.5

  • Fixed a “space” issue
  • Added basic help to the configuration page
  • Added support for affiliate links

v0.4.5

  • Added: A little bit of javascript to allow for editing of existing keywords as some of you  now have over 150 entries it will also jump to the editor at the bottom of the screen.

v0.4.2

  • Fixed: Compatibly problem with Ozh Click counter plugin

v0.4

  • Fixed the linking of matching url’s problem
  • It is now possible to open a new window for a link (target=_blank)
  • It is now possible to ignore case when matching a keyword

v0.3.1

It is now possible to specify per link if you would like to :

  • Link only the first mention of the keyword in the article (or all, which is the default)
  • Tag a link as “nofollow” , useful for external links.

The replacement routine is also smarter about linking keywords. For example: “magic” will match “magic” , but no longer to “magically”.

version 0.2

If you would like to modify the style of the link. For example to make the link bold add the following to your style.css file:

.bm_keywordlink { font-weight: bold; }

Be Sociable, Share!

80 Responses to “WordPress Keyword Link Plugin”

  1. Hello world! | Dijksterhuis.Org Says:

    [...] now, have a look at my WordPress Keyword Link plugin. Share and [...]

  2. Paul Says:

    Hello,

    Currently, there is no way to limit the number of times that the same URL can be hyperlinked. Google only counts the first occurrence of a link to the same URL, so I would like to set a limit of “1,” regardless of whether the keyword is different.

    Also, where is my “BlogMechanics KeywordLink” database stored? What’s the name of the database? I can’t find it anywhere in my list of SQL databases.

    Please advise.

    Thank you!

  3. admin Says:

    Hi Paul,

    Correct — the plugin was written for cross referencing within a site, the use in SEO came only by accident. But thanks for the suggestion, I will add this to the todo list for this plugin.

    On your second question, the plugin doesn’t need a seperate database to store its values. It uses the WordPress “get_option” & “update_option” function to store its settings. (And these are stored by WordPress in the wp_options table).

    Martijn

  4. jl Says:

    just installed! anywhere for anyone here to test and visit my website to see if installed and working properly?

  5. Martijn Says:

    [Ralph] wrote me an e-mail saying that the Keywork link plugin didn’t work nicely with Ozh Click Counter plugin. Together they would eat the links.

    I fixed the problem in 0.4.2

  6. Ralph Says:

    HEY Martijn,

    I will write this comment instead of email.

    I know what you mean, an configuration option is a better choice for English and Asian style linking.

    but I think, as it’s simple, you can just mention it in the readme file, and let the users to change the source code by themselves.

    There are other important functions you can consider to make this plugin better.
    Just like, EDIT the existing keywords and links.

    Hope you can have a better version soon!

    Ralph

  7. Paul Says:

    “EDIT the existing keywords and links”

    I certainly agree with that!

    I would also love to see a version that uses fewer resources. Even though I only link to posts (no tags, categories, or archives) with about 150 terms, it’s still fairly slow.

    Alas, it’s still a GREAT plugin! I’m just hoping that it gets even greater.

  8. Martijn Says:

    [Paul]

    I think today’s update will make you happy ; I added an edit option to each tag. If you are indeed using 150 terms that should make your life a lot easier.

    Fewer resources is going to be hard. The program simply applies each term to the content using the PHP preg_replace function. But with 150 terms it will have to loop 150 times over the content. WP-Super Cache might be the best solution to this I think.

    [Ralph]

    I haved added your comments on using the plugin with Chinese/Japanese etc to the readme.txt (installation section).

    Many thanks for your comments!

  9. Jean-Paul Horn Says:

    Hi Martijn,

    Would it be possible for a future update to have a checkbox [is affiliate] and when ticked style the link class differently, e.g. .bm_keywordlink_affiliate or just .affiliate? I know this is another additional (and possibly) unforseen use of BM KeywordLink, but I’m also using it for tying certain keywords to affiliate partners, but would still like to disclose this fact to my readers. Hope this makes sense, otherwise shoot me an email and I’d be happy to explain it in our native language (assuming by your name your’re Dutch) :)

  10. 赞一下blog mechanics keyword link plugin | 吸引的痕迹 Says:

    [...] 这是插件地址:http://www.dijksterhuis.org/wordpress-plugins/keyword-link-plugin/ [...]

  11. Paul Says:

    Thanks for the edit feature!

    I noticed after I updated to the new version that it wrongfully inserts a blank space after each link, leaving a gap after linked words that are immediately followed by a period, comma, question mark, etc.

    I hope you can fix that.

    Thanks again!

  12. Martijn Says:

    @Jean-Paul

    Hi! No candy for guessing. The special link feature sounds easy enough — I will add a tick box for that.

    @Paul

    I will find out what is causing the extra spaces and remove that, thats definately not a feature.

    Thanks for the feedback!
    Martijn

  13. Martijn Says:

    Hi Everyone,

    A requested I added an “affiliate” tag, it will generate a different <span> around each link.

    I also fixed the additional space issue and added some basic help on the configuration screen.

  14. Jean-Paul Horn Says:

    Superveel dank Martijn! / Excellent work Martijn, thank you!

  15. Paul Says:

    Martijn, I found another bug. Keywords with apostrophes do not autolink. You cannot edit or delete them from the admin. If you click on “Edit” or “Delete,” nothing happens. Also, the keyword appears with a slash next to the apostrophe in the WordPress admin, but not in the MySQL database admin.

  16. Paul Says:

    The ability to import a text file and/or spreadsheet of keyword-link pairs would be AWESOME!

    Thanks, Martijn!

  17. Martijn Says:

    Hi Paul,

    I think I am going to ask you to submit work lists from here on ;-) But the idea sounds easy enough. I will find some time in the coming week and add it in.

    Cheers,
    Martijn

  18. Michael Smith Says:

    Hi… Excellent plugin!

    Is it possible to have your plugin work with the Link Cloaking plugin for WP? I prefer your plugin for linking keywords; but it would be nice to be able to cloak the links as well.

    (http://w-shadow.com/blog/2007/07/28/link-cloaking-plugin-for-wordpress/comment-page-8/#comment-13266)

  19. Martijn Says:

    Just released 0.6 which includes the requested comma separated values (CSV) import and export.

  20. Paul Says:

    Thanks, Martijn! Perfecto!

  21. Tony的日记09-01-02 | Tony's Blog Says:

    [...] Keyword Link Plugin-网上找到了这个插件,测试了很多其他类似功能的插件后保留了这个插件,主要是在文章当中根据关键词添加链接的,插件的原版是针对英文开发的,对于中文的支持有很多问题,根据目前发现的问题做了简单修改,可以支持中文和批量增加关键词库了。但是还没有正式启用,主要是担心对于博客的访问速度有所影响。日后为了增加内链会考虑使用这把双刃剑。 [...]

  22. Shane Says:

    Would it be possible for this to include custom fields? I’m setting up a store using WP, and have a custom field for the specifications of a product, which include a replacement part. I’d like to create a link from the replacement part to the blog entry using this plugin if at all possible. Thanks!

  23. Bread & Cup » Wordpress Plugin: Keyword Link Plugin Modification (V0.6) Says:

    [...] I have been researching to find keyword link plugin which is able to add a hyperlink automatically for a specific keyword, and finally, found that Keyword Link Plugin[1][2] [...]

  24. bread Says:

    Hi, Thank you for sharing this plugin. It looks great plugin!

    However, I have found one bug and since I need to use Asian Language, I need to modify the code. I wrote the note in my blog, ( http://blog.breadncup.com/2009/01/02/wordpress-plugin-keyword-link-plugin-modification-v06/ ), so, when you make a release next version, please refer to it.

    Thank you,

  25. skin doc Says:

    Excellent plugin. The export/import from excel is ideal for managing lists.

    I have noticed two bugs with the options setting. Each time a keyword is edited, all of the options (NoFollow, First Only, etc) are checked, regardless of their current state, so that you must manually uncheck the options every time.

    Also, when importing from excel, the IsAffiliate field is not imported, and always set to true, regardless of the checkbox, or the boolean flag.

    These are just minor inconveniences, to an otherwise great plugin! Thanks. Keep up the great work!

  26. Wordpress Affiliate Link Plugin Needed Says:

    [...] Affiliate Link Plugin Needed I had a bigger list of these a while back but here are a few: WordPress Keyword Link Plugin | Martijn’s C# Coding Blog thruSITES / The Cross-Linker Plug-in for WordPress WP-Plugin – GZ AutoLink WikiStyle [WordPress 2.1 [...]

  27. mores Says:

    Looks like a neat plugin, but I am in search of a totally automatic solution.
    I am working on a site, totally category-based, and I’d like to auto-replace words with their corresponding posts in a certain category.
    Example: one category is called “Moderators”. Here are a bunch of posts that each show a photo, the bio etc. of a moderator.
    And on all the other posts of the site, whenever a reference to a moderator is made, it should be auto-linked.

    I guess it’d require a plugin that monitors posts in a certain category and adds the title + link to your plugin’s word-database.
    Is that possble?

  28. Martijn Says:

    Hi Mores,

    Certainly its possible but its such a specific feature that it wouldn’t make sense to add it to the default setup. Also are you thinking of adding hundreds of moderators? If not, maybe just doing it by hand would be easier.

    Cheers,
    Martijn

  29. mores Says:

    Thanks for replying, Martijn.
    The number of moderators would be around a hundred with more being added on a near-weekly basis, and I want to keep things as simple as possible for the lady I’m building the site for.
    I guess one would need a second plugin that adds moderators to the same DB you’re writing your replacement pairs into.

  30. Bob Says:

    Hi Martijn,

    Excellent plugin ! This was exactly what we were looking for. I’d like to know if there is a way you can enable the links to work in the comments as well ?

    thanks !

  31. Martijn Says:

    Hi Bob,

    Links in the comments shouldn’t be too much work, I will add it to the ToDO list.

    Cheers,
    Martijn

  32. Bob Says:

    Thanks Martijn, that’s very generous.

    So it will be added in the next release of the plugin ?

  33. 10 unique wordpress plugins - YounGistAAn Blog Says:

    [...] Keyword Link Plugin [...]

  34. Chris Says:

    I love this plugin.

    Wondering if you can have some kind of precedence feature. Even if you just use insert order that’d work for me.

    What I mean is, I want “widgets” to link to one URL, but “widgets for sale” to link to another, and I want “widgets for sale” to take precedence.

  35. Martijn Says:

    @Chris

    The precedence feature sounds interesting, and it shouldn’t be too hard to include. I will look if it works as I expect it too.

    @Bob

    I will add comments in links in the next release. Work permitting I should have time for that somewhere next week.

  36. Bob Says:

    Thanks Martijn,

    good luck !

  37. Martijn Says:

    I just uploaded v0.7 which add the following:

    1. You can now also (optionally) link keywords in the comments section
    2. A reverse keysort is now applied before matching keywords to text. As a result
      “Widgets for sale in America” now matches before “Widgets for sale” and “Widgets” independent of their order in the definition list
    3. Fixed an issue with the “Edit” action not correctly selecting fields
  38. Bob Says:

    Thanks, I’m checking it out now Martijn

    in other words ‘Dankjewel’ ;)

  39. Paul Says:

    Deleting Multiple Keywords Simultaneously

    It would be very helpful to be able to delete multiple keywords at once, perhaps by clicking a check box that appears next to each keyword and then clicking a “Delete” button.

  40. Martijn Says:

    @Paul

    Good idea — I had the same problem when testing things. Will definitely add it.

  41. bread Says:

    Hi,

    Thank you for good plugin.

    Today, I found a small bug with this plug-in. If there is no list for links, it gives following warning message:
    “krsort() expects parameter 1 to be array, boolean given in /wp-content/plugins/blog-mechanics-keyword-link-plugin-v01/bm_keywordlink.php on line 381″

  42. Martijn Says:

    Fixed. This would only happen if the required option didn’t exist. The code now first checks if it exists to avoid the ugly warning.

  43. Danalyn Says:

    Thank you for adding the reverse sort! :D :D :D

  44. Paul Says:

    Re: “Deleting Multiple Keywords Simultaneously”

    I forgot to mention (but I’m sure you already know) that there should also be a “Select All” button to make it easier for those of us who have 100+ terms.

    Thank you!

  45. Chris Says:

    Nice! Thanks for the reverse sort. :D

  46. Jon Hugh Says:

    Hi, The new one 0.7 can’t not work in Chinese at all. Even though I have deleted the “/b” in the file. Please check,

    Thank you!

  47. wordpress关键字加链接插件 | 安迪之音 Says:

    [...] 前2天发现了一个。叫Blog Mechanics Keyword Link 可以完成这个功能。 [...]

  48. 兴凡 Says:

    很不错的一个插件!good!thank you!

  49. Wordpress Plugins to make awesome wordpress blog | Youngistaan Blog Says:

    [...] Keyword Link Plugin [...]

  50. Alberto Says:

    Hi, I’m using the plugin and I appreciate it very much.

    Recently I noticed the plugin breaks the image captions when the text inside them includes a keyword to link: the result is that only the image is shown, but not the text, and the image alignment is changed. Would it be possible to make the plugin not word inside the image captions?

  51. bolo Says:

    can you make the next version support Chinese?many Chinese blogers used this plugin.i can help you!

  52. 來吧!胡說八道! Says:

    WordPress 自動建立關鍵字連結外掛 BlogMechanics KeywordLink…

    緣起是本站的這篇文章中「kyo」的提問,這才使得直角兄花點功夫去找這一類的外掛。經驗談可以看看本篇文章的前身文,接下來直角兄就直接進入本文的重點了。
    想要在 WordPress 的文章中,…

  53. Tom Alexander Says:

    Does this work with WPMU? I put it in but it doesn’t seem to be showing up on the site. Everything is working fine in the backend, but nothing is showing up on the keywords.

    Thoughts?

    TA

  54. Rob - Former Fat Guy Says:

    Brilliant stuff. I looked at a bunch of plugins to do this before I decided on yours. What I’m looking for is a plugin that will make changes to the content of the database thought. I have a number of people who poll my feed and then put my content into their blogs. I’d like to include a keyword link back to my site somewhere in the first paragraph or so.

    If they’re going to take my content, I’d love a keyword link, you know?

    I’m hoping this plugin makes changes to the content, and not on the fly.

  55. Martijn Says:

    The plugin you are looking for is the DoFollow plugin by Joost de Valk.

    http://yoast.com/wordpress/rss-footer/

    It allows you to add a tag line to your RSS feed. Works great for my own content that ends up all over the place.

  56. hannah Says:

    am i just not seeing it – is there a separator for linking multiple keywords/phrases simultaneously?
    for example i want to link both “conductive thread” and “conductive threads” to the same post.
    is it possible to type “conductive thread|conductive threads” or use some other separator symbol in order not to have to create multiple entries?

    also i would find it helpful if the list of linked keywords would be ordered alphabetically, so that one can maintain an overview of what has already been linked. but i can see how it is also useful that they are ordered by newest last.

    thanks for the plug-in it is very helpful and well done.

  57. 1852.jp Says:

    Hello. I think that it is an excellent plug-in. Thank you.

  58. Siuray Says:

    Hi Martijn,

    Your plugin is great and I have installed it successfully in my wordpress blog (Using WordPress 2.8)

    However, I got problem in Adding my keyword.

    After I input the Keyword and Link to the page, it showed the keyword in list (Be the first one) , however, when I reload the page or try to add another, it will become blank. It seem the Keyword is not going to save.

    I have tried to turn off all my other plug-in , but it still no effect and cannot save..

    And I have try chmod the plugin folder and file to be writable , no effect

    Do I need to create a DB for this plug-in ?

    My Host is using PHP Version 4.4.8

    Thank for help.

  59. Siuray Says:

    Hi again,

    After reviewed the DB of wp_options which store the bm_keywordlinkoption, it is showing the below :

    a:1:{s:6:”伊藤\”;s:68:”http://abc.com|0|0|0|0|1|0|1″;}

    The problem is caused by the Japanese keyword 伊藤 stored with a “\” , it made the options page and plugin cannot load the data.. However, I found that for some keyword such as 鈴平ひろ have no problem at all ..

    When I removed the “\” by using phpMyAdmin manually, the data is showing back in options page and plug-in is working fine..

    However, when I try to add an other one or edit , the problem happen again ~________~

    I have followed your readme to edit the code to support Chinese and Japanese word..

    What should I do ? Thanks

  60. zhenglc Says:

    to Siuray,

    你可以用最新版本啊…wp keywordlink, 修改自原作者的插件,经原作者同意后发布的..支持中文关键词.
    支持WP2.8.4

  61. akira mahawira Says:

    can I use multi keyword for one link?

  62. BlogEarnCash Says:

    I alway seach for this, But no one is best for me, I wish this one can help me.

  63. Derek Says:

    Thanks, plugged it in, it works like a charm, one of the best-kept secrets around

    Nice job, Martijn!

    Derek

  64. Perla Says:

    Thanks for such an awesome plugin, Martijn. It’s extremely hard to find a simple functioning WordPress plugin to autolink keywords. The great thing is unlike some other similar plugins, it does not autolink the title.

    It would be great if you can add in the ability for checkboxes next to each keyword as someone else suggested.

    Questions:

    When importing from CSV, does it replace the existing keywords, or does it add to the list?

    Also, say if I have 100′s of autolinked keywords, will these all be displayed on ONE page, or will it be paginated?

    Thanks for your help.

  65. Bob Says:

    Can you please advise if wanted to change the colour of the keyword highlight leaving in bold but changing the colour to blue what would need to be changed
    Example style.css:

    .bm_keywordlink { font-weight: bold; }
    .bm_keywordlink_affiliate { text-decoration: underline; }

  66. Dave Says:

    This is a grat plugin, I use it for the nofollow. Is there any way to make it so that you a person has nofollow in the links they post, untill they hit a set number of comments? For example once you post 10 comments that are approved your links will then be followed? I think that would help prevent the drive-by spammers.

  67. Leon Says:

    Great plugin. But for me it links all links back to the homepage for some reason… I’m using wordpress 2.8. Is this a known bug?

  68. Michael Smith Says:

    Is it possible to have your plugin work with the Link Cloaking plugin for WP? I prefer your plugin for linking keywords; but it would be nice to be able to cloak the links as well.

    http://w-shadow.com/blog/2007/07/28/link-cloaking-plugin-for-wordpress/

  69. ARS Says:

    great plugin! I love it!

    but, it will be so nice if you can add attribute ‘title’ as one of important SEO tools. and also ‘class’ separately than default like now so I can give different style for each link.

    thanks alot!

  70. Alberto Says:

    Your plugin is very useful; I installed it on several different blogs I manage and I’m very happy with it. The only problem I cannot resolve – though I tried many times – is it “breaks” the image caption when turning a part of text in link: the result is the image appears without text and alignment.

  71. Gavin Lyons Says:

    Thanks for the code, my .NET version

    public void Parse(ref string body)
    {
    string[] keywords = { “BBC”, “Google” };
    string[] replace = { “http://www.bbc.co.uk”,”http://www.google.com” };
    string linkTemplate = @” {1} “;

    string pattern = “(?!((<.*?)|(<a.*?)))({0})(?!(([^]*?)>)|([^>]*?))”;

    for (int i = 0; i < keywords.Length; i++)
    {
    try
    {
    Regex rgx = new Regex(string.Format(pattern, keywords[i]));
    body = rgx.Replace(body,
    string.Format(linkTemplate, replace[i], keywords[i], 1));
    }
    catch (Exception ex)
    {
    body = ex.Message + " Keyword Link Addon Error!” + body;
    }
    }
    }

  72. Comparison Shopping Says:

    I tried the plugin on my blog site and it didn’t work. Turns out “feedWordpress” breaks it. Does anyone have any experience with this or know a work around?

    If not, what is the best alternative plugin for feedwordpress?

    Thanks in advance for your help.

  73. zip Says:

    Just installed it on wordpress 3.0. Seems to be working just fine. Pretty useful too.

  74. Mike Says:

    Awesome plugin. I couldn’t for the life of me get the regex correct for keyterms. I was trying to do this for two days and finally stumbled upon your site!

  75. Jack Says:

    I wanna say thank you very much for developing this plugn, it is really useful to me.

  76. Dave Spates Says:

    Cool plugin, a lot easier than linking everything manually like I have been doing :)

  77. History-Headquarters Says:

    Is there a way to have this plugin work on pages as well as posts? Say I create a page that has keywords on it and I want those keywords to link to individual blog posts, is that possible?

  78. cheryl Says:

    i installed but can’t get the import to work. i exported a file so i could follow the same format but keeps saying not valid csv file. any ideas

  79. Doug Nix Says:

    I installed BM-Keyword Link in my WordPress 3.1 installation and prepared a CSV file for upload. The file has two fields in each record:
    Keyword,Link

    When I try to upload the CSV file the plugin give me a ‘Not a valid CSV file’ error. How can I correct this problem?

  80. Bharat Prajapati Says:

    i was trying to import keyword dictionary to this plugin which is in csv format, but i get an error say “Invalid CVS file!”
    please suggest! I want to import a new file in this plugin…

Leave a Reply


Most popular

    Sorry. No data so far.

Recent Comments
  • Juan Romero: Hi there, it’s a neat little class, but I believe you could do the same thing with the WebClient...
  • anthosh: Hey, THank you very much for your tutorial. It was awesome. But i have a problem that i am not able to...
  • bian: how to get passphase if i have encrypt and decrypt string?? Thanks alot
  • Michael: Hi, I really like your post, thanks a lot, it really helped clear up a few things I could not remember how...
  • Bharat Prajapati: i was trying to import keyword dictionary to this plugin which is in csv format, but i get an error...