WordPress: Jerome’s Keywords Modifications
I’m using Jerome’s Keywords plug-in for WordPress, but found that I didn’t want my entire list of Categories output to the meta keywords tag (it was a bit excessive and in my opinion, might push the limits of what a crawler will accept). The changes are simple and posted here in case you want to make them to your copy. For the function get_the_keywords() you can pass a boolean value (e.g., get_the_keywords(true); ) which indicates whether to include the categories in the keyword list. Default is to NOT include them.
N.B.This modification applies to version 1.3, it’s easy to adapt it to 1.4, and by 1.5 I think Jerome will already have included it.
function get_the_keywords($include_categories=false) {
global $cache_categories, $post_meta_cache;
$keywords = "";
if (isset($cache_categories) && $include_categories) {
foreach($cache_categories as $category)
$keywordarray[$category->cat_name] += 1;
}
if (isset($post_meta_cache)) {
foreach($post_meta_cache as $post_meta)
$keywordarray[
$post_meta[KEYWORDS_META][0] ] += 1;
}
if (isset($keywordarray)) {
foreach($keywordarray as $key => $count) {
if (!empty($keywords))
$keywords .= ",";
$keywords .= $key;
}
}
return ($keywords);
}


March 29th, 2005 at 3:42 am
[…] I’d be saying that my essays are poems and essays — and that’s stupid. Acme Technologies Zeitgeist has published a fix for the keyword […]
March 29th, 2005 at 9:51 am
I exchanged some email with Jerome last week and we discussed my mod. to his plugin. he wrote:
He’s going to incorporate my suggestions, and I hope, also look at making the plugin work within wordpress Pages.