Home » WooCommerce: Display Custom Filters @ WP Dashboard > Products

WooCommerce: Display Custom Filters @ WP Dashboard > Products

by Tutor Aspire

If you go to WordPress Dashboard > Products you will find default product admin filters such as “Select a category”, “Filter by product type”, “Filter by stock status”. What if you want to add more custom filters to let your shop managers find products easily?

For example, you could add “Filter by product tag” (“product tags” are one of the two default WooCommerce “taxonomies” together with “product categories”). Or, if you use custom taxonomies such as product brands, you could add a “Filter by product brand” dropdown.

Thankfully this is super easy – and here comes the proof 🙂

Adding custom admin product filters in WooCommerce

PHP Snippet: Add Custom Taxonomy Filter @ WooCommerce Products Admin Dashboard

 * @snippet       Show Custom Filter @ WooCommerce Products Admin
 * @how-to        Get tutoraspire.com FREE 
 * @sourcecode    https://tutoraspire.com/?p=78136
 * @author        Tutor Aspire 
 * @compatible    Woo 3.5.3
 * @donate $9     https://www.tutoraspire.com

add_filter( 'woocommerce_product_filters', 'tutoraspire_filter_by_custom_taxonomy_dashboard_products' );

function tutoraspire_filter_by_custom_taxonomy_dashboard_products( $output ) {
  global $wp_query;

  $output .= wc_product_dropdown_categories( array(
'show_option_none' => 'Filter by product tag',
'taxonomy' => 'product_tag',
'name' => 'product_tag',
'selected' => isset( $wp_query->query_vars['product_tag'] ) ? $wp_query->query_vars['product_tag'] : '',
  ) );
  return $output;

You may also like