Title: Hide empty categories
Last modified: May 12, 2021

---

# Hide empty categories

 *  Resolved [craigmckee](https://wordpress.org/support/users/craigmckee/)
 * (@craigmckee)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/)
 * Morning all,
 * I have set up WooCommerce to hide products that are out of stock. Works great!
   The problem is though, on my shop page where it lists the categories, it will
   show categories that have no products in (e.g. there are products in the store
   but they are all out of stock so it just leads to an empty page).
 * How do I get round this? (Click on Essentials and you’ll see what I mean).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhide-empty-categories-14%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [Cara](https://wordpress.org/support/users/dcka/)
 * (@dcka)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14428354)
 * Hi, [@craigmckee](https://wordpress.org/support/users/craigmckee/)!
 * I checked the Essentials category on your site, and I do see what you mean. I
   found a mini-plugin that could help though: [Hide categories with no visible products in the Product Category Widget](https://chrisk.io/woocommerce-hide-categories-with-no-visible-products-in-the-product-category-widget/)
 * Can you see if that works for you?
 *  Thread Starter [craigmckee](https://wordpress.org/support/users/craigmckee/)
 * (@craigmckee)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14428375)
 * Thank you [@dcka](https://wordpress.org/support/users/dcka/), I tried to download
   it but it’s coming up with “Forbidden” so I’ve emailed to see if I can get a 
   copy.
 * Thank you.
 *  Plugin Support [Cara](https://wordpress.org/support/users/dcka/)
 * (@dcka)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14428440)
 * You’re very welcome!
 * And as an aside, you can also try downloading the ZIP file from the code’s GitHub
   page here:
    [https://gist.github.com/cklosowski/df41c06eb21f0405a618606f2b0daacc#file-woocommerce-hide-empty-categores-php](https://gist.github.com/cklosowski/df41c06eb21f0405a618606f2b0daacc#file-woocommerce-hide-empty-categores-php)
 *  Thread Starter [craigmckee](https://wordpress.org/support/users/craigmckee/)
 * (@craigmckee)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14428462)
 * [@dcka](https://wordpress.org/support/users/dcka/) Thank you. I was able to upload
   the plugin but it’s not working. Perhaps because I’m displaying everything through
   this shortcode rather than a widget?
 * [product_categories columns=”3″]
 *  Plugin Support [Cara](https://wordpress.org/support/users/dcka/)
 * (@dcka)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14436793)
 * > I was able to upload the plugin but it’s not working. Perhaps because I’m displaying
   > everything through this shortcode rather than a widget?
   > [product_categories columns=”3″]
 * [@craigmckee](https://wordpress.org/support/users/craigmckee/), that would make
   sense!
 * I ran some extra tests for you on my site, and I used the same [product_categories]
   shortcode. I then set up a category, category1, to contain one product that is
   out of stock.
 * As you’ll see in this screenshot, category1 shows up in my sidebar, but it is
   hidden where in the display created by the [product_categories] shortcode:
     
   Link to image: [https://d.pr/i/iuT7l8](https://d.pr/i/iuT7l8)
 * For reference, my site is using the latest versions of both WordPress (5.7.1)
   and WooCommerce (5.3). So, I’m wondering if that might be the difference between
   your site and mine.
 * Can you please check what version of WooCommerce your site is using? You can 
   check that under WooCommerce > Status > System Status or WP Admin > Plugins.
 *  Thread Starter [craigmckee](https://wordpress.org/support/users/craigmckee/)
 * (@craigmckee)
 * [5 years ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14438805)
 * I’m using WooCommerce 5.3.0, WooCommerce – Exclude empty categories from widget
   0.1 and WordPress 5.7.2
 * But still showing that Essentials category even though when you click it, it’s
   empty.
 *  Plugin Support [Cara](https://wordpress.org/support/users/dcka/)
 * (@dcka)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14450606)
 * Hmmm… that is very strange!
 * Let’s see if it’s being caused by a conflict, either with your site’s theme or
   a plugin. If you’re up for that, can you please install this plugin: [Health Check](https://wordpress.org/plugins/health-check/)?
 * That plugin has a troubleshooting mode where only you as the admin will see any
   changes made to the site. The general steps for the conflict test would be:
 * 1. Enable troubleshooting mode on the Health Check plugin. This will deactivate
   all plugins and switch the site’s theme to a default one like Storefront
    2. 
   Activate WooCommerce 3. Check if the Essentials category still shows up
 * If the problem is gone, then activate plugins one at a time. In between each 
   activation, repeat step 3. If you’re interested, we have a more in-depth guide
   on using that plugin here:
    [https://docs.woocommerce.com/document/troubleshooting-using-health-check/](https://docs.woocommerce.com/document/troubleshooting-using-health-check/)
 *  Thread Starter [craigmckee](https://wordpress.org/support/users/craigmckee/)
 * (@craigmckee)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14456292)
 * OK, I’ll give it a try.
 *  Plugin Support [Dani F. a11n](https://wordpress.org/support/users/danielinhou/)
 * (@danielinhou)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14482868)
 * Hi [@craigmckee](https://wordpress.org/support/users/craigmckee/) 👋🏽
 * > OK, I’ll give it a try.
 * Sounds good, keep us posted if you find anything. We’ll be glad to help!
 * Cheers
 *  Plugin Support [B C. a11n](https://wordpress.org/support/users/battouly/)
 * (@battouly)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14509476)
 * Hey [@craigmckee](https://wordpress.org/support/users/craigmckee/),
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved.
   If you have any further questions, you can start a new thread.
 * Best!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Hide empty categories’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [B C. a11n](https://wordpress.org/support/users/battouly/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/hide-empty-categories-14/#post-14509476)
 * Status: resolved