WooCommerce Show Empty Categories

Show all WooCommerce product categories whether they have assigned products or are empty.

By default WooCommerce will hide categories, which are empty, when displaying the list of categories.

A category is empty if there are no assigned products.This could be simply that the category has been created but no products assigned to it. Products which are out of stock but assigned to the category make the category valid for visibility.

To enable showing of all categories on the categories view include the following within the functions.php file

/**
Show empty categories on the shop page.
Enable Show categories under customise > WooCommerce > Product Catalogue
Alternative to above without using a function
*/
add_filter( 'woocommerce_product_subcategories_hide_empty', '__return_false' );

This can be developed as a function, perhaps to include further actions within:

/**
Show empty categories on the shop page.
Enable Show categories under customise > WooCommerce > Product Catalogue
*/
function vntweb_show_empty_categories ( $hide_empty )
{
  $hide_empty = FALSE;
}
add_filter( 'woocommerce_product_subcategories_hide_empty', 'vntweb_show_empty_categories', 10, 1 );

I like to present the function first, with its call subsequently.

With the addition of a function within the theme’s functions.php file categories which have no assigned products can be shown within the category list page.