Eren Labs JOURNAL TR
Product Catalog

WooCommerce Product Category Count: What It Means and Why It Looks Wrong

The number next to a WooCommerce category is two numbers: the admin and the shop count different things. What each includes, why a category can show (0) and not hide, and how to hide, recount or fix it.

In this article9 sections

The WooCommerce product category count is really two numbers. In the admin, under Products → Categories, the Count column is WordPress’s own figure: published products filed directly in that category, hidden and sold-out ones included. In the shop, WooCommerce swaps in its own figure: products a customer can actually see, including those in subcategories, without hidden products, and without out-of-stock products if you hide them. When the two disagree, nothing is broken. This guide explains what each count includes, checked against WooCommerce’s own code (version 11.3.1), and how to hide the count, show or hide empty categories, and fix a count that really is stale.

You see the count in three places: the Count column of the admin category list, the “(12)” after a category name on the shop page when it shows category tiles, and the Product Categories widget when “Show product counts” is ticked. The first uses one number; the other two use the other.

What the count represents, in each place#

Every time products are saved, WooCommerce’s term counting code works out two counts for each product category and stores them in different places:

Admin count (WordPress)Shop count (WooCommerce)
Where you see itProducts → Categories, Count columnCategory tiles on the shop page, the Product Categories widget, anything on the front end that lists categories
Published productsCountedCounted
Drafts, pending, privateNot countedNot counted
Catalog visibility “Search results only” or “Hidden”CountedNot counted
Out of stockCountedCounted, unless “Hide out of stock items from the catalog” is on
Products in subcategoriesNot countedCounted, each product once

Variations are never counted separately: a T-shirt with nine variations is one product in the category. And the swap only happens on the front end. In the admin, and in admin AJAX requests, WooCommerce deliberately leaves WordPress’s number alone, which is why the two screens disagree.

Everything here applies to product tags and brands as well: WooCommerce counts all three taxonomies the same way and swaps in the shop count for each. Only categories have subcategories, so the “children included” row is the one difference: a tag’s shop count is just its own visible products.

Illustration: the admin counting every published product, the shop counting only visible, in-stock ones
The admin counts every published product filed directly in the category. The shop counts what a customer can see, subcategories included.

A worked example: 10 in the admin, 12 or 8 in the shop#

Take a Hoodies category with a Zip hoodies subcategory:

  • Hoodies holds 10 published products directly, plus 1 draft. Of the 10, 2 are set to Catalog visibility “Hidden” and 3 are out of stock.
  • Zip hoodies holds 4 published products, 1 of them out of stock. None of them is also filed under Hoodies.
CategoryAdmin countShop count, out of stock shownShop count, out of stock hidden
Hoodies1012 (8 visible + 4 from Zip hoodies)8 (5 visible and in stock + 3 from Zip hoodies)
Zip hoodies443

The draft is in neither count. The two hidden products are in the admin count only. The subcategory’s products lift the shop count of the parent, which is also why a parent category page lists products you never filed under it; our guide to a parent category not showing products covers the opposite case. A product filed under both Hoodies and Zip hoodies would count once for Hoodies, not twice.

Why a category shows (0) but won’t hide#

The two counts also decide different things. The classic Product Categories widget has a “Hide empty categories” option (off by default). It hands that job to WordPress, and WordPress decides what is empty using its own count, the admin one. The number printed beside the name, if “Show product counts” is ticked, is WooCommerce’s shop count.

So a category whose products are all hidden, or all sold out while you hide out-of-stock items, is not empty to WordPress and stays in the widget, but its shop count is 0. That is how a “(0)” survives “Hide empty categories”.

The category tiles on the shop page behave differently. WooCommerce fetches every subcategory, empty or not, then drops the ones whose shop count is 0, so a fully sold-out category disappears from the tiles while it still sits in the sidebar. And the tile only prints a count when it is above zero.

The fix is to decide what a sold-out category should be. If it should vanish everywhere, it has to be genuinely empty, meaning its products are no longer filed in it; that is what a rule-based category does on its own (see below). If it should stay, turn the widget counts off so nobody sees the zero.

How to remove the product count from categories#

In the widget: untick “Show product counts” in the Product Categories widget settings. It is off by default, so if you see counts, someone switched it on.

On the shop page category tiles: the “(12)” comes from a filter, so one line in a code snippets plugin or your child theme’s functions.php removes it:

add_filter( 'woocommerce_subcategory_count_html', '__return_empty_string' );

Hiding it with CSS (mark.count { display: none; }) works too, but the snippet stops the number from being printed at all, which also keeps it out of what search engines read. Page builders and block themes that draw their own category grids have their own “show count” switch in that element’s settings.

