Category descriptions in Wordpress

One thing which I have seen many bloggers missing completely(including me uptil now) is the category description field. Most bloggers I have seen create relevant categories but forget to fill the description field either due to ignorance or delibrately to save time. But this field can also be important both in respect to SEO and also user experience enhancing effect.

In terms of user experience enhancing effect, many times users are not able to understand what type of posts are included in the category you have created. So its better to give a proper description to each category. And in terms of SEO effect, most SEO plugins of SEO including All in One SEO and Platinum SEO Pack pick category description as meta description tags for the category archives.

Now the question arises how to to show category description on the category archive page. The following code when used in your theme file pulls the category description and shows it to the user.

<?php
         echo category_description();
?>

Now this code should go into the archive.php of your theme file which is responsible for generating the category list of posts. Check with your theme for the proper location where you should insert this code.

And for SEO effect, if you are using plugins like All in One SEO or Platinum SEO plugins, they will pick up the category description automatically and if that’s not the case, you can use the following code in your header.php

<?php
/* If this is a category archive */
if (is_category()) { ?>
<meta name="description" content="<?php echo category_description();  ?>" />
<?php } ?>

Remember this code should appear before </head> in header.php

So now I hope you will use the above method to make your site even more user friendly and SEO optimised by giving useful descriptions to each of your category. I am yet to do it on this blog though since this thought came when I was working on one of my blogs.

Related posts:

  1. Optimising Page Title of a Blog
  2. Hide any Category or Asides from Main Content of k2 theme
  3. Robots.txt is not enough for combatting Supplemental Results
  4. Template Changes/Tags for Wordpress 3.0
  5. Parse Shortcodes in your Custom Fields

32 responses to “Category descriptions in Wordpress”

  1. leaf

    Any idea how to truncate the category description? I’m pulling the category descriptions to the homepage, but need to limit the character output).

  2. Tracy

    Hi..
    I’m wondering about something:

    I put this:

    In my archive.php file but nothing shows up. I want it to appear on the page just about the blog posts feed.

    Am I missing something?

    Thx…

  3. Obtenir la description d’une catégorie de liens | Les Wordpressiens - Spécialistes wordpress - by CNSX

    [...] Obtenir la description des catégories [...]

  4. Peg Corwin

    Any guidance on the right length for category descriptions? Should these be sentences or several keywords?

Leave a Reply

You can wrap codes in comments using [langcode]code[/langcode] tag. Common Language Codes like html, css, xhtml, sql, php, jscript, diff, patch, etc. are supported.