Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add Categories and Subcategories to WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add Categories and Subcategories to WordPress

WordPress comes with the ability to sort your content into categories, tags, and taxonomies. One of the major difference between categories and tags is that categories can have subcategories or child categories. In this article, we will show you how to add categories and subcategories in WordPress and how to get the most SEO benefit out of categories.

Understanding Parent, Child, and Sibling Categories in WordPress

Categories are a powerful tool and can be used not only to sort your content, but to also develop a proper site structure that is meaningful and semantic.

Before moving forward, we recommend you to read our guide on categories and tags. It will help you understand how categories are different than tags, why they should not be confused or mixed up, and lastly how to properly use categories. Once you have read it, come back here and we will continue.

Let’s suppose you are creating a travel website for different destinations around the world. You may want users to be able to find articles by city and by country as well.

For example, you can add United States and then post articles for New York City, Los Angeles, Chicago, etc. This is where you can utilize child categories. United States would become a parent category, and cities can become child categories.

Child and parent categories in WordPress

It is important to note that a post filed under a child category does not need to be filed under parent category. For example, if you assign a post New York City as category which is a child category of United States, then you are free to choose whether you want the post to be filed under both or just the child category.

If you choose to file a post under the child category but not under the parent category, then your post will appear only on the archive pages of child category. This particularly helpful when you want to avoid duplicate content.

Let’s suppose you have created a parent category United States and it has only one child category, New York City. Now if you file a post under both parent and child categories, then the archive pages of both categories will be completely identical.

Having said that, let’s take a look at how to add categories and child categories in WordPress.

Adding Category in WordPress

You can add a new category in WordPress when writing a post. On the post edit screen, scroll down to the categories meta box and click on Add New Category link.

Adding new category while writing a post

You can also add a new category without editing a post. Simply visit Posts » Categories page and add your new category. This method is particularly useful, if you want to create all your categories before adding content.

Directly adding a new category without editing a post

Adding Child Category in WordPress

You can edit child categories the same way you added your parent categories. On the post edit screen, scroll down to categories section and click on the Add New Category link. This will show you text field for adding new category name and a dropdown menu to select the parent category.

Adding child category from post edit screen

Similarly, you can also visit Pages » Categories page. Add the name for your child category and then select the parent category from the Parent dropdown menu.

Adding child category from categories page

SEO Benefits of Category Based Site Structure

If you are using SEO Friendly URLs, then your child category URL will look like this.

http://example.com/category/united-states/new-york-city/

This is much more meaningful and helps search engines and users understand what your page is about. You also get a chance to add keywords into your URL, Keywords help people find content on search engines.

You can get rid of the ‘category’ prefix from your category URLs by installing FV Top Level Categories plugin. Simply install the plugin and it will remove category base from URLs of your category archive pages. You will get your category archive page like this:

http://example.com/united-states/new-york-city/

Display Categories and Child Categories in WordPress Sidebar

Your WordPress theme will automatically show the categories for each post. To display all your categories on your blog’s sidebar, you need to visit Appearance » Widgets page. Drag and drop categories widget from the list of available widgets to a sidebar.

Showing child and parent categories in WordPress sidebar

In the categories widget’s settings, check the box next to ‘Show hierarchy’ option and click on the save button. Visit your site and WordPress will show your categories with child categories aligned under the parent category.

Categories and child categories in WordPress sidebar

