How to remove ‘uncategorized’ from my WooCommerce sidebar?
33 Views • January 8th, 2021 • 1 minute read
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