Keywords and Description Meta Tags for Wordpress (xfish_meta)

IMPORTANT!

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:

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.

IMPORTANT!

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)

77 Responses to “Keywords and Description Meta Tags for Wordpress (xfish_meta)”

« Older
Newer »

Leave a Reply


uberdose 2.0

L-l-look at you, hacker.