Categories
WordPress Plugins

Exclude Categories From The WooCommerce Product Category Widget

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.

7 replies on “Exclude Categories From The WooCommerce Product Category Widget”

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.

Leave a Reply

Your email address will not be published. Required fields are marked *