Hey there, WordPress user! Are you making the most of categories and subcategories to organize your site‘s content? If not, you‘re missing out on a powerful tool for boosting your site‘s usability and SEO. But even if you are using subcategories, are you displaying them effectively?
In this expert guide, I‘ll show you why and how to display a list of subcategories on your WordPress category pages. With a few lines of code and some smart structuring, you can create a better experience for your visitors and search engines alike. Let‘s dive in!
Why Bother Showing Subcategories on Category Pages?
Categories are a core element of WordPress‘s content management system. When used strategically, they provide a logical hierarchy for your site‘s posts and pages. Subcategories allow you to further segment and specialize that content by topic, type, or other criteria.
Consider these statistics:
- According to a study by Orbitmedia, 69% of bloggers say categorizing content is their most used tactic for encouraging site exploration.
- WordPress sites have an average of 8 top-level categories. (WPBeginner)
- Using categories and subcategories can improve your site‘s click-through rate by up to 40% compared to uncategorized content. (Databox)
But to get maximum value from subcategories, you need to make them visible and clickable for users. By default, WordPress category pages only show the posts within that category and its subcategories – not the subcategory links themselves.
That means if a visitor lands on a high-level category page, they can‘t easily drill down to a more specific subcategory without clicking into a post first or using your main navigation menu. That‘s not an intuitive user experience.
The solution? Displaying a list of subcategories directly on the parent category page. This creates a mini table of contents that communicates your site‘s content structure and lets users navigate directly to their interests.
Here‘s an example from Bon Appetit‘s recipe site. On their main "Recipes" category page, they prominently display subcategories like "Breakfast," "Desserts," and "Drinks" that visitors can click on to filter the content:

Image source: https://www.bonappetit.com/recipes
See how much more scannable and navigable that is than just a long list of recipe posts? That‘s the power of subcategories in action.
How to Add Subcategories to Your WordPress Category Pages
Okay, so you‘re sold on the why of displaying subcategories. But what about the how? Don‘t worry – you don‘t need to be a code whiz to implement this on your WordPress site. Just follow these steps:
Access your WordPress theme files via FTP or the built-in Theme Editor under Appearance > Theme Editor in your dashboard.
Locate your theme‘s category template file, typically named category.php. If your theme doesn‘t have one, look for archive.php instead and make a copy renamed to category.php.
Open up category.php and paste in the following code block just before "the loop" that displays the list of posts:
<?php
if (is_category()) {
$this_category = get_category($cat);
}
?>
<?php
if($this_category->category_parent)
$this_category = wp_list_categories(‘orderby=id&show_count=0
&title_li=&use_desc_for_title=1&child_of=‘.$this_category->category_parent.
"&echo=0");
else
$this_category = wp_list_categories(‘orderby=id&depth=1&show_count=0
&title_li=&use_desc_for_title=1&child_of=‘.$this_category->cat_ID.
"&echo=0");
if ($this_category) { ?>
<ul>
<?php echo $this_category; ?>
</ul>
<?php } ?>Let‘s break down what this code does:
- First, it checks if the current page is a category archive using
is_category(). If so, it retrieves the current category object. - Then it uses
wp_list_categories()to generate an unordered list of subcategories. The parameters passed customize what‘s shown – things like sort order, whether to show post counts, and how many levels of subcategories to include. - The
if/elsestatement checks whether the current category has a parent category. If so, it displays subcategories of that parent. If not, it displays only direct subcategories one level deep. This ensures the list is relevant to the current category. - Finally, the list is output on the page wrapped in
<ul>tags.
Save your changes and upload the updated category.php file to your server.
Go check out a category page on the front end of your site. Voila! You should now see a tidy list of subcategories displayed above your post excerpts.
Here‘s how those core subcategories look on the WPBeginner site using this code:

