Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add Categories and Subcategories in WordPress

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to know how to create categories and subcategories in WordPress?

In WordPress, your posts can be organized into different categories and tags. You can even create subcategories for further organization. Using categories and subcategories can help your readers find the content they’re most interested in and improve your website’s SEO rankings.

In this article, we’ll show you how to add categories and subcategories in WordPress, step by step.

Categories and subcategories in WordPress

Understanding Parent and Child Categories in WordPress

Categories are a powerful tool. They’re not just a way to sort your content. They also help you develop a proper site structure that is meaningful and semantic. This is great for your WordPress SEO.

Note: If you’re not clear about the difference between categories and tags, take a look at our guide on categories vs tags. This explains why categories and tags are different, and how to use them correctly.

Now you might be wondering, why and when would someone need to use child categories (subcategories) on their WordPress website?

Let’s say you’re creating a travel blog for different destinations around the world. You might want users to be able to find articles by both country and city.

For example, you might have an article about the best waterparks in the United States. It would make sense to use ‘United States’ as the category for that post.

However, you might also have articles about the best places to eat in New York City, Los Angeles, Chicago, and more. This is where you can use child or subcategories. Then ‘United States’ can become a parent category and the cities can become child categories.

Category and subcategory in WordPress

A post filed under a child category doesn’t need to also be filed under the parent category. In our example, we could have left ‘United States’ unchecked and just put the post in the ‘New York City’ category.

If you file a post under the child category but not under the parent category, then your post will appear only on the archive pages of the child category.

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

Adding a Category in WordPress

You can easily add a new category in WordPress when writing a post.

First, if the sidebar isn’t showing when you’re editing a post, you’ll need to click on the gear icon on the top right.

Then, in the Post panel on the right-hand side, open up the Categories tab.

where to find categories when editing a post

You’ll see different categories that you’ve already created.

However, to create a new category, you can simply click the ‘Add New Category’ link.

Adding a new category in WordPress

Once you click the link, two new boxes will appear where you can add your category.

For a regular category, you don’t need to select anything from the Parent Category dropdown.

Enter a category name and parent category

Once you’ve typed in the name for your category, simply click the ‘Add New Category’ button.

The box for that category will then be automatically checked for your current post. You can uncheck it if you want.

Preview of new category

You can also add a new category without editing a post.

Simply go to Posts » Categories and add your new category. This is handy if you want to create all your categories before adding content.

This method also lets you edit the slug (URL) for your categories. You can delete and rename categories and give them a description. See how to add SEO keywords and descriptions in WordPress.

Add a new category

Adding a Child Category (Sub Category) in WordPress

You can add and edit child categories in exactly the same way you added your parent categories.

When you’re editing a post, open the settings panel and scroll down to the Categories tab.

Next, click the ‘Add New Category’ option and type in the name for your child category. Then select the category that you want to use as the parent from the dropdown list.

Add a subcategory

Similarly, you can also go to Posts » Categories to add child categories.

Just type in the name for your child category and select the parent category from the dropdown menu.

Select a parent category

Your child categories can also have their own child categories if you want.

For instance, we might decide to develop a category structure that is used to group multiple types of content together, like this:

Preview of category structure

Here, News is a category, with the Announcements as child categories.

Categories on the same level within a parent category are sometimes called ‘sibling’ categories. For instance, the Announcements and SEO Tools are sibling categories here.

Categories can only have one parent. You can’t add one sub-category under two different parent categories.

SEO Benefits of Category Based Site Structure

Your category URLs will look something like this:

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

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

WordPress also allows you to easily change the /category/ prefix of your category URLs. You can even remove it completely if you want.

Simply go to the Settings » Permalinks page from the WordPress admin panel and scroll down to the ‘Category base’ section.

Change category permalink settings

Here you can enter the prefix you would like to use and click on the ‘Save Changes’ button to store your changes.

The ‘category’ prefix in your category URLs doesn’t add any benefit to your SEO.

