skip to Main Content
WooCommerce: How To Show Empty Categories

2017-08-10: Created a plugin. View details here.

2017-07-17: Updated this post for WooCommerce 3.x compatible code.

The main action, woocommerce_product_subcategories_hide_empty, changed its behavior to act more inline with how it was named.

Request

Show empty categories on product pages and/or shop pages using WooCommerce

Required Plugins

Code for WooCommerce 3.x+

Place the following in your functions.php file of your theme:

Pre 3.x Code

Place the following in your functions.php file of your theme:

WooCommerce Settings

Go to WooCommerce Settings Product Tab and change one or both of the “Shop Page Display” and “Default Category Display” to “Show subcategories” or “Show both”

Image: WooCommerce settings page showing dropdown for Shop Page Display

Result

Before code is applied the empty “mints” top category isn’t displayed on the shop page.

Image: Showing the display of WooCommerce categories before the code is applied

After the code is applied the mints category is now displayed.

Image: WooCommerce display of categories after this code example is applied.

Disclaimer

Maje Media LLC cannot be held responsible for the functionality of this code. Please make sure you test it on a development site before adding the code to your production website. There is no support available for this (and other) code snippet(s) posted on this website. If you’d like Maje Media to do custom development to help with your custom implementation please send a contact request.

This Post Has 2 Comments
    1. isaiaiah,

      Thanks for the comment. We’ve updated the post to work correctly now in the post-3.x WooCommerce world.

Leave a Reply

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

Back To Top