After setting up Wordpress yesterday and failing to find a decent meta keywords plugin, I decided to write my own. I found the following problems:
Quick Meta Keywords - produced no keywords tag with this version of Wordpress (2.5), just a meta keywords tag with an empty content parameter.
Jerome’s Keywords – same problem; wouldn’t work – outdated, perhaps?
Simple Tagging – only puts in keywords related to your tags, which might not match perfectly; doesn’t make any attempt to guess what words to use in the case of there being no tags, or only a few.
It seemed to me that a basic meta keywords tag should be trivial to include. According to word of mouth from Google, meta keyword tags (apart from being mainly unimportant) shouldn’t contain more than six or seven keyphrases (not keywords, keyphrases – more than one word can go there) separated by commas.
Sounds simple, right? This plugin reads your document’s content and title, strips out crap (formatting, useless words such as “the”, invisible characters) and then performs n-gram analysis to get an idea of term frequency. That’s a fancy way of saying that it finds the most oft-used words and phrases in your post. The top six (or seven, or even twenty – you can edit a constant at the top of the plugin to alter this) phrases are then plonked out into a nice meta keywords tag in your HTML header. Easy as pie!
Download Keywords by datadump
This plugin’s set up for English only; it’s kinda mean and won’t think twice before breaking up words including accented characters, for example. The included stopword file is based on that used in the CACM corpus by SMART, with some tweaks; this is an English-language stopword file. Drop me a comment if you want another language and I’ll gladly add it, especially Chinese!
There’s a conflict with Simple Tags at this version (0.2 – 0.1 was broken horribly).
In the future, I’d like to:
- Add extra languages
- Improve the stopword file
- Include trigram support
- Move configuration setup to a Wordpress admin panel
- Add an option for default keywords to fall back to
- Add an option for always-included keywords
- Add an option for “boosted” keywords (easy to implement!)
Feedback appreciated – it’s probably broken somewhere