If you want a cleaner WooCommerce shop page and don’t want product categories displayed above the product grid, you can remove the category display with a simple filter.
Steps
- Open your theme’s
functions.phpfile. - Add the code below.
- Save the file.
- Refresh your Shop page.
Done — WooCommerce product categories will no longer be displayed on the Shop page.
function hide_shop_product_categories( $args ) {
if ( is_shop() ) {
$args['hide_empty'] = true;
}
return $args;
}
add_filter(
'woocommerce_product_subcategories_args',
'hide_shop_product_categories'
);