How to remove out of stock products in woocommerce

How to Hide Out-of-Stock Products in WooCommerce (3 Easy Methods + Fixes)

If your WooCommerce store is showing out-of-stock products, it can frustrate customers and reduce conversions. Shoppers may leave your site if they repeatedly see items they can’t buy.

The good news is you can easily hide out-of-stock products in WooCommerce without deleting them. This keeps your store clean while preserving products for future restocking.

In this guide, you’ll learn 3 easy methods to remove or hide out-of-stock products, plus advanced tips to recover lost sales.

Remove vs. Hide Out-of-Stock Products

Before you start, understand the difference. In WooCommerce, there is a big difference between these two actions:

  • Hide products → Removed from shop pages but saved for restocking
  • Delete products → Permanently removed from your database

In most cases, hiding is the better option.

Why Hide Out-of-Stock Products in WooCommerce?

Out-of-stock items can negatively impact your store in several ways:

  • Poor User Experience: Customers click products they can’t buy
  • Lower Conversion Rates: More friction = fewer purchases
  • Messy Store Layout: Too many unavailable items clutter pages
  • SEO Inefficiency: Search engines crawl non-converting pages

By hiding these products, you ensure your store stays focused and optimized.

Method 1: Hide Out-of-Stock Products in WooCommerce Settings

The simplest way to remove out-of-stock items is through WooCommerce’s built-in settings. Your stocked-out products won’t be permanently deleted; they will be just hidden. And you can make them visible anytime when your stock is updated.

Steps to hide stock-out products in Woocommerce:

Step 1: Access WooCommerce Inventory Settings:

  • Log in to your WordPress admin dashboard.
  • Navigate to WooCommerce > Settings > Products > Inventory tab.
Access WooCommerce Inventory Settings

Step 2: Enable Stock Management

  • Ensure the “Enable stock management” option is checked.
  • Check the box of Enable out of stock notifications to get alerts when your products are stocked out from your Woocommerce store.
Enable Stock Management

Step 3: Hide out of stock products in Woocommerce

  • Scroll down to check the option “Hide out-of-stock items from the catalog.”
  • Save the changes.
Hide out of stock products

What happens next? 

Products will automatically disappear from your Shop page, Category pages, and Search results. They will automatically reappear the moment you update your stock levels.

Method 2: Manually Remove Out-of-Stock Products in Woocommerce

If you prefer to remove specific out-of-stock products from your Woocommerce, follow these steps:

Step 1: Go to Your Woocommerce Product List

  • From the WordPress dashboard, navigate to Products > All Products.
Go to Your woocommerce Product List:

Step 2: Filter Out-of-Stock Items:

  • Go to the Filter by stock status and click on out-of-stock option.
  • Then, hit on Filter.
Filter Out-of-Stock Items

Step 3: Delete stock-out Products

  • Select the items you want to remove. To bulk remove all the stock-out products, check the first box to select altogether.
  • In the bulk actions dropdown, select move to trash.
  • Hit Apply to save the changes.
Delete stock-out Products

So, your stock-out products are removed from your Woocommerce store.

How to Hide Out-of-Stock Products in WooCommerce (3 Easy Methods + Fixes) - AD 4nXd8ghSMrRyFkuZ1WkMVmK47vzW6pK uJazVIIA2JwDlsa9a6Vqkc66YtatDFsey1jZeEqWxu49iwFo7VVKhqKSON3O1W w7 EtxvRC36rs6 9NkAOShAarrr4nnKV94hnzCJytsqA?key=pP lHJEqjM1hBg6AR8WI9ivK

Note: This permanently removes products unless they are restored from the trash.

Method 3: Remove Out-of-Stock Products in WooCommerce Programmatically

If you prefer a hands-on approach or want more control over how out-of-stock products are managed, removing them programmatically is an excellent option. This method involves adding custom code to your WooCommerce store, which automatically hides or removes out-of-stock products from the shop and catalog pages.

Step-by-Step Guide to Remove Out-of-Stock Products Programmatically

Step 1: Access the Theme File Editor

  • In your WordPress dashboard, navigate to Appearance > Theme File Editor.
  • Open the functions.php file of your active theme.

Step 2: Add the Custom Code

  • Copy and paste the following code snippet into the functions.php file:
// Remove out-of-stock products from WooCommerce shop and catalog

add_action('pre_get_posts', 'hide_out_of_stock_products');

