Auto Subcategories Menu — Plugin
WordPress Plugin
Auto Subcategories Menu
Automatically injects WooCommerce subcategories into your navigation menu — mega menu, category images, and archive page image fallback, all in one plugin.
What it does
Two problems solved with one plugin
Add any WooCommerce product category to your navigation menu and the plugin automatically pulls in all its subcategories — no manual menu management needed. When categories are added or removed, the menu stays in sync on its own.
It also fixes the blank-thumbnail problem on WooCommerce category archive pages: if a subcategory has no image assigned, the plugin silently borrows a product image from that category so your grid never shows empty grey boxes.
Features
Everything included, nothing to configure manually
Auto Subcategory Injection
Recursively injects all child categories under any parent in the menu. Supports both product_cat and standard category taxonomies.
Mega Menu Style
Full-width multi-column layout on desktop. Natively integrated with Woodmart’s mega menu system when Woodmart is active.
Mega Menu Width Options
Full width (edge to edge) or Defined width (1200px centered card). Configured per menu item — not site-wide. Ideal for sites where full-width doesn’t suit every category.
Category Images in Menu
Displays the WooCommerce thumbnail for each subcategory inside the dropdown or mega menu. Size controlled via CSS variable.
Product Image Fallback (Menu)
If a category has no thumbnail set, a product image from that category is borrowed automatically. Cached for 12 hours — zero repeated queries.
Products Column
Latest products shown inside the mega menu panel. Pin specific product IDs (comma-separated) for manual curation — leave empty for automatic latest.
Archive Page Fallback
Category grids on WooCommerce archive pages auto-fill missing thumbnails with product images. Keeps your category pages looking full and professional.
Any Theme Compatible
Woodmart natively integrated. All other themes get the plugin’s own CSS/JS fallback — no errors, no broken layout, no theme dependency.
Installation
Up and running in under a minute
1
Upload the plugin
Upload the
auto-subcategories-menu folder to /wp-content/plugins/2
Activate
Go to Plugins → Installed Plugins and activate Auto Subcategories Menu
3
Add to your menu
Go to Appearance → Menus, add any product category item, save — subcategories appear automatically
Per-item Options
Each category item in Appearance → Menus gets its own control panel
Automatically add subcategories
Uncheck to disable auto-injection and manage children manually for this specific menu item only
Submenu style
Default dropdown or Mega menu (full-width multi-column panel on desktop)
Mega menu width
Full width (stretches edge to edge) or Defined width (1200px centered card) — choose per category, not site-wide
Show category images
Display WooCommerce thumbnails for each subcategory inside the dropdown or mega menu
Use product image fallback
Borrow a product image when the category has no thumbnail — keeps the menu looking complete and professional
Show products in mega menu
Adds a products column inside the mega panel. Enter comma-separated Product IDs to pin specific ones, or leave empty for the latest products automatically
CSS Customization
Override in Appearance → Customize → Additional CSS
:root {
--asm-cat-img-size: 42px; /* image size in nav submenus */
--asm-mega-width: 1200px; /* width of the defined-width mega panel */
}
Caching
Smart caching keeps page load fast
12-hour Transient Cache
Product image fallbacks are stored as WordPress transients — no extra database queries on repeated visits. Auto-expires every 12 hours.
To force-refresh the cache, run this in phpMyAdmin:
DELETE FROM wp_options WHERE option_name LIKE '_transient_asm_prod_img_%';
Zero Page-Load Overhead
Subcategory injection runs only when menu HTML is generated — typically cached by WordPress, WP Rocket, LiteSpeed Cache, or W3 Total Cache.
No queries fire on every page load once the menu HTML is cached by your caching layer.
Frequently Asked Questions
Common questions answered
Does it work on themes other than Woodmart?
Yes. When Woodmart is active, the plugin uses Woodmart’s native mega menu system. On any other theme, it falls back to its own CSS and JS — no errors, no broken layout, full functionality.
How do I disable auto-injection for a specific menu item?
Open the menu item in Appearance → Menus, expand the plugin panel, and uncheck “Automatically add subcategories”. That item will then only show what you manually add, while other items continue auto-injecting.
Does the mega menu work on mobile?
The mega menu layout is desktop-only — on mobile it falls back to a standard dropdown or accordion-style menu (depending on your theme). This is intentional, as mega menus don’t suit small screens.
What happens if a category has no image and no products?
If no category thumbnail is set and no products exist in that category, the image slot is simply left empty. The layout does not break — the text and links still display normally.
Can I use it with multiple menus on the same site?
Yes. The plugin works on all registered menus simultaneously. Each menu item has its own independent settings, so you can have different configurations (mega vs. dropdown, with or without images) in different menus.
Will it slow down my site?
No. The plugin runs only during menu HTML generation, which is then cached by WordPress and any page caching plugin. Product image fallbacks use transient caching (12 hours). There is no overhead on regular page loads.
Changelog
Release history
v2.13Archive page subcategory thumbnail fallback — empty category images auto-filled from a product in that category
v2.12Defined-width mega menu rendered as a centered 1200px card — transparent outer panel, styled inner container
v2.8Mega menu width option added (Full width / Defined width) per menu item
v2.2Hybrid Woodmart + own-CSS rendering; product image fallback in navigation menu
v2.0Mega menu style, category images, products column
v1.0Initial release — auto subcategory injection
🌐 metaaffinity.net
Developed by Imran · WordPress plugin development & WooCommerce customization