WooCommerce 3.3 – Hide uncategorized category from the shop page on the frontend

<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' );
function custom_woocommerce_product_subcategories_args( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
}

view raw
functions.php
hosted with ❤ by GitHub

Published by Mike Jolley

I help build things at Automattic.

One thought on “WooCommerce 3.3 – Hide uncategorized category from the shop page on the frontend

Comments are closed.

%d bloggers like this: