Website Building » WooCommerce » How Do I Hide a WooCommerce Product Filter?

How Do I Hide a WooCommerce Product Filter?

Last updated on January 19, 2023 @ 1:13 pm

There are a few different ways that you can go about hiding a WooCommerce product filter. One way is to simply remove the filter altogether from your WooCommerce store.

This can be done by going into your WordPress admin panel and navigating to WooCommerce > Settings > Advanced > Product Filters. From here, you can deselect the options for each filter that you want to remove.

Another way to hide a WooCommerce product filter is to use CSS to hide it from view on your front-end store. This can be done by adding some simple CSS code to your theme’s stylesheet. For example, if you wanted to hide the price filter, you could add the following code:

woocommerce-widget-layered-nav-price {
display: none;
}
PRO TIP: If you are looking to hide a WooCommerce product filter, it is important to note that this can potentially lead to decreased sales and conversions on your website. Additionally, hiding product filters can make it more difficult for customers to find the products they are looking for, which can lead to frustration and ultimately result in them leaving your site without completing a purchase.

You can also use JavaScript to hide a WooCommerce product filter. This can be done by adding some code to your theme's functions.php file or by using a plugin like Custom JS and CSS for WooCommerce. For example, if you wanted to hide the category filter, you could add the following code:

function wc_hide_category_filter() {
global $wp_query;
if( is_tax( 'product_cat' ) ) {
$wp_query->set( 'term', '' );
}
add_action( 'parse_query', 'wc_hide_category_filter' );

There are a few different ways that you can go about hiding a WooCommerce product filter. This can be done by going into your WordPress admin panel and navigating to WooCommerce > Settings > Advanced > Product Filters. For example, if you wanted to hide the price filter, you could add the following code:

.woocommerce-widget-layered-nav-price {
display: none; 
}  

You can also use JavaScript to hide a WooCommerce product filter. For example, if you wanted to hide the category filter, you could add the following code:

function wc_hide_category_filter() {
global $wp_query;     
if( is_tax( 'product_cat' ) ) {
$wp_query->set( 'term', '' );
} 
} add_action( 'parse_query', 'wc_hide_category_filter' );
Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.