How to Display Category Descriptions in WordPress

Do you want to display category descriptions on your WordPress site?

Categories allow you to easily sort content on your website. They also help users easily find content and are good for SEO.

In this article, we will show you how to easily add descriptions to your categories in WordPress.

How to Display Category Descriptions in WordPress

Why Display Category Descriptions in WordPress?

If you have created a WordPress website, then you are probably already using categories and tags, but you may not be using them to their full potential.

Categories and tags allow you to easily sort your content into different topics. And when used correctly, categories and tags can also be very helpful in improving your WordPress SEO.

WordPress allows you to add descriptions for your categories. You may not have noticed this if you create categories when writing a post, because that method does not allow you to add a description.

With that being said, let’s have a look at how to easily add descriptions to your categories in WordPress.

Adding Category Descriptions in WordPress

First, you need to head over to the Posts » Categories page. If you are creating a new category, then you can simply enter the category name and description here and then click on the ‘Add new category’ button.

The Posts»Categories Page

If you want to add a description to an existing category, then you need to click on the ‘Edit’ link below that category.

This will take you to the category edit screen where you can add a description for your category.

Add a Description to a Category

Don’t forget to click on the ‘Update’ button to save your changes.

Repeat the process to add descriptions to all your categories. You can use the same method to add descriptions for tags as well.

Displaying Category Description on Category Archive Pages

Most WordPress themes will automatically display the category description on the category archive pages.

Display Category Descriptions on Category Archive Pages

However, if your theme does not display category descriptions on archive pages, then you will have to modify your theme. The safest way to do this is to create a child theme.

First, you’ll need to create a child theme of your current theme. For more information, refer to our beginner’s guide on how to create a child theme.

Next, you need to copy a file from the parent theme to the child theme. You could use an FTP client, or the cPanel file manager offered by your WordPress hosting company.

You will need to go to your website’s /wp-content/themes/parent-theme/ folder and find the category.php file. If your file doesn’t include that file, then you will need to find archive.php instead.

Find category.php or archive.php Using FTP Software

After that, you should copy the file into the folder of your child theme.

Next, you need to edit the file and then add this code snippet where you want the category description to be displayed.


', '

‘ );
?>

Usually this will be just after the section containing the_archive_title. Don’t forget to save the file after pasting the code.

Paste the Code Snippet

Your category archive pages will now display category descriptions.

Here’s an example from our demo site. The Twenty Nineteen theme doesn’t display category descriptions by default, but once we added the code snippet to a child theme, you can see that the category description is now displayed.

Preview of Category Description

Displaying Category Description in WordPress Theme

If you are comfortable with using code on your WordPress website, then you can use these code snippets to display category descriptions in other locations around your site.

Displaying a Single Category Description on Your Website

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




You’ll need to replace 3 with the category ID of the category you want to use.

Displaying Category Descriptions in Each Post

If you want to display a category description inside single posts, then you can add a code snippet to, say, the single.php or footer.php template.

If you’re using a child theme, then you need to first copy the template from the parent theme to the child theme folder.

After that, you need to add this code.


$catID = get_the_category();
echo category_description( $catID[0] );

This code simply gets all categories for the current post and then outputs the category description of the first category.

Listing All Categories and Descriptions

If you would like to list all your WordPress categories with a description in list format, then you can add this code in your theme’s functions.php file:


function wpb_catlist_desc() { 
$string = '
    ‘;
    $catlist = get_terms( ‘category’ );
    if ( ! empty( $catlist ) ) {
    foreach ( $catlist as $key => $item ) {
    $string .= ‘

  • ‘. $item->name . ‘
    ‘;
    $string .= ‘‘. $item->description . ‘
  • ‘;
    }
    }
    $string .= ‘

‘;

return $string;
}
add_shortcode(‘wpb_categories’, ‘wpb_catlist_desc’);

This code creates a shortcode which displays all your categories and their descriptions in a plain list.

You can now use [wpb_categories] in your posts and pages. To use this shortcode inside a text widget, you will need to enable shortcodes for widgets.

List WordPress categories with description

Bonus: Adding Category Meta Description to Improve SEO

By default, WordPress will not add your category description in the meta tags.

This is why it’s important that you use a WordPress SEO plugin like All in One SEO for WordPress to add category meta description to boost your SEO.

Adding a meta description for your category in All in One SEO

We hope this tutorial helped you learn how to display category descriptions in WordPress. You may also want to learn how to move WordPress from HTTP to HTTPS, or check out list of must have plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.