This is why some website owners prefer to remove the remove the word ‘category’ from their WordPress category archive pages’ URLs. You can easily do this by using the All in One SEO plugin, so your category URLs look like this:

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

Simply go to the Search Appearance menu for AIOSEO and then select the Taxonomies tab. Under the Advanced settings for Categories, you will see the option to remove category base prefix.

AIOSEO Remove Category Base Prefix

Alternatively, you can also use the FV Top Level Categories plugin. Simply install the plugin and it will remove the word ‘category’ from your category archive pages’ URLs.

Important: If you decide to change the category base on an existing WordPress site, then you’ll need to set up redirects to avoid 404 errors for search engine visitors. For more detailed instructions, please follow our guide on how to change the category base prefix in WordPress.

How to Display Categories and Child Categories in WordPress Sidebar

You can add a widget block to your WordPress sidebar or footer to show a list of categories. In your WordPress dashboard, go to Appearance » Widgets.

If you haven’t changed your widgets from the ones that WordPress puts there by default, you should see the Categories widget block already in place. If not, then you can click the ‘+’ button and add a ‘Category’ block to your widget area.

Add a category widget block

By default, the widget will show all your categories in a flat list, in alphabetical order.

Here’s a preview of how they looked on our test website:

Preview of categories in sidebar

Tip: Categories will only display on the list if you’ve assigned at least 1 published post to them.

You can change it to show the child categories (subcategories) beneath their parent categories if you want. Simply enable the ‘Show hierarchy’ option in the widget settings like this. Don’t forget to click the ‘Update’ button.

Show hierarchy in widget blocks

On your site, you should now see your parent categories with the child categories nested beneath them.

Tip: If your sidebar changes don’t show up, you might need to clear your WordPress cache.

Aside from the default category widget block, you can also create custom category menu links using the WordPress navigation menu. After that, you can add that menu to your header menu, sidebar, footer, or other menu locations.

We hope this tutorial helped you learn how to add categories and child categories in WordPress. You may also want to take a look at our article on how to create an email newsletter to grow your website traffic, and our comparison of the best WordPress page builders to create custom layouts.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

