How to add category and tag descriptions to your WordPress template

Sometimes your WordPress theme will come without the category and tag descriptions in the template by default. This blog post will show you how to and these descriptions to your WordPress files so that they appear on both your category page and tag page. Having a description on these pages helps give a better idea about what your page is about to your readers. And it helps Google out too. So why not optimize your category and tag pages?

Yoast even has some guidelines to optimizing these pages. Like for instance, the recommended words for a category or tag description is 250 words. Almost as long as a short blog post which is a minimum of 300 words.

Adding descriptions to your category and tag pages

To add a description to your category page go to Posts > Categories. Select a category and you will see a description field to be filled out. Using Yoast to help you with your SEO enter a keyword specific description no less than 250 words. Do the same for your tag pages, by going to Posts > Tags.

Make sure to update your category and tags SEO titles and meta descriptions too. Pick a catchy title other than archives. This will help with your click-through rate.

Now check to see if your category and tag descriptions are showing up on your pages. If they do not appear you’ll need to add some code to your WordPress template.

Add this code to display your category and tag descriptions

Please note we are going to edit some files from a WordPress theme. Therefore, we suggest to first make a backup of your website and your theme. In addition, if you update your WordPress theme or template to a new version you will lose these changes. That is why we advise using child themes as the ideal option for instances like this.

If your descriptions do not appear on your pages, then your theme’s template files need to be updated. To update the category page go to Appearance > Theme Editor and find the file named category.php. This is the file you’ll need to edit so the category description appears on your website. Click on it and look for the lines that are usually in h1 tags. This particular template shows <h1><?php printf( __( '%s', '(theme)' ), single_cat_title( '', false ) ); ?></h1>. Right under this put the following code: <?php echo category_description(); ?>. This will add the category description to your category pages.

The same can be done for the tag descriptions. To update the tag page go to Appearance > Theme Editor and find the fine named tag.php. This is the file you’ll need to edit so the tag description appears on your website. Click on it and look for the lines that are usually in h1 tags. This particular template shows <h1><?php printf( __( '%s', '(theme)' ), single_tag_title( '', false ) ); ?></h1> <?php echo tag_description(); ?>. Right under this put the following code: <?php echo tag_description(); ?>. This will add the tag description to your tag pages.

Leave A Comment

Your email address will not be published. Required fields are marked *