A category with nothing to buy in it
The menu offers it and search ranks it, but nothing inside is in stock, or nothing is inside at all. Visitors hit a dead end on your own site.
The symptom
The category is in the menu, in the sidebar filter and in the sitemap. The visitor clicks it and gets “No products were found matching your selection.” Or, more often, a page full of products that all say Out of stock.
Both look the same in the admin, where the category still shows a product count. WooCommerce counts the products assigned to the category, not the ones a customer can buy.
What it costs
An empty category is a dead end you paid to send people to:
- The visit ends there. Menu, category, nothing. There is no next click on that page, so the visitor leaves.
- It ranks, and it keeps ranking. Category pages build up links and history, so an empty one can outrank the products that would have answered the search.
- It looks abandoned. Three empty categories tell a first-time visitor more about whether this store is still in business than any trust badge does.
The all-out-of-stock version costs more of the two, because the visitor scrolls the whole page before finding out.
How to check it yourself
Categories with no published products assigned directly:
wp db query "SELECT t.term_id, t.name, tt.count FROM wp_terms t \
JOIN wp_term_taxonomy tt ON tt.term_id = t.term_id \
WHERE tt.taxonomy = 'product_cat' AND tt.count = 0"
A parent category can show 0 here and still be fine, if its subcategories hold products. Merchlint counts subcategories in; this query does not.
For the stock version you need the product side too: every published product in the category whose
_stock_status is not instock:
wp db query "SELECT t.term_id, t.name, tt.count, COUNT(*) AS unavailable FROM wp_terms t \
JOIN wp_term_taxonomy tt ON tt.term_id = t.term_id \
JOIN wp_term_relationships tr ON tr.term_taxonomy_id = tt.term_taxonomy_id \
JOIN wp_posts p ON p.ID = tr.object_id AND p.post_status = 'publish' \
JOIN wp_postmeta m ON m.post_id = p.ID AND m.meta_key = '_stock_status' \
WHERE tt.taxonomy = 'product_cat' AND m.meta_value <> 'instock' \
GROUP BY t.term_id, t.name, tt.count"
When unavailable equals count, nothing in that category can be bought. Replace wp_ with your
table prefix.
How to fix it
- Decide whether the category should exist right now. If the range is discontinued, take it out of the menu, then delete the category or redirect its address to the closest live one.
- If it is temporary, keep the category but say so on the page. A category description saying the new season arrives in March is worth more than an empty grid.
- If the structure is the problem (products that belong there were assigned somewhere else), fix the assignment rather than the category.
- Check your menus separately. Deleting a category removes the menu items that point to it, but not custom links typed in as an address. Footer and mobile menus are easy to forget.
When it’s a false alarm
- Stores that sell on backorder. Merchlint counts only products marked In stock, so a category of products on backorder shows up as having nothing to buy, even if your checkout accepts the orders. Hide the finding once.
- Seasonal categories kept live on purpose between seasons, with an explanation on the page.
- Categories you never link to, used only as an internal label.
How Merchlint finds it
Merchlint goes through every product category, counts the published products in it and in all of its subcategories, and counts how many of those are marked In stock. It reports two cases separately: nothing in the category at all, and nothing in it that is in stock. A parent category with no products of its own is fine as long as its subcategories have something to sell. The default category is skipped; products stuck there are Product with no category.
Each finding names the category and shows how many products it holds with its subcategories, how many of them are in stock, and how many are assigned to the category directly. It does not check whether the category is in a menu.
Confidence: F—fact from the database. Categories, assignments and stock status are all stored values.
This check is part of the Pro add-on, which is still being prepared. The free plugin does not run it.
Install freeDoesn't match what you see in your store? Email us—we read every message. contact@merchlint.com