WooCommerce: Display Custom Filters @ WP Dashboard > Products

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 CustomizeWoo.com FREE 
 * @sourcecode    https://businessbloomer.com/?p=78136
 * @author        Rodolfo Melogli 
 * @compatible    Woo 3.5.3
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */ 

add_filter( 'woocommerce_product_filters', 'bbloomer_filter_by_custom_taxonomy_dashboard_products' );

function bbloomer_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;
}

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (delete "?>" if you have it there). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7.3.

If you think this code saved you time & money, feel free to join 14,000+ WooCommerce Weekly subscribers for blog post updates or 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

34 thoughts on “WooCommerce: Display Custom Filters @ WP Dashboard > Products

  1. Works!
    Tested with WP5.9.1 and WC6.2.0

    Thanks

  2. Not showing products with draft status ๐Ÿ™ Can you help me to also show products with status “Draft”?

    1. Hi Levskyy! Sorry, don’t you already have a text link for “All | Published | Drafts” products, above the filters?

  3. This tag filter snippet is perfect for what we were looking for. It worked great, until the most recent WP/Woocommerce updates in the last week(s). Now the drop-down for “Filter by Product Tag” is showing the correct tags, but showing “0” for the numbers for each tag (eventhough there are plenty of products with those tags). Also, filtering no longer works. So something likely has changed with a recent Woocommerce update?

    Would love to use the updated version of this script when it becomes available.

    1. Hi Ernest, thanks for your comment! I just tested this again with Storefront theme and it works perfectly. Maybe your theme (or another plugin) is messing/conflicting with my snippet.

      To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentytwenty” theme (load the snippet there in functions.php) as explained here: https://www.businessbloomer.com/lesson/trwm4l01/

      Once you do that, does it work? If yes, you have a problem with your current theme or one of the plugins.

      Hope this helps!

  4. Hello,

    What about if I want to filter products by other attributes, like weight and L/W/H(Dimensions ) please?

    Thanks, and have a nice day.

    1. Alex, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  5. A little side note. Implementing this snippet will cause most other filters to disappear..

    1. Did you use the exact same code?

  6. Great article as usual.
    Not sure if this is custom work or not, but is it possible to easily implement a “opposite” filter like is NOT in term?

    1. Yes, it is custom work I’m afraid. Get in touch if needed! Thank you

  7. Hello Rodolfo! First of all thank you for all the help you provide for free!
    Do you know how to configure WooCommerce to sum the total quantity of the products in the ADMIN order page? PLEASE HELP

    1. Hi Gabriel, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  8. It worked great and used the code also to filter by product attribute, amazing thanks

    1. Awesome!

  9. Hi,
    It very useful but I need to filter The admin products using Product SKU Is it possible . please let me know how to do this . Thank you

    1. Hi Nirmal, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  10. Thanks you so much for this custom filter. Is there anyway to filter product tag by typeahead like category filter ?

    1. Hi Steven, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  11. Good solution. Simple and effective.
    Do not have any solutions – that you can share – identically, but for products variation search on order pages?
    Thanks in advance.

    1. Thank you – no I don’t at the moment!

  12. Hi bro. How can I filter none-tag products ? I have many products without tags and I want to filter them for adding tags but I dont know how…

    1. Hi bro. Try using the existing sort buttons.

  13. Hi, Im trying to do the same wth coupons; I want to either filter them by usage_limit_per_user, or sort them by usage_limit_per_user.
    I tried using your code and modified it, but no luck yet.
    https://github.com/schalkjoubert/wc-coupon-filter/blob/master/function

    Will be super if it is possible to fix easily.
    Thank you

    1. Hello Schalk, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  14. Man, you save my day.
    Used with product_brand and voila — all working. Thanks!!

    1. Excellent!

  15. Hello,

    how can we apply this to product status? as anyone knows, when you sort the products, you also see the pending or drafts, and it is very inconvenient. It will be better if on sorting you can only see the published!

    thanks

    1. Hey Perusi, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  16. Hi,
    Thank you for a great article. But actually what I want is to filter products in admin page by tax class. Is that possible? And how to do that? Please help.

    1. Hello John, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  17. It worked perfect!
    Can I add more filters? Something like store or taxes?
    Thank you very much!

    1. Hey there – thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

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