function hide_out_of_stock_products($query) {

    if (!is_admin() && $query->is_main_query() && (is_shop() || is_product_category() || is_product_tag())) {

        $meta_query = $query->get('meta_query');

        if (!is_array($meta_query)) {

            $meta_query = [];

        }

        $meta_query[] = [

            'key' => '_stock_status',

            'value' => 'outofstock',

            'compare' => '!='

        ];

        $query->set('meta_query', $meta_query);

    }

}

Step 3: Save the Changes

  • After pasting the code, click Update File to save your changes.
remove out of stock products with custom code

Step 4: Test the Functionality

  • Visit your shop or category pages to confirm that out-of-stock products are no longer visible.
  • Update a product’s stock status to “Out of Stock” and refresh the page to ensure it is removed.

Why use this?

It allows you to customize visibility rules beyond the “all or nothing” default setting.

Developer Tip: To check stock status manually in custom templates, use the is_in_stock() method: if ( $product->is_in_stock() ) { ... }. It is much faster than querying metadata.

How to Change “Out of Stock” Text in WooCommerce?

Instead of hiding products, you can improve user experience by customizing the message:

add_filter('woocommerce_get_availability_text', function($text, $product) {
    if (!$product->is_in_stock()) {
        return 'Back Soon – Stay Tuned!';
    }
    return $text;
}, 10, 2);

This keeps users engaged and reduces bounce rates.

Strategy: Recover Sales from Out-of-Stock Items

This is where you can beat your competitors. Instead of just removing a product, use these strategies to turn a “Sold Out” sign into a sale:

Enable Backorders

Go to Product Data > Inventory and set Allow Backorders to “Allow, but notify customer.” This lets you take the money now and ship as soon as stock arrives.

Waitlist Plugins

Use tools like WooCommerce Product Stock Alert. This replaces the “Out of Stock” button with an email signup, allowing you to notify customers the second you restock.

You can also improve inventory control using a WooCommerce Stock Management Plugin to automate stock tracking, reduce manual updates, and keep product availability accurate across your store.

Troubleshooting: “Hide Out-of-Stock Option Not Showing”

If you find that the setting is missing or not working, it is likely due to one of the following:

  1. Global Stock Disabled: Ensure “Enable stock management” is checked at the top of the Inventory page.
  2. Theme Overrides: Some premium themes override WooCommerce visibility settings. Check your Theme Settings.
  3. Plugin Conflicts: Cache plugins or third-party inventory managers may keep the “Out of Stock” items visible. Clear your site cache.

Frequently Asked Questions

How do I hide out-of-stock products in WooCommerce without deleting them?

Go to WooCommerce → Settings → Products → Inventory and enable the option “Hide out-of-stock items from the catalog.” This removes products from your shop pages without deleting them.

Why can’t I see the “hide out-of-stock” option in WooCommerce?

This usually happens when stock management is disabled. Make sure “Enable stock management” is turned on. Also check for theme overrides or plugin conflicts.

How do I remove out-of-stock products in WooCommerce completely?

Go to Products → All Products, filter by Out of Stock, then use Bulk Actions → Move to Trash to delete them permanently.

How do I change the “Out of Stock” text in WooCommerce?

You can customize the message using a code snippet or plugin. For example, you can replace it with “Back Soon” to keep customers engaged.

Should I hide or show out-of-stock products in WooCommerce?

1. Hide them → improves user experience and conversions
2. Show them → useful if you offer backorders or want to capture demand

Can I hide out-of-stock products only in related products?

Yes, you can use custom code or filters to exclude out-of-stock items from related products while keeping them visible elsewhere.

Why are out-of-stock products still showing in my store?

This may be caused by:
1. Caching issues
2. Theme overrides
3. Incorrect stock settings
Try clearing your cache and double-checking your inventory configuration.

How do I get notified when a product goes out of stock?

Go to WooCommerce → Settings → Products → Inventory and enable out-of-stock notifications to receive alerts.

Can I allow customers to buy out-of-stock products?

Yes, enable backorders in the product settings. This allows customers to place orders even when items are out of stock.

Conclusion

Hiding out-of-stock products in WooCommerce helps you maintain a clean, user-friendly store while improving conversions. Whether you use built-in settings, manual removal, or custom code, each method gives you better control over your inventory display.

For best results, combine product visibility control with sales recovery strategies so you never lose potential customers.

Leave a Reply

8,286,250+ Downloads. 719+ plus 5-star ratings. Promote products on any platform you want.