We hope this article helped you learn how to add categories and child categories in WordPress. You may also want to take a look these most wanted category hacks and plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Mikey says:

    Thanks for the help!

  2. Urooj says:

    Thank you for this post. I understand the category and the sub categories you explained. There si something I want for the my website. I make a category for a course with the course name now for the sub-categories, say, I want books, audios, videos and flashcards also I want a page which shows all the books from all the categories I have on a single page. Same for the audios, videos and flashcards. Is that possible without duplication?

  3. Jason says:

    Is it possible to have multiple subcategories with the same name? For example, to categorize counties in the United States as State -> County. I would like Mississippi -> Jackson but also Alabama -> Jackson. Jackson county exists in both states, but should be entirely unrelated. Any way to accomplish this?

  4. Rolfa Stol says:

    I add category per easy instructions above ( visit POSTS–add new category..) and the added show up to the right, correctly as far as i can see, but not on main page under categories. Impossible to get it there, only the default “uncategorixed” show up there. Really strange, as i need to use Kudani and make a post on distance, but it also seems to think i have no category…..

    • WPBeginner Support says:

      Simply creating a category is not enough. You may also need to assign atleast one post to that category. By default, WordPress sometimes does not display empty categories.

  5. Anca says:

    Great info! Thank you very much!! I finally managed to create a sub-category :)

  6. Suzy says:

    Dear staff,

    What if I want to display my 2 subcategories on their parent category page?

    I know that there is some sort of code, but where exactly should I paste this code, in the functions.php?

    Thank you

  7. Ian Anderson says:

    Hiya, thanks for the tutorial.

    Any tips where categories overlap? For example my DIY site often features stuff made from wood but also repairing or maintaining stuff made from wood. Do I categorize ‘wood’ or ‘repair’ / ‘maintain’.

    Plus different materials (metal/tile/fabric etc) so I’m really struggling to know what to put first, material or action?! Either way it looks like I’m going to have duplicate subcategories…
    Sometimes wish I had a needle narrow skillset lol!

  8. Kaye says:

    Is there a limit on categories? I currently have 10 displayed but have 12 listed so two is not showing up. Is there a way to add more so that the last two will show up. When going to my site live I see the two space on the third row but they are not showing up. What am I doing wrong

  9. Elliot says:

    Is there a limit to the amount of categories enabled on word press?

    I have a large amount of subcategories and wordpress won’t allow me to add anymore, it seems to just boot an old category out in order to make space for the new one?

    Can anybody help?

  10. Rahul Choudhary says:

    Hi Syed

    Thanks for this article. The example you have given here is exactly the same scenario i am dealing with. Now here is situation I have Categories

    Parent Category : Australia
    Child Category: NSW
    Child Child Category : Sydney

    I also have three more Parent categories at same level as Australia

    Apple
    Microsoft
    Other

    Now when I create a post I assign Parent & child categories because I am using ajax search to filter the result on hierarchy based. I also select one of those parent categories as well : Apple, Microsoft or Other.

    Now I have a search box where I sort the result based on country city or town. I would like to have a one more search box where I could sort based on Apple, Microsoft or others where once I select apple then it should display Australia -> NSW -> Sydney.

    Its like country (parent) category will be a child category in this search.

    Is this possible?

    Thanks
    Rahul

  11. francis okoye says:

    Thanks for d tutorials was really helpful. How can I make my subcategory to appear when the mouse is hovered on the category. I don’t want the subcategory to show beneath the category. I want it to show on hovering the category…. Any help please

  12. Rahul says:

    Hi

    I am having real problem sorthing this category issue. I want to display hotels & Car Rental in various countries so:

    Country
    -> US -> Alabama -> Montgomery
    -> Australia -> NSW -> Sydney

    Country is the ultimate parent category I would like to have.

    Then I would like to display either all the hotels or Car Rental in that particular city.

    So basically countries will have both hotels and car rentals but I would like to display hotels only in Sydney if user decided to display hotels only or car rental.

    Help Needed.

    Cheers

  13. claude apetse says:

    hello admin , i found very interesting post in your tag. but in my , the first day after hosting the site (wordpress) i added some category but after a while ( some days after) i could no longer add new category . it is adding of course in the category form when i fill it but not showing in the homepage of the site

  14. Chris says:

    Are the categories you mention in this post only applicable to POSTS, or can categories be added for PAGES as well? I don’t see an option for creating a category for PAGES.

  15. Ruby says:

    I really needed this tutorial! Thank you so much for making it so easy to understand.

  16. sandeep Kumar Dan says:

    Hi, Sayed

    Great article , its really helpful , I was doing an product listing project . Where i was need many category subcategory option , finally I did it with this tutorial. Thanks a lot :)

  17. sue says:

    I have added another sub category to an existing list and it does not show up on the blog page?
    TIA

  18. Prabhjit Singh Modi says:

    Thanks A Lot For This Aricle,It Works! :)

  19. Jarrar Alee says:

    Can one parent have more than one child category? if yes than how?? i cant do it…………

    • WPBeginner Staff says:

      Yes. When adding a category you should be able to see an option to choose its parent category.

  20. Jarrar Alee says:

    i have to add more than 1 sub-category in a parent… how can i?

  21. WPBeginner Staff says:

    Yes, we do understand what you mean :)

    Many WordPress themes actually come with built-in support to display sub-menus under menus.

    Go to Appearance -> Menus and add a subcategory just below its parent category. drag the subcategory to your right it will appear a little idented under the parent category. Save your menu and preview your site.

    On the front end if your subcategory does not appear in a sub menu but instead appears slightly indented below the parent category, then it is likely that your theme does not handle the display of submenus like you want.

    There are plenty of WooCommerce themes which support submenus you can check out their demos until you find the one that displays product categories in menus like you want.

  22. mreshane says:

    i have issues over subcategories to product categories, i want to make this a careful question and hoping to get a understandable answered
    (im not so good in english, correct me if im wrong – Thank you)

    I have a site but im using a woocommerce, im not sure whether this is the right topic or not but heregoes.

    Let say i have this 1 categories such like,

    1. windows (categories)
    1.1 xp
    1.2 windows 7
    1.3 windows 8 (but this one i rather want it to be in a different product categories such like)

    1.3 windows8
    1.3.1 Laptop
    1.3.2 Windows Tab

    but in 1 categories (WINDOWS), can i do that? i mean like geez im sorry if you didn’t get it, but that’s my point here.. i really want my categories in 1 menu to be in different subs & products..

    Is there any easy way to do this?

    im so lost..

    Sorry for my bad english..

    i already attached the picture, please do reply or email me mreshane[at]gmail[dot]com

    Thank you.

  23. Derek says:

    Hi just wondering your advice for bulk uploading of categories via cvs file. I want have computer brands as categories but thinking there has to be a quicker way than doing individually?

  24. mc says:

    Is it possible for a sub-category to apply to more than one parent? I.e. if the top level categories are Pizza and Calzones, ‘pepperoni’ can be a sub-category of both…but I don’t see how to handle that. Should ‘pepperoni’ be a tag instead?

    • WPBeginner Staff says:

      No it is not possible for a child category to have two parent categories. A workaround to this problem is to use custom taxonomies.

  25. Sue says:

    We have a store site and used the tutorial to create a new category. In the admin functions it shows up in the lists. However the new category does not show up on the actual site. What am I missing?

  26. Anna says:

    I’m startineg a blog and have created a Category and Sub-Category but the sub-category is not indented or anything to make it obvious it’s a sub-category, just doesn’t look right. Any advice?

  27. James says:

    But why? You say over and over again “to keep your blog organised” Where and to who are you organising it?

    Does it create category pages and if so do we really want them? can we control how they look ? Can we disable category pages?

    • Editorial Staff says:

      We are organizing all the content on your blog into categories.

      • Your Real Name says:

        Hi,. Can any one tell me how can i add sub-categories of a category in Navigation tab to display them once they click on specific category ? I am using Arras …
        In this tutorial, we’ll show you how to add sub-categories to your newly created top menu category. (In our case Help). 2. First, go to …
        How to Add Categories to a WordPress Blog Site. Categories for your WordPress blog are not as easily found as they might be. You could … Add sub-categories.

  28. Trish says:

    This is very helpful! THANK YOU! OK, so if I have a Fitness blog and I want a category at the top to be “strength workouts” and then I want the user to be able to highlight “strength workouts” and see a list of the exact strength workouts I have to share/offer, is that called a subcategory? What if I want like 15 of these sample strength workouts… or eventually 100’s of them… ? Is this how I’d go about it? Thank you!!!

    • Editorial Staff says:

      Ok, so think of categories as sections in a book and sub-categories to be chapters. A proper example would be like this:

      Parent category is called Entertainment, and sub-categories would be Film, Gaming, Music, Television etc.

      In your case you would have strength workouts as category, and then have each individual strength workout as a post. From what it sounds like, you don’t need subcategories at all.

      • Trish says:

        OK, thanks. My blog will have recipes, workouts, a fashion section, etc. so I would like the reader to be able to go to one of those categories then pick a workout under the workout section, a recipe under “recipes — breakfast recipes — ” and so on… so if those are not called subcategories, than what are they? Like on peanutbutterfingers.com website – the website has categories such as “workouts” and then if you highlight over “workouts” you’ll see where you can pick a type of workout, go into that and then select a specific workout… how did she get it set up like that? Do I have those capabilities using wordpress? Thank you so much! Sorry, I’m kind of lost and new to this portion of it :)

  29. Akgun_Fatih61 says:

    Finally i did it :p realy thx man :D

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.