WP plugin: Head META Description
Lazy WordPress plugin posting time! Another of my did it but for some reason didn’t release it plugins, Head Meta Description provides an automatic meta description tag for your blog, inserting a dynamic description depending on the query-type (i.e. page you’re on). Some search engines are supposed to love this tag, so I guess we should, too.
Ooh ooh, get ready for brain-numbing install instructions:: download the zip file and extract head-meta-desc.php from it, upload this to your wp-content/plugins/ directory, and activate Head META Description under Plugins in WordPress. Phew! If your theme already calls the
wp_head() plugin hook from the
<head> element, the plugin will work right off. If not, add this on its own line (before the closing
</head> tag) in the header of your theme, typically in the header.php template:
<?php wp_head(); ?>
The plugin outputs a brief summary of a post’s or Page’s excerpt (the first # words of it, # defined in the $post_desc_length user-configurable variable described below), a category’s description when on category pages, and the blog’s tagline when on any other page or query-type. You can also set your own default description (through the $default_blog_desc variable), as well as override post and Page descriptions with a custom field (the $custom_desc_key variable defines the key; your custom field value would be the description for that post or Page).
Head META Description provides four user-configurable variables. These are:
- Setting this overrides the use of the tagline (Options > General in WordPress) for the default description on your blog. If you don’t use the tagline, edit this line. Default value is
- Length of the description in words for post and Page descriptions (the first # words of the excerpt, or post content). Default value is
- This tells the plugin to use the excerpt for description on posts, if one exists. Set this to
0(zero) to force post content as description. Default is
- Name of the custom field key used to override post or Page excerpts for descriptions. Default is
You can change these variables by editing the plugin file online through the plugin editor (Plugins > Plugin Editor, then select the plugin file), or offline in a text editor.
Yes, there are a few other plugins similar to this one (a problem I keep stumbling over), but I believe this one is a bit more complete in options and variety of descriptions it displays. So there. If you happen to be using the 0.4 version of Head META Description, there is no functional difference between that one and this (R1). I just prettied things up for release.