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

Posted by Mike Jolley

I help build things at Automattic.

One Reply to “WooCommerce 3.3 – Hide uncategorized category from the shop page on the frontend”

  1. […] and activate. No configuration required. If you're more into writing code snippets yourself, here is the snippet the plugin is based off […]

Comments are closed.