How to hide categories that have no products in WordPress WooCommerce

My client has a store that is not yet filled out with products. Therefore, some of the categories contain no products as of yet. They want to hide the categories with no products (without just deleting the categories manually). I haven’t been able to find a way to hide categories that have no products associated with them. I’ve seen solutions that will hide a specific category by name, but I’m looking for something that is condition based on the fact that no products are in the category. I’m not talking about product quantities, just to be clear – it should depend on the existence of associated products. Thanks in advance!

Related posts

Leave a Reply