How to show or hide empty categories#

  • Hide empty categories in the widget: tick “Hide empty categories”. Remember it judges by the admin count, as explained above.
  • Show empty categories on the shop page: WooCommerce hides tiles whose shop count is 0 by default. To keep them, for example to show a category that is coming soon, add add_filter( 'woocommerce_product_subcategories_hide_empty', '__return_false' );.
  • Show category tiles at all: in Appearance → Customize → WooCommerce → Product Catalog, set “Shop page display” or “Category display” to show categories, or categories and products.

An empty category page itself still loads at its URL and says no products were found. If it is gone for good, redirect it to the nearest category rather than leaving a thin page indexed; our guide to changing category structure without losing rankings walks through it.

When the count is actually stale: recount terms#

WooCommerce keeps the shop count current on its own when products are saved through it. Saving the settings under WooCommerce → Settings → Products recounts every category, because the “Out of stock visibility” option there changes what the shop count includes. A product’s stock status change triggers a recount of its categories only while out-of-stock items are hidden, since otherwise it doesn’t change the number.

Counts can still drift after a large import, a direct database edit, or a plugin that changes stock or visibility without going through WooCommerce. The shop counts are also cached for up to a month. The fix is built in:

  1. Go to WooCommerce → Status → Tools.
  2. Find Term counts (“useful when changing your settings in a way which hides products from the catalog”) and press Recount terms.
  3. Clear your page cache, then check the category in a private browser window.

If the count is still “wrong” after a recount, it is almost always right by its own rules: check the product’s Catalog visibility (in the Publish box), its stock status, and whether it sits in a subcategory. The hide-out-of-stock setting has other side effects worth knowing before you rely on it; our guide on whether to hide out-of-stock products or show them last covers them.

Counts that match because membership is right#

Most count confusion comes from categories whose membership no longer matches their meaning. “Sale” still holds products that went back to full price; “In stock now” still holds products that sold out; “New arrivals” still holds last year’s range. Each of those products is still filed there, so it still counts, at least in the admin.

Keeping membership right by hand doesn’t last. The durable fix is to define such a category by rules, so products join when they match and leave when they stop matching, as our guide to rule-based categories explains. Then both counts describe the same set of products, and a category that should be empty really is.

Doing it with Smart Categories#

Smart Categories is our plugin for rule-based categories. You describe a category once, for example stock status is in stock and the product is in Hoodies, using any of 35+ fields with nested AND, OR and NOT groups, and a live preview shows what matches as you build it. Matching products are assigned, and they leave when they no longer qualify, on product changes and on a daily refresh. Each smart category is a real WooCommerce category, so its admin count and shop count are ordinary counts of products that genuinely belong.

Smart Categories rule builder with the Storefront: Sorting & Stock options for product order and out-of-stock products
Smart Categories: rules decide which products belong to a category; the Storefront options sort it and handle sold-out items for that one category, without changing who belongs.

For sold-out products there is a middle way between showing them first and hiding them shop-wide: each smart category’s storefront options can push out-of-stock products to the end of that category’s page, or hide them there, without touching which products belong. The whole rule engine is free on WordPress.org, with no cap on categories, rules or products. Smart Categories Pro, from $59 a year, adds a generator that builds subcategories per attribute (a page per colour or size) and a Category Tree page with live counts for every parent and child.

WooCommerce product category count: frequently asked questions#


In WooCommerce product categories, what does the count represent?

It depends where you look. In the admin category list, the count is the number of published products filed directly in that category, including hidden and out-of-stock ones. In the shop, WooCommerce shows the products a customer can see: published, not hidden from the catalog, not out of stock if you hide those, and including products in subcategories.


Why is my WooCommerce category count wrong?

Usually it isn’t: the admin and the shop count different things. The shop count leaves out products with catalog visibility set to hidden or search only, leaves out out-of-stock products if you hide them, and adds products from subcategories. If the count is stale after an import, use WooCommerce, Status, Tools, Recount terms.


How do I remove the product count from WooCommerce categories?

For the Product Categories widget, untick Show product counts in its settings. For the category tiles on the shop page, add the filter woocommerce_subcategory_count_html returning an empty string, for example with a code snippets plugin. Page builder and block theme category grids have their own count switch.


Why does an empty category still show in my WooCommerce sidebar?

The widget’s Hide empty categories option uses WordPress’s count, which still includes hidden and out-of-stock products. A category whose products are all hidden or sold out is therefore not empty to WordPress and stays listed, even though its shop count is zero. Remove those products from the category, or switch the counts off.


How do I show empty categories on the WooCommerce shop page?

WooCommerce removes category tiles whose shop count is zero. Add the filter woocommerce_product_subcategories_hide_empty returning false, and empty categories appear as tiles too. In the Customizer, the Product Catalog section must also be set to show categories on the shop or category pages.


More in Product Catalog

Keep exploring

All articles
Before you go Let Smart Categories do this in WooCommerce

Define the rules for a WooCommerce category once. Matching products enter automatically and leave when they no longer qualify.

Explore Smart Categories Get the free version

Free version on WordPress.org · Pro from $59/year