To hide child categories in a WordPress category list, first identify the block or widget displaying it. In the Categories List block, enable Show only top-level categories. To change appearance instead, use that block’s design controls or add a CSS class and style the block’s actual rendered markup.
First identify which category display you are editing
WordPress has more than one way to display categories, and their settings are not interchangeable. A site-wide category list, category labels attached to posts in a Query Loop, and a classic widget serve different purposes.
| Display | What it shows | Relevant controls |
|---|---|---|
| Categories List block | A list of categories, suitable for a category-navigation area | Show only top-level categories, hierarchy, empty categories, and design controls (WordPress.org documentation) |
| Categories block in a Query Loop | Categories assigned to posts displayed by the loop | Default or pill styling, plus available design controls (WordPress.org documentation) |
| Classic Categories widget | A widget-style category list | Dropdown, post counts, and Show hierarchy; a top-level-only option is not listed in the cited documentation (WordPress.org documentation) |
If you use a block theme, edit site areas and templates in the Site Editor. The Customizer is not available in block themes unless a theme or plugin reactivates it. WordPress explains the Site Editor and block themes here.
Hide child categories in a Categories List block
- Open the editor area containing the list. For a block-theme site area or template, go to Appearance → Editor; for a page or post, open it in the block editor.
- Select the Categories List block. If selecting it on the canvas is difficult, use List View to find the block.
- Open the block settings in the sidebar and enable Show only top-level categories.
- Preview the page or template to confirm the list contains the parent categories you want.
This setting filters the list’s display; it does not remove child categories from WordPress. The block also has separate controls for hierarchy and empty categories. The official block guide describes the top-level option as displaying “only the top-level category.” See the Categories List block settings.
Recommended Free Tools
#1 Best Overall
Understand “Show hierarchy” before changing it
Show hierarchy indicates the parent-child structure in a list; it is not the same as hiding child categories. The classic Categories widget uses hierarchy to indent children, and the Categories List block also treats hierarchy separately from its top-level-only setting. Turning hierarchy off changes how relationships are presented, not which category records exist. Classic Categories widget documentation · Categories List block documentation
Style a Categories List block
Select the Categories List block and use its available color, typography, dimensions, and border controls first. The exact controls can vary with the theme and WordPress version. For styling beyond those controls, give the block a class and write CSS scoped to it.
Rank #2
- Select the Categories List block and open its settings sidebar.
- Expand Advanced and enter a distinctive value in Additional CSS Class(es), for example
category-nav. - Inspect the published page’s rendered markup using your browser’s developer tools. Identify the elements and classes used for the category links and any child lists.
- Add CSS targeting the class and markup you actually find, then check the result on desktop and mobile.
There is no documented, universal selector for subcategory links that is guaranteed across themes, widgets, plugins, and versions. Avoid copying a generic selector without checking your own page. The block documentation covers its additional CSS class control.
Style category labels in a Query Loop
The Categories block inside a Query Loop displays categories associated with the posts in that loop; it is not a substitute for a site-wide category navigation list. Select the block to choose its available default or pill style, then adjust color, typography, dimensions, or borders as needed. Available options depend in part on the theme. WordPress documents the Categories block settings.
Rank #3
What to do with a classic Categories widget
In a classic widget area, open the Categories widget and use its documented options, such as dropdown, post counts, and Show hierarchy. Because the cited widget documentation does not list a control to show only top-level categories, do not assume turning hierarchy off will hide children. If you need a top-level-only list, use a Categories List block where available or choose a solution that explicitly supports that display.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Hiding a link does not change the category hierarchy
Categories can have parent-child relationships. A child category archive contains posts assigned to that child; a parent category archive includes posts assigned to the parent and its subcategories. A post assigned to a child does not also have to be explicitly assigned to the parent to appear in the parent archive. Hiding a child from a displayed list therefore does not delete the category or change those archive relationships. Read WordPress’s guide to categories and their archives.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

