Mark Pilgrim was in the #wordpress IRC channel earlier, asking if there was some way to add <link> and <meta> tags to the <head> section of a page for specific posts. It seems he wants to control how various search engines and other bots index individual posts. I replied that he could do this using the custom fields feature.
A short while later, I had written my first plugin for WordPress: HeadMeta: .ZIP, .tar.gz, .phps, .txt.
To use this plugin, you add key/value pairs in the Advanced Editing interface. In particular, you’ll want to add keys named “head_link” and “head_meta”. The value will be plugged into the generated <link> or <meta> tag. For example, if you added the following keys and values:
Key | Value |
---|---|
head_link | rel=”seealso” href=”http://example.com/movies/” |
head_meta | name=”keywords” content=”entertainment,movies” |
This would generate two tags in the <head> of the page, when someone visited the permalink for the post:
<link rel="seealso" href="http://example.com/movies/" />
<meta name="keywords" content="entertainment,movies" />
This will be useful for any situation where you want special <link> or <meta> tags generated for specific posts.
UPDATE 2005/07/14: I’ve updated the plugin to version 1.1, which adds a new feature: if you have a key named “keyword” or “keywords”, it will automatically generate a standard “keywords” meta tag. For example, if you have the following custom field:
Key | Value |
---|---|
keyword | pets, dogs, canines, training |
The result would be:
<meta name='keywords' content='pets, dogs, canines, training' />
UPDATE 2005/10/15: I updated with a bugfix. The new version is 1.2.
UPDATE 2007/02/05: Version 1.3 is the newest version, which is now WordPress 2.1 compatible (it should still work with older versions, as well). Thanks to Gerald for pointing out the problem!
Pingback: Blogging Pro - Blog News, Tools and Hacks » WordPress Plugin: HeadMeta
Pingback: Weblog Tools Collection » geek ramblings >> My first WordPress plugin: HeadMeta
Pingback: ABQ Group Weblog
Pingback: Blogging Pro - Blog News, Tools and Hacks
Pingback: Taking Your Camera on the Road » Really Rocking with WordPress
Pingback: Taking Your Camera on the Road » Really Rocking with WordPress
Pingback: geek ramblings » HeadMeta Update
Pingback: Jens!Picek :: News-Blog » Blog Archive » Unser News-Blog und die Plugins
Pingback: SonicChicken weblog » Blog Archive » New website for my wife’s business
Pingback: Blogger Tipps und Hilfe » Archiv » Metatags in Wordpress einbauen
Pingback: SonicChicken weblog » Blog Archive » CJD on Google Earth
Pingback: a.css, esbudellant està ndards » Metadades personalitzades pel WordPress
Pingback: Combining Bunny Technorati Tags and Head Meta Plugin | Webmaster Resources Information
Pingback: The Online Developer
Pingback: Wordpress meta-tags - Platinax Business Forums
Pingback: Update for HeadMeta plugin for WordPress 2.1 - Recommended Web Tools
Pingback: Brandon Buttars » WordPress Meta Tags Plugin
Pingback: Wordpress META Plugin List | ngadutrafik2007
Pingback: UmatBlog » WordPress very exPRESSive
Pingback: Update for HeadMeta plugin for WordPress 2.1 | READER: Webmaster
Pingback: WP Plugins DB » Plugin Details » HeadMeta
Pingback: WhyDoWork.com Work at Home Blog » Top 5 Wordpress Plugins for Bringing Traffic
Pingback: HeadMeta_Wordpress plugin
Pingback: geek ramblings » WordPress 2.5 Beta
Pingback: Weblog Tools Collection » Blog Archive » New AB Meta Markup Tools for WordPress
Pingback: ThinkLite » Wine, Film and Books: Adaptive Blue Offers Open Format to Make the Web Smarter
Pingback: Wine, Film and Books: Adaptive Blue Offers Open Format to Make the Web Smarter « Mayank’s Weblog
Pingback: Photography and Travel Taking Your Camera on the Road – Really Rocking with WordPress