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 toolbar=”false”]
<?php
echo category_description();
?>
[/php]

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]
<?php
/* If this is a category archive */
if (is_category()) { ?>
<meta name="description" content="<?php echo category_description(); ?>" />
<?php } ?>
[/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.

36 Comments


  1. Thanks for the post. I am creating a website for a client that has little knowledge of WP customization and I would like a simple plugin that will display the category description above the post listings. Can you recommend something? Or where to look for something like this?

    Thanks in advance!!


    1. Just use the code to display category descriptions [php] <?php echo category_description(); ?>[/php] in index.php or whatever file in your theme used to display post listings. Should work fine. There is no plugin as such to do that.


  2. hi,

    i have a question about category description! when you place the mouse over a category name , the following massage appear ( view all posts in category bla bla ) even if the description field is empty !

    how to hide it ?

    thanks in advance 🙂


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


    1. To limit the category descriptions to a certain character length, add the following code to functions.php file:

      [php]
      <?php
      function limit_words($string, $word_limit) {
      $newstring = substr($string, 0, $word_limit);
      if(strlen($newstring) < strlen($string))
      $newstring = $newstring."[…]";
      echo "<p>".$newstring."</p>";
      }
      ?>
      [/php]

      And now replace your
      [php toolbar=”false”]
      <?php echo category_description(); ?>
      [/php]

      with

      [php]
      <?php $desc = category_description(); limit_words($desc,10); ?>
      [/php]


  4. 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…


    1. Please check the code is category_description..coz underscore is not visible at the moment. Also I have updated the code. Recheck again. 🙂



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


    1. Around 140-160 characters should suffice since we are using it as meta descriptions and this length is ideal length for meta description.


  6. The description of the catagory is nicely displayed within the meta description. However it is also showing the tags, wich are probably inserted automatic when inserting the descripon of a category. I havent seen the result back in the SERP’s, but my guess is they’ll also show in there. Do you know a way to prevent this form happening? Thanks in advance!


  7. I have filled in most of my category descriptions, does it help with seo or is that only if you install those coding bits?


    1. You also need to ensure that your Theme also supports this. Just filling the description does not help. If your theme does not supports this, then you need to insert the codes mentioned in the post.


      1. Thanks! I am going to check that out for sure. I just assumed it would help with the seo, I had no idea the theme had to support it or any of that thing. Anything to do with coding is always way over my head. I have a helper for those parts 🙂 Thank goodness for friends! lol

        Thanks again


  8. I use category description in my site but with no SEO luck so far


    1. Well this is not the only SEO factor available. Great content and SEO on complete site can give results. Moreover, don’t expect results overnight. Be patient.


  9. I am trying to publish the category description on the category page (not in the meta description), but the code just wont work!?


  10. Definitely going to have to try this now. Thanks A lot


  11. Somehow the code doesn’t show. Just grey boxes.

    I’m with you on the topic, though. Widely underused.


    1. Same goes here. No code just gray boxes


      1. Sorry for a stupid bug. Fixed. Now you can see the code.


  12. Thanks for the post. I was using plain sql + php to fetch that desc. data 😀 Now switching…


  13. I know a lot about SEO and I don’t think that the category description is out dated. Top search engines still using it. But if you don’t have it then they will take your page contents.

    But it is a nice way to give a search engine a selected material.

    Great information you shared with us.


  14. I wish more theme developers built this option right into their themes. It would really increase SEO relevance.


  15. Description for categories seems to be cool Idea, thanks for sharing!,


  16. Wooooow, it never struck me that SERPs would give heed to category description and i always thought why we need to fill it. I guess need to have a look on those now. Thanks for sharing.


  17. All types of meta tags (including description) are outdated … SE are much more advanced than what we think of …


  18. Thanks! I always hated how it tried to drop descriptions directly into the frickin navigation. This is much better.


  19. too much seo is terrifying


  20. I always thought why there is category description and how to use it. Now I can use it. Thanks for this.
    Also thanks for commenting on my blog and pointing out the mistakes. I like your blog. Subscribing to Web RSS Feeds.


  21. I’ve always wondered how I could get this to work, I mean most of my categories have descriptions but my theme won’t show em. Thanks


  22. I am wondering to know all that and now I am really confused to miss that. I think we work for SEO all the day and we always miss such minor things which can effect on our SEO campaigns a lot. Thanks for sharing it.


  23. Hi Navjot,

    I have never tried to use this feature, for sure I will try now, thanks for the useful info.


  24. Im one of those blogger who missed out the description. So much work to do now. THanks for the info


  25. Thanks for this post. I will sure do this since i am still learning SEO. Hope this would help.

Comments are closed.