Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

My first WordPress plugin: HeadMeta

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!

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Plugins, WordPress and tagged , , , . Bookmark the permalink.

107 Responses to My first WordPress plugin: HeadMeta

  1. Pingback: Blogging Pro - Blog News, Tools and Hacks » WordPress Plugin: HeadMeta

  2. Pingback: Weblog Tools Collection » geek ramblings >> My first WordPress plugin: HeadMeta

  3. Pingback: ABQ Group Weblog

  4. Pingback: Blogging Pro - Blog News, Tools and Hacks

  5. Pingback: Taking Your Camera on the Road » Really Rocking with WordPress

  6. Pingback: Taking Your Camera on the Road » Really Rocking with WordPress

  7. Pingback: geek ramblings » HeadMeta Update

  8. Pingback: Jens!Picek :: News-Blog » Blog Archive » Unser News-Blog und die Plugins

  9. Pingback: SonicChicken weblog » Blog Archive » New website for my wife’s business

  10. Pingback: Blogger Tipps und Hilfe » Archiv » Metatags in Wordpress einbauen

  11. Pingback: SonicChicken weblog » Blog Archive » CJD on Google Earth

  12. Pingback: a.css, esbudellant estàndards » Metadades personalitzades pel WordPress

  13. Pingback: Combining Bunny Technorati Tags and Head Meta Plugin | Webmaster Resources Information

  14. Pingback: The Online Developer

  15. Pingback: Wordpress meta-tags - Platinax Business Forums

  16. Pingback: Update for HeadMeta plugin for WordPress 2.1 - Recommended Web Tools

  17. Pingback: Brandon Buttars » WordPress Meta Tags Plugin

  18. Pingback: Wordpress META Plugin List | ngadutrafik2007

  19. Pingback: UmatBlog » WordPress very exPRESSive

  20. Pingback: Update for HeadMeta plugin for WordPress 2.1 | READER: Webmaster

  21. Pingback: WP Plugins DB » Plugin Details » HeadMeta

  22. Pingback: WhyDoWork.com Work at Home Blog » Top 5 Wordpress Plugins for Bringing Traffic

  23. Pingback: HeadMeta_Wordpress plugin

  24. Pingback: geek ramblings » WordPress 2.5 Beta

  25. Pingback: Weblog Tools Collection » Blog Archive » New AB Meta Markup Tools for WordPress

  26. Pingback: ThinkLite » Wine, Film and Books: Adaptive Blue Offers Open Format to Make the Web Smarter

  27. Pingback: Wine, Film and Books: Adaptive Blue Offers Open Format to Make the Web Smarter « Mayank’s Weblog

  28. Pingback: Photography and Travel Taking Your Camera on the Road – Really Rocking with WordPress

Leave a Reply

%d bloggers like this: