Update to the Keyword Link Plugin

Martin on May 8th, 2008

After getting quite a bit of feedback on the keyword link plug in, I hereby present the updated version.

This simple plug in allows you to specify keyword and link pairs. If the keyword is found in the article it will automatically be linked.

My original replacement routine did a simple string replace, which was fine if the words were noun’s ; but if you started to apply grammar things went wrong. (”Stonehenge” doesn’t quite change like “magic”, “magically”). The new routine checks for word boundaries which should solve nearly all problems.

To allow for styling the links, I have added a around each link to allow for modifying the link in any way you can imagine (or not). For example to make the link bold add the following to your style.css file:

.bm_keywordlink { font-weight: bold; }

Two more requests were for only linking the first mention of a link in the article, and for some links to be tagged as “nofollow”. Both are now possible.

Subscribe to this blog's RSS feed