There is a newer and better version.
This is a plugin that adds support for the two HTML metas ‘keywords’ and ‘description’. Copy and paste the code linked below to a file called xfish_meta.php and put it in your wp-content/plugins directory, then activate it in the plugins section.You can give each post custom fields named ‘keywords’ and ‘description’. The keywords one is a list of keywords for that post separated by commas without any trailing or leading ones, description consists of a few sentences (finish the description with some punctuation mark, like a full stop).
In order to insert custom fields into your posts, you need to enable advanced edititing mode. The only way I know to activate this is in your admin menu under Options/Writing (When starting a post, show: Simple controls or
Advanced controls). Here you must check Advanced controls.

If the requested page consists of several posts (like the main index of your blog), all the available keywords and descriptions get pasted together into the respective meta directive.
Update:
I don’t know anymore which horse I was riding when I implemented the first version, but thanks to Pat I just removed all the output buffering stuff. Instead, the metas are now written on the fly. It should now work with PHP versions prior to 4.2.
Downloads:
Note:
You have two alternatives:
xfish_meta.php (see above). Download as won’t work on the source versions! Please take care to remove any extraneous whitespace, since this can break things up.Added
Update
Starting with 0.4, I have added code in xfish_meta that will write to the html source regardless of whether keywords or a description was found. This should help tracking problems on installations.
For all of you who still have problems with xfish_meta on their installation, I strongly advise to upgrade to xfish_meta 0.4. With a little bit of luck this could lead to valuable insights into your installation.
There is a newer and better version.
xfish_meta 0.4 tarred (latest) single source file
xfish_meta 0.3 tarred
xfish_meta 0.3 source
xfish_meta 0.2 source (didn’t validate with XHTML and probably some other DTD versions)
xfish_meta 0.1 source (previous version that relied on output buffering)
September 2nd, 2005 at 8:17 am
YES! Got it to work! Thanks a lot, wow, im going to be spidered in google a heck of a lot more.. and better yet, with full descriptions and keywords!!!!
September 4th, 2005 at 11:55 pm
This is a really nice plugin, thank you so much for making it! It isntalled with no problems at all and I’ve got it up and running!
September 5th, 2005 at 7:13 pm
Thanks for sharing this great plugin. I installed it in less than three minutes. Works great.
September 5th, 2005 at 9:05 pm
It works wonder. I just hope this kind of plugin is one of the permanent plugin with every WordPress installation.
September 8th, 2005 at 2:47 pm
Hummm Lois.. you are not talking clear
I delete the
in the header template, but still no meta tags on those pages