99 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Steve says

    Is there a way to filter the categories? Id like to show the categories related only to this page topic.

  3. Anna Tang says

    Thank you for the tutorial. It was clearly written and I solved my category/subcategory issues within 5 minutes.
    Best,
    Anna

    • WPBeginner Support says

      You can change which category is the default under Settings>Writing but you must have at least one default category

      Admin

  4. Michael Taylor says

    Is it possible to create a hierarchy with lets say parent, child, grandchild , and great grandchild? in other words…

    United States > California > San Francisco > Hotels
    United States > Nevada > Las Vegas > Hotels
    United States > New York > New York City > Hotels
    Canada > British Columbia > Vancouver > Resturantrs

  5. dinesh says

    How can I represent woocommerce categories, subcategories, and products in the form:
    1) A form consists of 3 fields categories, subcategories, and products
    2)If we select one category the related subcategories should be displayed in subcategories feild.
    3)Select Subcategory , such that the product should be displayed by related categories and subcategories
    4) And if we submit the form It should redirect to checkout page

  6. sera says

    Hi
    i have a problem
    i want to associate one subcategory to a few parents
    for example:

    outdoor > panel
    indoor > panel

    outdoor & indoor is parents and panel is a child

    can you help me please??
    thaks a lot

    • Usama Ahmed says

      That is the most basic example of many to many relationship inside categories. One Category with multiple parents.

      Unfortunately WordPress is a pile of garbage and till this date this feature is not available.

  7. Sunshine Vaughn says

    I don’t want all of my posts to show when i click on the parent. How do i go about fixing this?
    I only want to see the posts directly placed in each category and then list out each sub category just like you would in using Windows Explorer.
    Thank you,
    Sunshine

  8. Mike says

    I’m helping a friend switch update their website, and upon investigation they built it mainly from categories and sub-categories, with only four (unfinished and unlinked) pages and the reading setting as show recent posts, instead of having a static homepage. The main menu displays categories with sub categories highlighted underneath.

    My question is, what’s the best way to update the site, by adding a static homepage and other primary pages for the posts to be listed with without messing with the overall organization of the content?

  9. Bel says

    Hello, awesome site. Thank you you have helped me to build my website.
    I have question hoping you can help – is there an plugin to place small images left side of post summaries on landing page.? I have looked and searched and even paid for a plugin that did not operate. Any help would be great.

  10. Steven Denger says

    Very helpful like all your tutorials are. I always come here to learn the best practices as well as great plugin resources. Thanks for this tutorial.

  11. Stefan says

    So… what is a sub-category good for?
    :)
    I can just have “United States” and “New York” — both as categories, and simply drag “New York” under “United States”. They’ll be displayed the same, as category / subcategory, only that they’re both categories.

    I can choose if an article goes to both, or just one of the categories.

    So, what is the use of having a subcategory?

    • WPBeginner Support says

      Hey Stefan,

      Subcategories allow you to add subtopics to a category. An article, filed in a sub-category is also displayed in the parent category. However, an article filed in a sibling category will not be displayed on other sub-categories that are also part of the same parent category.

      Admin

  12. Vijeesh Vijay says

    Duplicate content is the major issue when assigning posts to both parent categories and child categories. For example, I want the same post to show up under “united states” parent category and “New York” child category. However I need more than 1 post in each child category to avoid duplicate content.
    The problem occurs when you have a menu or website navigation made of categories. You have to wait until the blog is big enough to have a few articles in each sub categories to make a proper menu. Is there a way around this ?

    • Anja says

      Hi VIJEESH,

      It shouldn’t be a problem. The url of the page/post remains the same, it is mentioned in the category page and Google recognizes this, their bots are really intelligent :-) To avoid it even better I suggest you install YOAST SEO, a free plugin, which is great for your SEO and they offer the option to avoid duplicate content from categories as well in the settings menu.

      Hope this helps!
      Anja

  13. rose says

    hi guys!

    I’ve been working on my website and for days I’m trying to figure out on how to work the sub menus on my two blog categories namely lifestyle and tv series- the 1st submenu is working out fine but the 2nd level up to fourth level- I can’t click it al all.

    i’ve tried plugins and all

    is there anyone can help me with this please? Thanks so much

    sincerely,
    rose

  14. Jill says

    Great article. This was a HUGE help!

    Question:
    You explained how to get the child categories to show on the blog sidebar but how do I get them to show on the top bar as drop downs?

  15. vivek says

    To do this go to Posts -> All Posts. Next, select the posts you want to add to a category, click on the Bulk Actions tab, select Edit and finally press the Apply button. Once you do that, you will few options you can adjust for those posts. One of them is the Categories section.

  16. Harish Negi says

    I am using category and subcategory, but they are not reflecting in my URL. is there any reason for that in wordpress. Please answer..

  17. evan says

    I would like my category pages to show the sub-category PAGES that belong to that post. Currently, my category pages are show the subcategory POSTS.

    How do I fix this?

  18. Alex says

    Great read, thanks!

    I am creating a website with the exact same example you gave. I am wondering if it’s better to have the permalink structure set to:
    1. /continent/country/destination/%postname% or to
    2. /%postname%
    I am not sure if the first option is better, since it is becoming quite long.

    Thank you for your help!

  19. 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?

  20. 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?

  21. 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…..

  22. 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

  23. 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!

  24. 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

  25. 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?

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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.

  31. 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 :)

  32. sue says

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

  33. Jarrar Alee says

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

  34. 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.

  35. 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.

  36. 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?

  37. 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?

  38. 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?

  39. 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?

  40. 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?

      • 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.

  41. 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.

      Admin

      • 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 :)

Leave a Reply to Jason Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.