Improvements:
- Inserts the keyword into the link’s title tag
- Won’t link a page to itself
- Won’t use the same URL more than once in a post. (It’s always checked for re-linking the same keyword multiple times, but now it checks URLs too).
As always, download it here
.
Dazzled? Confused? Disagree? Write a comment »
There have been 48 comments so far.
48 Comments
Hi Adam, I’m just setting up a new WP2.3 blog and I’ve found that your plugin works quite well except under the one circumstance.
If a keyword is found within a manually created link, your plugin still works its magic, which unfortunately breaks the manually created link. I’m sure this is unintended, so I’m writing in the hope that you’ll consider patching this up in time for all the upgraders who will no doubt come chasing your plugin thanks to WP’s new plugin update system.
Cheers.
And that’s where I’m stumped. I cannot replicate this on any of my blogs. I put the keyword in the link text, in the link target, in the link title, in all three, and it doesn’t get touched by the plugin (nor should it). And the difference in blog versions shouldn’t make a difference–regexes are regexes, regardless of what version of WP you’re running.
So if there’s somebody who knows regexes, take a look at the plugin code and make a suggestion… Anybody interested in helping squash the bug should read the more detailed discussion of the problem starting here.
See initially I thought it was an oversight on this version because I was using an older version of this plugin on another wordpress install prior to upgrading… and the problem was nowhere to be found!
In fact chances are that if people persist the problem will go away, though I don’t propose to explain it.
I don’t know if its possible for you to try a fresh WP testbed install, but it seems like that would be the only way of accurately reflecting people’s experiences of installing the plugin for the first time. Reading those other posts seems to suggest that the more you use it, the less likely it is to display this behaviour.
Anyway, cheers for your effort on this Adam, I’m sure it’ll come to light eventually.
Hey Adam!
Not to add to the confusion, but… I’ve checked every way I can think of, and v. 1.101 is working great on both my site (WordPress 2.3-RC1) and my husband’s (WP 2.2.2). No time to upgrade to WP 2.3 right now for any further testing, though — too many papers to write this week.
Yay! :)
The v1.101 plugin seems to be working great for me with WP 2.3 installed. I ran into some issues before, which have all been tackled by Adam. Thanks for your quick response to my email Adam!
Works fine ! Thank you for this plugin !
It will be great if we can automatically add all the tags to the KBLinker list ! So each time a word corresponds to a tag in a post, it will link to [link] !
(Sorry for my languages mistakes, I don’t speak well english…)
Jeff, I use WPMU, not standard WP, which means I don’t get the new tagging features yet. Maybe when they introduce this feature into WPMU I’ll take a look at that, though.
Im using 2.2.1 and for some strange reason it’s not working properly. One instance only the 1st entry in the keyword-URL pair worked. Now nothing.
Darrin,
If what you mean is that the keyword gets linked only once per post, that’s what’s supposed to happen. If you mean that only the first keyword-URL pair gets linked while the other pairs get ignored, that’s a bug. Not sure which you mean, though.
Thanks Adam, that is exactly the case. Thanks for clarifying.
Hello, how does this plug ins compare to link-a-dink? Thank you.
I don’t use link-a-dink, so I have no idea. Try and see.
hi!
first of all really tanks for this script, I’m using it in a personal project. when lunch the site I will know you about the credits.
Now a trying to do link for not single word, for example i have in my $pairs array :
$pairs = array('ipsum dolor' => 'http://example.com');
but the problem is that doesn’t works, do you know how modify the regular expression in order to catch this kind of phases.
tanks
Sorry about the delay, Gabriel–I’ve been on vacation.
“ipsum dolor” should work fine. Perhaps the problem is that you’ve written the array in the plugin file itself instead of using the WP admin interface?
That’s a great plugin, but I’ve ran into a couple of seemingly related problems:
1. It doesn’t link the keywords if the post is truncated to the “more” tag.
2. It doesn’t link the keywords if there is a link _anywhere_ in the text of a post.
All the best,
Vladimir
Here follows the server data if it’s of any help to you :)
WordPress: 2.3.2
PHP: 5.2.3
It might be awhile until I can look at these. I’m unable to replicate the second problem.
Hello Adam. I’ve encountered a little problem. I host a blog on a free domain and yesterday i entered quite some keywords (around 30) into kb_linker. Since then a lot of parts of my blog stopped working giving an error that it has run out of memory. I disbled the plugin, deleted it from the directory and it still gives me the errors.
I thought to check phpmyadmin to see if any strings were left in the sql so the blog keeps loading and reading them. I couldn’t find any. Could you please tell me where exactly on the server kb_linker stores the data and strings? Thank you! (please send me an e-mail respond if possible)
Victor: That’s weird. This is a very simple piece of code. You didn’t install any other plugins at the same time?
It uses WP’s
get_option()and related functions to save to the DB. That means it will be in WP’s “options” table in mysql. The option’s name is, appropriately, “kb_linker.” Find the option in that table and delete it and see if that makes a difference.I’m guessing your host limits PHP scripts to the default amount of memory, 8 MB. Without any plugins, WP will use up most of that by itself. So I guess it makes sense that saving a lot of information to the database could cause you to run out of memory.
If you want to be able to run plugins, even small ones, you’ll need to find a host that allows more memory. Most decent hosts do.
Wow thank you for your fast reply. Yes its an 8 MB limit. I installed a couple other plugins, but I was able to keep the memory under the limit. I did an update to those plugins though so they could use more memory now but still it uses quite some. I was thinking about using a host but this blog was mostly for sharing music info and thoughts so its not that personal. I’ll try and use as few features as possible until ill decide to go to a payed host.
Thank you very much for your reply. And best of luck with this wonderful plugin ;)
This is a great auto-linking plugin. Just one tiny problem, which may be similar to what others have reported, especially in the KB-linker v1.03 thread. KB linker breaks links created by Dagon Design’s Site Map plugin, but only when the target link is one word. So, “XML” link breaks; “eXtensible markup language” does not break. This sounds weird I’m sure, except that it is completely reproducible. This is using WP2.3 and PHP5. Hope this adds another piece to the puzzle.
Hey, super, dass ist doch mal ein hilfreiches Plugin, vielen Dank.
Hi
Is it possible to have the KB Linker to link all links on a page? Now it makes one link per one keyword.
Shanta: Yes, others have reported the sitemap plugin problem, although I haven’t had time to look at it.
Ralf: Bitte schoen.
Tim: Comment #5 on this post.
I have found a problem with the latest version (at least on my blogs)
It will only post a link to a single URL, thats good. however it also wont post links to multiple URLs that have the same domain name.
so if I have 3 keywords that link to [link], [link], and [link] only one of them will get linked.
I found the problem (well not in the code)
If in the config I have:
contact us->http://www.tomandsean.com/contact.html
Maui real estate->http://www.tomandsean.com/
It will work fine
if they are in reverse order, only the contact us will get linked.
Thanks for the plugin but I have a problem with it. Its currently linking my posts but not pages. In the page.php template file, I am using the_content() to display the page contents so it should work. I cannot figure out why its not.
Well it seems to be working on pages but only for some links and not others. I guess I will get into the source code and figure out what is going on.
I hope I haven’t overlooked something above…
I’ve startet using KB linker with great expectations – great functionality! – until it turned out that it also inserted links inside the image (img) attributes – like title or alt texts. Because of that, after activating KB linker and writing a long list of links for it to generate, code appears down below images when I view the pages in a browser.
I’d hope for an upgrade – especially since the alternatives (the Blog mechanics keyword link plugin and also Cross-linker) are much slower to configure.
Kjetil
you can use regular expressions to jump texts that should not be linked. the script even has already this function:
// if you get problems with KB linker creating links where it shouldn't, this is the regex you should tinker with, most likely. Here goes:$content = preg_replace( '|(]*)('.$keyword.')(.*>)|Ui', '$1&&&$2$3', $content);
now, just add the following line: (for sure there is still a more comfortable way but if you use e.g. image manager to insert pictures you will always have the same structure for an image. it contains the alt tag but also the border definition at the end.
$content = preg_replace( '|(alt.*)('.$keyword.')(.*border)|Ui', '$1&&&$2$3', $content);the problem on google
the output show <’a href=.com >
is not fix with content = preg-replace( ‘|(]+>)(.*)(‘.$keyword.’)(.*)(]*>)|Ui’, ‘$1$2&&&$3$4$5′, $content);
Hi Adam,
How i can translate the text : More about .
I am brazilian and wish change the text to: Saiba mais sobre
Thanks,
Adam:
I have a very basic question. I have a lot of links I put into KB linker, and I have organized them by “categories” in terms of how I group them. I’d like to be able to put commented-out text in the link list so I can tell where each category starts / stops?
I presume that since the plugin uses the “->” tag to mark links that I cannot use something like:
Thus, what nomenclature should I use to add comments in the link list, or is that even possible?
Thanks, I simply love the plugin!
Where are the links stored? I couldn’ t find a txt file or a mysql table.
-Dieter
Are you dead? No 45 years left?
Not dead, but working 50-60 hours a week on my real job and trying to squeeze in family time on the side. The links are in the existing wp options table.
Hello,
I wanted to say thank you for this great plug in. I use it at all my blogs.
I have trouble with it working sometimes. About 85% of the time it works fine and links to the correct phrase/word but sometimes it doesn’t link to the phrase or word I chose. Is there a problem that I’m not aware of or do you have a checklist I can go through to see if I’m doing anything wrong on my end?
Hello,
Thank you for this great plugin :)
But i have one idea. You write this option :
Also link the keyword if it ends in s (i.e. plurals in certain languages)
But in french word is possible same witch this e/é/è it’s possible to create same option ?
Ex : genial is same génial
Im ok for give you 100usd ;)
Bye and happy new year
Hi, this is nice plugin:)
But now I have problem with KB Linker. Plugin can`t work with wordpress 2.7 !!!! What is the problem?
Thank your for this plugin. It is a pleasure to use it!
I had a problem where KB Linker was linking a [keyword] if it was the first word in the title tag.
Eg:
After playing around for a while, I came up with a fix. Don’t laugh as I’m very inexperienced with regex.
$content = preg_replace( ‘|(title=.*)(‘.$keyword.’)(.*>)|Ui’, ‘$1&&&$2$3′, $content);
Thanks Adam for a brilliant plugin!
I LOVE the idea of this plug-in, and I feel that Adam has been inordinately generous not only in creating it (for which I’d like to make a donation) but also in addressing so many questions and comments here. Wow!
There’s just one thing. It seems not to work with the latest (as of 1/15/10) version of WordPress. I’m not getting any links at all.
If anyone can help, please let me know. If Adam can, I’ll make that donation!
Cameron
Hi all,
I’m using KB Linker on my website and I am pleased with the idea behind it. However I encountered some problems. For example, the system fails when you have a keyword at the very beginning of a post. It also fails when you have a keyword occurring TWICE inside a link tag (I actually had to endure this one!)
So I looked around a bit and finally came to the following code. It replaces line 148 in the original code.
$content = preg_replace('/('.$keyword.')(?!([^<]+)?>)/i', '<a href="'.$url.'" class="kblinker"'.$target.$title.'>$1</a>', $content, 1);You can also comment the preceding two regexes (line 132 and 138) so it might speed things up a bit. So far it works like a charm. Maybe Adam can include it when he has the time.
Made a little mistake there. The above expression will also replace parts of words (which you probably don’t want to). The next one won’t:
And where I said “You can comment the preceding two regexes”, I meant you HAVE to. Also, if you’re using the plural option, you have to replace that regex too. I don’t use it personally.
Hi,
I’ve put this into the appropriate field for KB Linker but it won’t work on my blog:
muscle building->http://www.vincedelmontefitness.com/
how to build muscle->http://www.vincedelmontefitness.com/
build muscle->http://www.vincedelmontefitness.com/
When I click “submit” it says everything is ok but the abvoe words don’t become hyperlinked on the blog.
How do I fix this?
Thanks a lot,
Alex
I’ve recently installed KB Linker when Cross-linker was starting to kill my MySQL performance. It’s a nice, simple plug-in. However, I’m finding that it’s putting links into code that’s supposed to be images in the posts. That breaks the image tags. Any guidance on why that would be happening? It’s WP 2.9.2.
Hi,
This plugin is great, evne thou it requires a bit work when using alot of links, but I haven’t figure out how to make it more easy, exept be able to upload a CSV-file or similar.
Anyway, is there anyway to exclude words on some pages? Like adding a attribute before writing a word to able to disable the KB Linker for that word on that page?
//Jens
Hi!
Thank you for this great plugin! I’ve i could wish me a feature, it will be very nice, if the user can choose to link every phrase in the text or only the first appearance of the phrase.
Can you realize it in future versions or is there an existing workaround so far?
Greetings from germany!
Christian Kler