Image source: https://www.wpbeginner.com/category/beginners-guide/
Customizing Your Subcategory Displays
The snippet above will give you a basic bulleted list of subcategories. But you can refine this to better integrate with your site‘s design and content structure. Some ideas:
- Use CSS to style the subcategory list consistently with your theme. Consider color, spacing, hover effects, and whether to keep the bullets or remove them for a cleaner look.
- Add a headline above the list to label it, like "Topics" or "Explore More." Wrap the subcategory list in a
<div>and add an<h3>or<h4>heading tag. - Customize the
wp_list_categories()parameters:orderby=id– Change this tonameto sort subcategories alphabetically instead of by ID.show_count=0– Set to 1 to display a count of posts in each subcategory.depth=1– Use a higher number to show additional levels of subcategories. Be cautious about going too deep though, as it can get cluttered.- There are many other
wp_list_categories()parameters you can play with too. Check the WordPress Codex for a full list.
- Move the location of the subcategory list. Try below the post list or in a sidebar
<div>instead of above the content. You can also use CSS positioning or a plugin like Widget Logic to insert the subcategory list in other locations. - Create a custom subcategory list template and include it in category.php or archive.php with
get_template_part(). This lets you separate the subcategory display HTML for easier customization.
Feel free to experiment to strike the right balance of form and function for your site.
Category Pages & SEO: Practices to Follow
As you plan and populate your site‘s category and subcategory structure, keep SEO best practices in mind. Some key considerations:
Conducting Keyword Research for Categories
Use keyword research tools like Google Keyword Planner, SEMrush, or Ahrefs to identify the terms and topics your target audience is searching for. Look for keywords with substantial volume but reasonable competition ratings.
Structure your categories and subcategories around these pillar topics and target keywords. If you have an established site, you may need to restructure and modify past categories based on your keyword findings. Databox has a helpful guide on keyword research for categories and tags if you need more direction.
Creating Optimized Category Content
Avoid having "thin" or empty category pages that are simply an archive of post listings. Instead, treat your category pages as landing pages optimized for the target keyword.
Add introductory content to the top of category pages that explains what the category is about using natural, engaging language. Aim for at least 150-300 words, and format it with proper heading tags. You can also add enhanced category descriptions using a plugin like Yoast SEO for additional opportunities to include keywords.
Some other on-page optimization tips for category pages:
- Craft a unique, keyword-rich title tag and meta description
- Use the category keyword in the URL slug
- Add links to your most important subcategory pages in the introductory content
- Include a relevant, eye-catching featured image
Internal Linking to Categories
Your post content presents many natural opportunities to link to relevant category and subcategory pages. Add contextual links where it makes sense to refer readers to other posts or resources on that subtopic.
You can also create a "hub and spoke" or "topic cluster" structure by linking related posts to and from the most relevant subcategory page. This signals to search engines that the subcategory is an authoritative source on that topic.
When you add new subcategories in the future, be sure to update your older posts to link to them as well. A tool like Link Whisper can help automate internal linking.
Maintaining Your Category Structure Over Time
As your WordPress site grows and changes, your category and subcategory structure will likely need to evolve as well. Perhaps you launch new content initiatives, retire old topics, or just need more granular organization. That‘s okay – but be intentional about restructuring.
Some tips for maintaining an effective category structure:
- Periodically audit your categories and subcategories. Identify ones that are overpopulated, have too little content, or are redundant. Don‘t be afraid to split, consolidate, or nest categories as needed.
- When you make changes, avoid simply deleting categories. Instead, map out the redirects needed to point the old category URLs to the most relevant new one. Use a plugin like Redirection to manage this.
- If you change a category name or slug, update all the internal links pointing to it across your site.
- Monitor your Analytics for category page traffic and engagement. If certain subcategories are underperforming, consider promoting them more or folding them into a different part of your hierarchy.
- As you add new subcategories, make sure to add them to your homepage and top-level category navigation as well.
Clicking the pencil icon will let you edit the details and settings for individual categories and subcategories.
Go Forth and Organize!
There you have it – a complete guide to displaying and managing subcategories on your WordPress category pages. While it may seem like a small design detail, surfacing subcategories can make a big difference in how users interact with and perceive your site content.
Plus, structuring your site with keyword-optimized, content-rich category pages is a proven strategy for boosting SEO.
I hope this in-depth tutorial gave you the knowledge and code needed to enhance your own category pages. The only thing left to do is implement these tips on your site and enjoy the boost in traffic and engagement!
Have any other questions about WordPress categories or subcategories? Drop a comment below or contact me for personalized assistance. Happy categorizing!
