Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide WooCommerce (3.3 and above) default category
<?php
/* Hide WooCommerce default category on the frontend */
add_filter( 'woocommerce_product_subcategories_args', 'woocommerce_hide_default_category' );
function woocommerce_hide_default_category( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment