How to hide filters on categories

Welcome to Product Filter for WooCommerce video guide.

This tutorial covers how to hide filters on categories for your WooCommerce Shop.

To start this tutorial go to Products > Categories. Here you will see all your categories. 

If you want to hide the filter on one of the categories then you need to choose the slug version of the name. For example, I will choose Cheese.

Now navigate to your child theme and open the functions.php file.

Under the PHP tags put this code:

add_filter( 'prdctfltr_show_filter', 'my_hide_filter_on_category_function_jkbg4iu3b' );

function my_hide_filter_on_category_function_jkbg4iu3b() {
 if ( is_product_category( 'cheese' ) ) {
  return false;
 }
 return true;
}

In the if statement you will put the slug version name of your category. 

Now when we go to our shop and click the Cheese category we will see that our changes have taken effect and that on that category the filter isn’t shown anymore.

Basically you can use any conditional tags here. I will leave a link to some WooCommerce samples below the video

Watch more Product Filter for WooCommerce videos to learn more. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

3 comments on “How to hide filters on categories”