How to remove ‘uncategorized’ from my WooCommerce sidebar?

Date: January 8th, 2021
Category: Questions, 20 Views

Asked by: Nancy, Location: Canberra, Australia

Hi Manish,

I have one e-commerce website in WooCommerce, in sidebar it’s showing a category ‘Uncategorized’ which looks odd in UI, any suggestion how to remove that from my sidebar??


Answer

Paste the following codes at last in functions.php, before any closing tag (if any)

							
add_filter( 'woocommerce_product_categories_widget_args', 'custom_woocommerce_product_subcategories_args' ); function custom_woocommerce_product_subcategories_args( $args ) { $args['exclude'] = get_option( 'default_product_cat' ); return $args; }
Share my post: 

Leave a Reply

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