0

I've more than 450+ WooCommerce product categories and subcategories. I want to add them all in the menu items, categories as a top level menu and subcategories as submenu. Is there any way to automate the process?

1 Answer 1

0

For menus this large, it's usually more efficient to use functions like wp_list_categories() (which can also output custom taxonomies like Product Categories) in whatever theme template you need to affect. Bonus: your menu will always be current, because unlike a static WP Nav Menu, this will always pull all Product Categories and not need manual updating.

Keep in mind, it's not always a good user experience to have such massive menus to drill down through, and Google specifically recommends having less than 100 links per page - which includes all links, not just menus. So, you may be better off just listing top-level categories in your menu, and making sure you have a robust search feature, to help with SEO and UX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.