Dirk, Can you contact me ? So we can solve this problem asap
Tx
Tasari
September 8th, 2005 at 11:45 pm
Hi Tasari,
Have you entered custom fields like shown on the screenshot?
Which WP are you running?
Assuming that you’re using a special theme (your own), have you tried using one out-of-the-box ones with xfish?
Can you provide me with URLs of posts that really should show meta tags per mail (xfish AT uberdose DOT com)? Preferedly with a standard theme?
October 5th, 2005 at 6:18 pm
Hi,
I installed the plugin, but I don’t think it’s working. I edited one of my previous post at http://www.marketingsyndrome.com/how-to-uninstall-ie-7/ and added two custom fields as you said. But it’s not displaying the meta tags when I test the source.
I added meta tags myself in header.php and it’s showing that instead.
What could be wrong?
October 6th, 2005 at 4:27 am
Hey Niche Marketing Guy,
I just klicked through to your page and saw the meta tags in the source, right after the title.
Or did you add them manually?
October 11th, 2005 at 9:59 pm
Just installed 1.5.2 yesterday and added your plugin today. Found my way here having what seemed like similar troubles.
The one step I missed was ACTIVATING the plugin in the PLUGINS menu in the ADMIN.
Works a charm! Thanks much for your time and effort on this plugin.
October 15th, 2005 at 7:32 pm
Cool tool. Installed first time and works like a charm. Let’s see what happens next.
October 16th, 2005 at 2:34 pm
“HEy, just wanted to say that it works a treat. Now need to figure it out on WP pages any way to have the custom fields automatically added?”
This would be key into a more usable plugin. As lazy as it sounds I don’t want to enter the custom fields every time.
October 29th, 2005 at 11:58 am
Hi Dirk
—-
Hey Niche Marketing Guy,
I just klicked through to your page and saw the meta tags in the source, right after the title.
Or did you add them manually?
—-
I manually added that to my index file..
October 31st, 2005 at 9:02 pm
Hi,
I did manage to implement this plugin for all my posts and pages. Can I also use it for the home page? If yes, how?
How about archives and category pages?
Thanks a lot for this plugin as it’s exactly what I was looking for.
November 1st, 2005 at 2:48 am
> Can I also use it for the home page? If yes, how?
That’s automatic. If there are several posts on the page, ALL keywords and descriptions are merged.
November 2nd, 2005 at 11:33 am
Does this also work on Pages, not just Posts?
November 2nd, 2005 at 7:50 pm
Hi Dirk,
You are right, While it’s all right for all keywords to merge, it’s really not all right for all descriptions to merge especially for my home page. This is because now the description is too big so much so that I’m afraid that Google might think that I’m trying to spam. Hence, is it possible for these pages to do either of the following:
1) Turn it off for such pages. I rather not have meta description tag than have it so long that Google might negatively impact my website.
2) Write custom meta description tag for such pages as well. This would be ideal scenario.
3) Show the meta description of the first post only rather than merging for all posts on that page.
Let me know. I really appreciate your help. Thanks!
December 13th, 2005 at 10:15 am
Hi,
I implemented the plug-in and it works like a charm! Thanks so much. I was wondering if there was a way to have my key words merged. I really don’t know what, if any effect having more than one keyword list defined will have. I am worried that the post keyword list may be ignored. Do you have any information on this?
Thanks.
December 13th, 2005 at 10:20 am
Hummm, i just viewed your source code. I notice that you do not have duplicate keyword and discription lists.
I do. I have the ones i wrote for my index.php and then the ones for the individual post. Is this supposed to happen?
December 21st, 2005 at 10:30 am
Hi,
if i activate this plagin,
my home page is blank.
how solve this problem?
December 31st, 2005 at 5:30 am
This plugin works beautifully on individual posts, but I’m not so sure about the way it handles categories.
For example: on my photo-blog, I have a category “all photos” that outputs all posts in the blog - not recommended for visitors on low-speed connections…
Of course, for this section, the description gets very long and repetitive and the keyword section also is much longer than recommended (although I’m quite happy that duplicates are mostly eliminated).
This has the effect that the page content gets pushed further down the page and some search engines also may view the sheer length of the Metadata as spamming.
Is there a way to either restrict keywords and description to a maximum length or to only use them on individual posts?
Thanks and a very happy New Year!
Laurenz
January 8th, 2006 at 10:09 pm
Hi,
I’m having a bit of trouble. I uploaded the plugin and set my keywords and description (I have it running on another site so I’m pretty sure it was done correctly) and I see this in the source:
Ideas?
Thanks.
Great plugin by the way.
January 17th, 2006 at 6:01 pm
It works very well for me. Very easy to install it.
Thanks
January 24th, 2006 at 11:46 pm
Works well with WP 2.0.
Thanks!
February 18th, 2006 at 10:19 am
Very COOL! Thanks!
February 19th, 2006 at 5:31 pm
Dunnon what version of WP 2 you’re using Guangquan but it won’t show up in the plugins management window for me.
March 8th, 2006 at 10:44 am
Cool plagin! Could you help to modify this plagin so that the pages would have meta tags?
March 8th, 2006 at 10:54 am
Just looking at it …
Gotta install mysql and apache. Could take some time.
March 13th, 2006 at 3:43 am
This plugin is not comfortable with wordpress 2.0.
Please upgrade this plugin.
Thanks.
March 13th, 2006 at 1:24 pm
I’ve used it on a fresh 2.0.1 install without any problems at all.
March 14th, 2006 at 3:13 am
yes your comment is true but I have a problem. My weblog has a header.php file and in it file is meta tag keyword and description as defult. I want disable this defult meta tags in page post and enable in main page of my weblog.
please help me.
Thanks.
April 15th, 2006 at 1:13 am
Hi,
would you consider to merge xfish_meta with Raoul’s Add-Meta-Tags WordPress Plugin?
It would be great, if your plugin fist looks for a custom fields “keywords” and/or “description” like your current plugin does, and if there are none such fields, it falls back to Raoul’s way of determining keywords from categories and description from the excerpt.
Christian
April 15th, 2006 at 11:31 am
This is an awesome plugin, thank you so much for devloping it ! It isntalled with no problems and works like a charm
May 6th, 2006 at 8:41 am
Hi. It works great
May 10th, 2006 at 6:37 am
I just installed your plugin because I wanted to see how this would work. I activated the plugin in WP 2.0.2. I added the keywords custom field and description custom field to a post with values. However, when I view my blog and that post, I don’t see any keywords listed.
I also then activated your 0.4 version. But still don’t see anything. Does it have to do with the fact I am testing on a local WP? Can you please help?
May 13th, 2006 at 10:00 pm
Great plugin but something has to be done about the length of keywords/description on index.php and categories - works great for single posts though.
May 17th, 2006 at 6:12 pm
Hey there,
I used your plugin and it worked great for 5 months. Then today it blew up. The Custom Fields no longer display and I get these errors:
Can’t open file: ‘wp_postmeta.MYI’ (errno: 145)]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN(132,131,130,129,128,127,126,125,124,123,122,121,120,119,118) ORDER BY post_id, meta_key
and when editing individual ones I get these errors:
WordPress database error: [Can’t open file: ‘wp_postmeta.MYI’ (errno: 145)]
SELECT meta_key, meta_value, meta_id, post_id FROM wp_postmeta WHERE post_id = ‘132′ ORDER BY meta_key,meta_id
WordPress database error: [Can’t open file: ‘wp_postmeta.MYI’ (errno: 145)]
SELECT meta_key FROM wp_postmeta GROUP BY meta_key
ORDER BY meta_id DESC LIMIT 10
where the fields should be.
I also went into phpMyAdmin and the table seems to be shot. I got this error:
#1016 - Can’t open file: ‘wp_postmeta.MYI’ (errno: 145)
The table doesn’t display anything in it.
Do you know how I can fix this. Did I just lose all my meta information.
Please feel free to contact me.
Thanks
Jonathan
June 14th, 2006 at 12:13 pm
Fix bug in next version with unexpected quote(s) in description value:
$meta_string .= sprintf(”\n”,htmlspecialchars($description, ENT_QUOTES));
June 14th, 2006 at 12:14 pm
Fix bug in next version with unexpected quote(s) in description value:
$meta_string .= sprintf("\n",htmlspecialchars($description, ENT_QUOTES));June 25th, 2006 at 12:35 pm
xfish is installed and activated … here is the proof
Which is sad as I have created and populated ‘description’, ‘keywords’ and even ‘keyword’ as “Custom Fields” for this page. Page Management identifies this as ID=4 and the HTML does too:
What can I possibly have missed?
June 25th, 2006 at 12:41 pm
whoops: HTML hid two lines … hopefully this displays as intended:
xfish is installed and activated … here is the proof
<!– xfish 0.4 was here. no keywords. no description. –>
Which is sad as I have created and populated ‘description’, ‘keywords’ and even ‘keyword’ as “Custom Fields” for this page. Page Management identifies this as ID=4 and the HTML does too:
<div class=”post” id=”post-4″>
What can I possibly have missed?
June 26th, 2006 at 12:10 am
Do you really mean page? Or Post?
Because xfish doesn’t work with pages (to the best of my knowledge).
June 26th, 2006 at 11:15 am
Hi: yes, I did mean Page but its true for two Posts too. Thanks
July 7th, 2006 at 11:38 am
Could you please post the source for .4? I wish i wasn’t, but i am on a windows server.
July 7th, 2006 at 12:58 pm
http://www.uberdose.com/media/xfish_meta.php_4.txt
It’s now also linked from the post above.
Have a nice day
July 9th, 2006 at 4:21 am
Hello, thanks for the x-fish plugin, it appears to be doing most of what I need done on my site.
However, the one problem I see is that when more than one post is displayed on a page (i.e. archives and/or category pages), it compiles keywords and descriptions of ALL the posts.
This is bad behaviour, particularly in terms of search engine crawls. For instance, I have a free recipe category, with 5 recipes/page. Each recipe has the keyword “recipe”. This means the word “recipe” appears repeated 5 times in the of the page, constituting a form of keyword spamming, which is likely to stop SE crawls dead in their tracks
Is there any way to modify the plugin to detect if the page is a category and/or archive and not display the keywords/description? Ideally, a category could have its own keywords and description, but I think that’s beyond the scope of the plugin, and a function of being able to add custom fields to categories, like you can in posts and pages. But short of being able to do that, displaying no description and keywords would be better than having them compiled.
Thanks again for the work already done, and any solution to this issue you might provide.
July 9th, 2006 at 4:59 am
Hi Nic,
yes xfish will collect all post’s meta info and display it, which makes sense to me.
But I am suprprised that your keywords appear more than one time, as this is handled in the plugin. Are you separating your keywords with comma? Are you inserting extra spaces between commas?
July 11th, 2006 at 12:54 pm
Hi!
If you want your “special feature” to be implemented in xfish, please simply put a link up from your blog main page to this page, tell me about it and what you’d like to see in xfish and I guarantee you express delivery.
July 19th, 2006 at 1:21 am
I found the solution.
July 22nd, 2006 at 4:08 am
Don, would you care to tell us the solution?
July 23rd, 2006 at 3:40 am
I have implemented out-of-the-box-support for your xfish_meta plugin in the latest 1.4.0 release of the Binary Blue theme suite - no further needs to fiddle around in the theme’s .php files