The website structure is important to keep all the resources organized so the user doesn’t have difficulty navigating your website. For this purpose, many content management systems (CMS), such as wordpress, use categories and subcategories to keep the post and data organized.
In this article, I will explain how the categories and subcategories work in wordpress and how to add categories and subcategories in wordpress?
What Is Category And Sub Category In WordPress?
Categories are features of wordpress that let you organize your articles and improve the overall structure of your website.
A subcategory is when we add a nested category in the parent category. For example, the parent category is News, and the subcategories will be International, Local, etc.
You can also make a separate page to show the post related to any specific category, and that page will only show the archive of that particular Category.
The category helps organize your website content, improves the overall User experience (UX) of your website, and improves your website’s search engine optimization (SEO). It is easy for the crawlers to know the context of site structure from the categories.
You may Like:
How to Find WordPress Category Id
How to Find WordPress Page Id or Post Id
How to Add Categories in WordPress
As we learn, what are categories and subcategories? Now for adding categories in your wordpress, there are two methods one using the block editor menu in wordpress, and the second is by going to the categories page in your wordpress dashboard.
Method 1) Add Categories Form Block Editor Menu (In 3 Steps)
Using the block editor method for creating the Category is simple and straight as you can make the Category during the post writing from the side menu of the block editor menu. Below are steps for creating the categories from the block editor menu
Step 1: Select categories option from the menu of Block Editor
First, you will open the post you want the Category to be added to get started. Once opened, click on the gear icon of the top right corner. It will open the block editor menu, expand the categories section and see all your categories.
If you didn’t have any categories, you would see the wordpress default category named “Uncategorized.”
Step 2: Click on Add New Category Link in Category Section
Click on the Add New Category link. It will display a new field which you will fill in the next step.
Step 3: Fill the New category Field and Save it
Once we click on add new Category, the field we will have is New Category Name and Parent category.
Fill in the name of the Category but make sure it’s different from the other categories. You just created your Category. We are not selecting any option from the parent category dropdown as we are not creating a subcategory.
For example, we are starting a website focusing on laptops. The main category will be a “laptop,” which can be later broken down into additional subcategories.
As you have created your category, you can use this Category in your future posts without creating it again and again.
Method 2) Add Categories from WordPress Dashboard
In this method of adding the categories, we will go to the Posts > Categories in wordpress. Then you can add the new Category before publishing any content.
So if you are planning to structure your new or existing site and want to add categories before the content is even added to that, you can use this method.
Also, you can add description and slug to your Category, and the advantage of this method is that you can modify your existing categories.
How to Add Subcategories in WordPress
Adding subcategories in wordpress can also be done using two methods, same as adding the Category, but the steps involved in adding the subcategories are slightly changed.
You can use which method is easy to add the subcategory to your wordpress website.
Method 1) Add Subcategories Form Block Editor Menu (In 3 Steps)
Adding the subcategories using this method is quick and straightforward, as you can add it from the block editor menu while editing or writing your post. Follow the steps below for creating the subcategories from the block editor in wordpress.
Step 1: Select Categories Option in the Block Editor Menu
Open the post you want to add a new subcategory click on the gear icon at the top right corner. It will display the block editor menu.
Expand the categories option, and you will see all the categories you have created.
Step 2: Click on Add New Category Link
Now click on the Add New Category link, and it will display a field where you can add the name of the subcategory and make sure it’s unique.
Step 3: Select the Parent Category and Save It
Once you give a name to your subcategory, you can now select its parent category, but make sure you have created the parent category before adding the subcategory to its parent.
For example, we have created a category before named “Laptop” to make it our parent category and add the subcategory “Gaming” to It.
Method 2) Add Subcategories From WordPress Dashboard
Adding subcategories from your wordpress dashboard is a simple and quick process and gives many options compared to adding subcategories from the block editor screen.
Open your wordpress dashboard and go to Posts > Categories. Here you will see all the categories you have created so far. For adding subcategories, fill the category name in the category name field and form the parent dropdown to select the category parent.
Once done, you will see the subcategory below the parent category slightly to the left. This method is helpful as you can see all your categories and subcategories overview. You can also modify and delete your previous categories.
Display Categories and Child Categories in WordPress Sidebar
If you want to display the categories and child category in the wordpress sidebar, go to Appearance > Widgets
Click on the Right Sidebar dropdown and then click on the plus icon. It will open a wordpress search Now type categories in it, and it will add the categories to your wordpress sidebar.
Note: The Category will only display on the sidebar when one post is added. If you have an empty category, then it will not be displayed on the sidebar.
If you want to include the subcategory also in the sidebar, then you have to enable the
Show hierarchy toggle from the settings of the category widget.
SEO Benefits of Categories and Subcategories
As we have discussed earlier, categories improve the overall user experience as it’s easy for visitors to navigate your website content with the help of category, which will improve your bounce rate and user engagement rate on your website.
As Google is tracking these user metrics, a good user experience will signal that the website has a good engagement rate and improve your overall website performance on SERP.
When you are using categories, your URL will look like this:
This is clearer for users and search engines to understand what the post is about, and you have a good chance to rank if you follow other SEO practices and Guidelines.
If you want to change the /category/ prefix, you can go to the Settings > Permalinks page. Here you will find a category base option put your desired name and click on save changes
Additionally, if you want to get rid of the category prefix as it is not contributing to any SEO benefit, then install the Remove Category URL plugin, and once installed, it will remove the Category prefix from your URL so it will look like this:
Note: If you change the category Base on an existing wordpress website, then use redirects to avoid 404 errors for users and search engines.
As we learn how to add categories and subcategories in wordpress and the importance of categories and subcategories, they organize the related post and improve the user experience and website SEO.
But they can also get out of hand easily, so before creating any content, map out the structure of your website and create the categories and subcategories prior to content creation.