More WordPress Modifications – Meta Description

I’ve been quite lucky with my this new Lots of Freebies blog as within a week Google had indexed a few of the blog pages I had created but I knew that was too easy.  Unfortunately the summary that appears below the page title didn’t appear to be appropriate and resembled more about the layout than the content as it basically listed the links within the top navigation bar of the site.  As you can imagine this is not very helpful and it certainly does not make the content look like it has any relevance to the page.

On further investigation I found that WordPress does not include the meta keywords or meta description in the page header… so it appears that I’ve come across another part of WordPress that I need to tweak.  I can actually understand the reasoning behind removing these tags which is that:-

  • WordPress can not read your mind so it cannot create dynamic keyword and descriptions for each page, or at least it cannot with any great focus on the topic.
  • Some search engines no longer use these as they are subject to abuse and those of us who are dishonest often add completely irrelevant keywords in order to obtain a better ranking and exposure.

That said, some search engines still do take into account keywords and description but in my case I’m not too worried about the keywords.  If i create good content then the keywords will be found in the content and the search engines will rank my pages accordingly but in my case I’m after the description meta tag.  Many search engines still use this for the summary that is displayed underneath the page title (which is what I’ve got  a problem with) so by adding a relevant meta description to each blog item I can improve the listings.

There is quite a good article on WordPress.org explaining this in more detail and gives a good example on how to create basic meta descriptions and I have expanded on this based on the page title functionality in the themes/default/archive.php and my description meta tag in the header page now looks like:-

<meta name=”description” content=”<?php if ( is_single() ) { single_post_title(”, true); echo ” – “; }
  else {  if (is_category()) { ?>Archive for the <?php single_cat_title(); ?> Category – <?php
    } elseif( is_tag() ) { ?>Posts Tagged <?php single_tag_title(); ?> – <?php
    } elseif (is_day()) { ?>Archive for <?php the_time(’F jS, Y’); ?> – <?php
    } elseif (is_month()) { ?>Archive for <?php the_time(’F, Y’); ?> – <?php
    } elseif (is_year()) { ?>Archive for <?php the_time(’Y'); ?> – <?php
    } elseif (is_author()) { ?>Author Archive – <?php
    } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>Blog Archives – <?php
    }
   }
   bloginfo(’name’); echo ” – “; bloginfo(’description’); ?>” />

With this tweak in place it now show the meta description like “Archive for January, 2009 – Lots of Freebies Blog – Free Stuff for the UK” or “Increase your RSS Readers with rssHugger – Lots of Freebies Blog – Free Stuff for the UK” which should appear a lot more friendly in the search engines.

Bookmark and Share

Tags: , ,

One Response to “More WordPress Modifications – Meta Description”

  1. I think the explanation on wordpress is a bit wierd as to why they don’t have meta descriptions. They don’t know the title of your post until you type it in, so why do they worry that they don’t know what meta description you want until you type it in?!?

    malcolm coles’s last blog post..How to avoid duplicate meta descriptions in pages 2 and higher of the Wordpress loop

Leave a Reply

CommentLuv Enabled