Display category description in WordPress theme

Display category description in WordPress theme

Should you ever need to display the category description in your WordPress theme, and it doesn’t show after you save the category, then you should modify the theme files so it can display it for you.

1. Edit the category.php file

Go to /wp-content/themes/your-theme-name/ and look for category.php file. If it doesn’t exist then look for archive.php file, and if that one doesn’t exist either then open the index.php file in your preferred text editor.

Insert the following code where you want the description to appear (mostly on top of the page):

the_archive_description( '<div class="taxonomy-description">', '</div>' ); 

2. Enable the HTML usage in category description

If you are using older version of WordPress for some reason and therefore you lack the option of using the HTML in category description, then open the functions.php file in text editor and paste the following code after the opening &lt;? php statement:

remove_filter('pre_term_description', 'wp_filter_kses');

Now you can insert whatever HTML you like in your description box.


If you want to display the category description in other parts of your website, then you can also use the category_description template tag:

<?php echo category_description(category ID number); ?>

NOTE: Replace “category ID number” with your actual category ID number.

By janoshke

Web developer and IT consultant. Freelancer with full respect for OpenCart and WordPress. Gamer, (ex)drummer and parent.


    1. Hello.
      If by “this” you mean to insert the description on each category through Posts > Categories, then YES.
      This post describes how to enable the displaying of the category decription field through your theme if it doesn’t display in the first place. Many themes ignore this field for some reason, and yet sometimes we need to have it on the front-end.
      I hope this makes sense 🙂


Leave a Reply