Website Building » WooCommerce » How Do I Apply a Filter in WooCommerce?

How Do I Apply a Filter in WooCommerce?

Last updated on January 15, 2023 @ 6:39 pm

Applying a filter in WooCommerce is simple and easy. There are two ways to do it, either through the WordPress admin panel or by adding code to your theme’s functions.php file.

Through the WordPress Admin Panel:

  1. Login to your WordPress Admin panel
  2. Click on WooCommerce in the left sidebar
  3. Click on Settings
  4. Click on the tab
  5. Find the checkbox next to “Enable filtering” and check it

Adding Code to functions.php:

Add the following code snippet to your theme’s functions.php file:

function wcs_woo_remove_reviews_tab($tabs) {
unset($tabs['reviews']);
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );

This will remove the Reviews tab from your product pages.

PRO TIP: If you are not comfortable with code, we recommend that you consult with a developer before making any changes. Making changes to your site’s code can have unintended consequences and may break your site.

Applying a Filter in WooCommerce is Easy!

Whether you’re a beginner or an advanced user, applying a filter in WooCommerce is simple and easy.

If you want to remove the reviews tab from your product pages, then all you need to do is add one line of code to your theme’s functions.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.