Woo Hierarchical Category Menu
Insert an automatically generated WooCommerce category tree anywhere in a WordPress menu or page.
by WBL · github.com/webloomlabs/woo-hierarchical-category-menu
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/webloomlabs/woo-hierarchical-category-menu/releases/download/v2.1.2/woo-hierarchical-category-menu.zipReadme
Woo Hierarchical Category Menu
Insert an automatically generated WooCommerce product-category tree anywhere in a WordPress menu or page.
Instead of hand-adding every category to your navigation and re-editing the menu each time the catalogue changes, you drop a single placeholder item into the menu. On render, the plugin expands it into the live category hierarchy — nested to whatever depth you choose.
- Requires: WordPress 5.8+, PHP 7.4+, WooCommerce 5.0+
- License: GPL-2.0-or-later
Installation
- Download
woo-hierarchical-category-menu.zipfrom the latest release and install it via Plugins → Add New → Upload Plugin. - Activate it with WooCommerce active.
- Open Appearance → Menus.
Using it in a menu
- In Appearance → Menus, open the Woo Category Shortcode panel.
- Set a title, adjust the shortcode if you want non-default options, and click Add to Menu.
- Drag the new item under
Shop(or any parent item) and save.
The placeholder stays visible in the admin, but on the front end it is replaced by the real category tree. Categories are resolved on every page load, so new categories appear in the navigation without touching the menu again.
Set hide_label="1" when you want the categories attached directly to the
placeholder's parent — the placeholder's own label is then dropped from the output.
Using the shortcode
The same output works in posts, pages, widgets, and page builders:
[woo_category_menu depth="2" hide_empty="1" hide_label="1" name_case="title"]
It renders a nested <ul class="wbl-woo-category-menu"> with .children
sub-lists, ready to style with your theme's menu CSS.
Attributes
| Attribute | Default | Description |
|---|---|---|
depth |
0 |
Maximum levels to render; 0 is unlimited. |
parent |
0 |
Start from the children of this product category term ID; 0 starts at the top. |
hide_empty |
1 |
1 hides categories with no products, 0 shows them. |
hide_label |
0 |
1 hides the placeholder's own navigation label and attaches categories to its parent. |
name_case |
title |
original, title, sentence, lower, or upper. Display only — the stored term name is untouched. |
orderby |
name |
name, slug, term_id, count, or menu_order. |
order |
ASC |
ASC or DESC. |
include |
— | Comma-separated category IDs to restrict the query to. |
exclude |
— | Comma-separated category IDs to leave out. |
show_count |
0 |
1 appends the product count to each category. |
Unrecognised values fall back to the defaults rather than erroring.
Example
[woo_category_menu parent="25" depth="3" hide_empty="0" hide_label="1" name_case="title" orderby="menu_order" show_count="1"]
Notes
- Generated parent items carry
menu-item-has-children, so theme dropdown toggles — including tap-to-expand mobile menus — work on the dynamic levels. - Generated items also carry
wbl-dynamic-product-categoryalongside the standardmenu-item-type-taxonomy menu-item-object-product_catclasses, if you need to target them in CSS. - Uninstalling deletes the plugin's placeholder menu items and its stored settings. Your product categories and the rest of your menus are left alone.
Changelog
See the == Changelog == section of readme.txt for the full history.
2.1.2
- Fixed nested category submenus not opening on mobile. Dynamically generated
parents now receive the
menu-item-has-childrenclass that theme dropdown toggles rely on.
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v2.1.2 | Aug 24, 2026 | woo-hierarchical-category-menu.zip | 0 |