A reader recently inquired about creating WordPress subcategories.
Your posts in WordPress can be categorised and tagged to make them easier to find. For even more organisation, you can create subcategories.
It’s critical to correctly use categories and subcategories in order to assist your readers in finding the content they’re looking for. Your website’s SEO rankings can also benefit from proper content categorization.
We’ll walk you through the process of adding categories and subcategories to WordPress in this article.
Understanding the difference between parent and child categories in WordPress
They’re more than just a way to categorise your information. They can also assist you in creating a meaningful and semantically sound site structure. This is excellent for improving the SEO of your WordPress website.
Important: If you’re not sure what the difference between categories and tags is, see our category vs tag guide. This explains the differences between categories and tags, as well as how to properly use them.
You may be wondering why and when child categories (subcategories) are needed on a WordPress website.
Assume you’re starting a travel blog for various locations around the globe. It’s possible that you’d like users to be able to search for articles by country and city.
You could, for example, write an article about the best waterparks in America. That post’s category should be ‘United States.’
However, you could have articles about the best restaurants in New York City, Los Angeles, Chicago, and other cities.
You can use child or sub categories in this section. The parent category could be ‘United States,’ and the child categories could be ‘Cities.’
A post that is filed in a child category does not have to be filed in the parent category as well. We could have left ‘United States’ unchecked in our example and simply placed the post in the ‘New York City’ category.
If you submit a post to a child category but not to the parent category, it will only appear on the child category’s archive pages. This is especially useful when it comes to avoiding duplicate content.
After that, let’s look at how to add both regular and child categories to your WordPress site.
Creating a WordPress Category
When writing a post in WordPress, it’s simple to add a new category. The Categories tab can be found in the Document panel on the right hand side.
To create a new category, simply click the ‘Add New Category’ link.
When you click the link, you’ll see two new boxes where you can enter your category. You don’t need to use the Parent Category dropdown for a regular category.
Click the ‘Add New Category’ button after you’ve typed in the name for your category.
For your current post, the box for that category will be checked automatically. If you want to, you can disable it.
Without editing a post, you can also add a new category.
Simply add your new category to Posts » Categories. If you want to create all of your categories before adding content, this is a great way to do it.
You can also change the slug (URL) for each of your categories using this method. In this section, you can also delete and rename categories. You can even describe them.
Creating a Child Category (Sub Category) in WordPress
You can create and edit child categories in the same way you create and edit parent categories.
Open the Categories tab while editing a post and type in the name of your child category. From the dropdown list, choose the category you want to use as the parent.
You can also add child categories by going to Posts » Categories. Try typing your child category’s name then choose the parent category from the dropdown menu.
If you want, you can give your child categories their own subcategories. For example, we could create a category structure based on continents, countries, and cities, as shown below:
Europe is a parent category here, with the United Kingdom and Spain as children. The UK’s York and London, and Spain’s Barcelona and Madrid, each have their own child categories.
“Sibling” categories refer to categories that are on the same level as their parent category. United Kingdom and Spain, for example, are sibling categories.
One parent per category is allowed. You can’t have two parent categories with the same subcategory.
The SEO Advantages of a Site Structured by Categories
The following is how your category URLs will look:
This is useful because it informs both search engines and visitors about the content of your page. Additionally, you have the option of including keywords in your URL. Search engines use keywords to help people find content.
You can also change the /category/ prefix on your category URLs with ease in WordPress. If you want, you can even get rid of it entirely.
Simply scroll down to the ‘Category base’ section on the Settings » Permalinks page.
Enter the prefix you want to use here, then save your changes by clicking the Save Changes button.
The ‘category’ prefix in category URLs has no SEO value. Installing the FV Top Level Categories plugin may be a good way to get rid of it. Simply install the plugin, and your category archive pages’ URLs will no longer contain the word “category.” Rather, they’ll appear as follows:
Important: If you decide to change the category base on an existing WordPress site, you’ll need to set up redirects to prevent search engine visitors from getting 404 errors.
In the WordPress Sidebar, how to Show Categories and Child Categories
A widget to display a list of categories can be added to your WordPress sidebar or footer. Select Appearance » Widgets from your WordPress dashboard.
If you haven’t changed your widgets from what WordPress instals by default, the Categories widget should already be there. If not, you can drag and drop it from the left-hand side’s list of Available Widgets.
By default, the widget displays all of your categories in alphabetical order in a flat list:
Hint: Categories would only appear in the list when they have at least one published post assigned to them.
If you want, you can make it so that child categories (subcategories) appear below their parent categories. Simply check the box in the widget that says “Show hierarchy.” Remember to save your work.
Your parent categories should now be nested beneath your child categories on your site.
If your sidebar changes aren’t appearing, try clearing your WordPress cache.
You can create custom category menu links using the WordPress navigation menu, in addition to the default category widget. You can then include that menu in your header, sidebar, footer, or other menu locations.
We hope this tutorial on how to add categories and child categories to WordPress was helpful. You might be interested in our article on the best WordPress page builders for custom layouts.