How to hide out-of-stock products from WooCommerce search and shop pages

If your WooCommerce store is showing out-of-stock or previously sold products in search results or shop pages, it can lead to serious issues like customers attempting to purchase unavailable items and confusion across your catalog.

This issue often appears after migrations or configuration changes—but the fix is usually simple once identified.

Issue Background

A WooCommerce store began displaying:

  • Out-of-stock products in search results
  • Old inventory appearing in shop pages
  • Large amounts of outdated products visible to users

This created a major issue where customers could attempt to purchase items that were no longer available.

Diagnosis

The issue was traced to a key WooCommerce setting:

“Hide out of stock items from the catalog” was disabled

When this setting is turned off:

  • Out-of-stock products remain visible in shop pages
  • They appear in search results
  • They show in category listings

Even if inventory is set to zero, WooCommerce will still display these products unless this setting is enabled.

Resolution Steps

1. Enable hiding out-of-stock products

Go to:

WooCommerce → Settings → Products → Inventory

Then:

  • Check “Hide out of stock items from the catalog”
  • Save changes

2. Verify product inventory settings

  • Enable stock management per product
  • Set stock quantity correctly (0 for sold items)
  • Ensure stock status updates properly

3. Test storefront behavior

  • Search for previously visible products
  • Check shop and category pages
  • Confirm only in-stock items are displayed

4. Clean up legacy products (optional)

  • Move outdated products to trash
  • Or archive them for better organization

This improves performance and search relevance.

5. Review product management workflow

  • Avoid leaving stock values empty (can imply unlimited stock)
  • Double-check inventory settings when duplicating products

Final Outcome

  • Out-of-stock products are removed from search and shop pages
  • Customers no longer see unavailable items
  • Accidental purchases are prevented
  • Product listings are cleaner and more accurate

Need help fixing WooCommerce inventory or visibility issues?

If your store is showing incorrect products or outdated inventory, Freshy can help diagnose and implement the right solution.

Contact Freshy