Main categories and subcategories in WordPress

We have already covered how to create a category in WordPress, now let’s take a look at how you build a category structure, a so called category-tree. Categories in itself is a very powerful tool which makes it very important to have a properly organised categorisation. With this you can control and improve the customers experience on your site, but it also results in a better and improved SEO ranking and makes the SEO work easier in itself too.

For example, we who work with WooCommerce and have written a post about just that makes it reasonable to use ‘WooCommerce’ as a main category where the visitor easily can find and understand that this specific article is about that subject.

But we can also have posts about specific functions in WooCommerce for example ‘Products’. Thats where the subcategories come in. ‘WooCommerce’ then becomes a main category and the different functions become subcategories.

When posting under a subcategory the post doesn’t necessarily need to be in the main category. In our example we could have let “WooCommerce” stay unchecked and only put the post in “Products”. If you do post something under a subcategory and not the main category it is however important to remember that the post will not be visible at all under the main category archive.

Create a category

With all that said, let’s take a look at how you add both regular categories as well as subcategories in WordPress.

You can easily add a new category in WordPress while writing your post. In the Admin Panel to the right on the page you open the “Category” tab.

There you can click on “Add New Category” to create a new category.

When you click that link, two new boxes are shown where you can add your category. For a main category you don’t need to choose anything for “Parent Category”, it will automatically become a main category.

If you however would like to make a subcategory then you do need to choose a “Parent Category”. There you decide where in the hierarchy you want your new category to be positioned.

You don’t necessarily have to create the category in a new post, you can as we’ve shown previously, add a new and administer existing categories under posts >> categories. This is useful if you want to create all your categories before you start making content.

This method also allows you to edit “slug(URL)” for your categories. You can even remove or change name on the categories here as well. If you want to hone your SEO work a bit you can also add a description for your categories.

Adding subcategories

You can add and edit subcategories in the exact same way as you added the main categories.

You follow the same steps as above when editing your post. But when you create a subcategory, you will have to choose a “parent category”. There you choose where in the hierarchy you want your new category to be.

Just like with the main categories you can go posts >> categories to add new subcategories. Name your subcategory and pick your “parent category” from the dropdown menu.

Here we come to the more tree-building part. Your subcategories can have their own subcategories. As in our case, we might want to have several categories under ‘Stock‘, like different articles about plugins that help manage stock status, like this:

Here we have WooCommerce as the main category. With ‘Variations‘ and ‘Stock‘ as subcategories which in turn has ‘Qala Single Stock‘ as a subcategory. Categories at the same level in the hierarchy are called “sibling” categories. For example, here ‘Variations’ and ‘Stock’ are sibling categories.

It’s important to point out that categories can only have one main category. Meaning you cant add a subcategory with two different main categories.