Add this code to the end of your child themes functions.php file to exclude one of more product categories from displaying in the WooCoomerce Product Category widget.
The above code removes 2 categories.
Simply change the category i.d’s to suit your own needs.
Hi Brad
Found this through your answer on stackoverflow. Thanks for providing the snippet however I cannot get it to work. My category stays in the “woocommerce product categories widget”. I of course changed the category id. Could it be a change in Woo 2.2? I looked at the class-wc-widget-product-categories.php but couldn’t see any change. This file however is not in the new Woo 2.2 widget-product_categories.php
Appreciate any help you can provide.
Thanks
Wendy
Is possible to affect two sidebars? For example in sidebar 1 I have the widget and want to exclude 3 of 10 categories in sidebar 2 I have the same widget but I want to exclude only 1 category.
You can modify the code to do that.
Do you have any example for that?
The code would need to be written and tested.
Is there a way to do this for woocommerce shortcode? ie
Admin (1)
Genesis (15)
WooCommerce (48)
WordPress (4)
You could add a argument to the code to do this.