How to Remove Out of Stock Products from WooCommerce Product Feeds
Imagine a customer found your product on a different platform and ready to buy but finds out itโs out of stock when landed on your WooCommerce store. It’s not just an Ouch moment, they will never likely to return to your store.
According to studies, out-of-stock products result in a 40% loss in sales for eCommerce stores. When your Google Shopping or Facebook product feed files still lists items you canโt actually sell, every ad dollar spent on those listings is effectively thrown away.
Product feeds are structured data filesโoften in XML or CSV formatโthat tell platforms like Google Merchant Center, Facebook Ads, or priceโcomparison sites exactly which products you have, what they cost, and whether theyโre in stock. They serve as the backbone of many eCommerce advertising platforms and ensure your ads match real-time inventory.
But when out-of-stock products slip into your feeds, three major issues arise: wasted ad spend, frustrated customers, and damaged brand trust. Visitors clicking through to soldโout pages face disappointment, and worse, theyโre lost to rivals who actually have their desired item.
In this guide, youโll learn stepโbyโstep how to remove out of stock products from WooCommerce product feedsโusing both builtโin settings and powerful feedโmanagement toolsโso your ads target only what you can fulfill and every marketing baht drives genuine sales.
Letโs jump right into the solution.
How to Remove Out of Stock Products from WooCommerce Product Feeds?
The most effective method for generating a data feed and connecting to various platforms is to utilize a dedicated product feed plugin. They also come with features like excluding out-of-stock items from the product feed with just a single click.
Why Plugins Are Essential
Managing product feeds manually is time-consuming and error-prone, especially when your stock levels change by the minute. A dedicated productโfeed plugin automates the entire workflow and ensures your feeds always reflect real-time inventory without you lifting a finger.
With advanced filtering rules, you can remove out-of-stock products from the WooCommerce feed, target specific categories or custom fields, and fine-tune your feed for each channelโs requirements. Plus, many plugins include platform-specific optimizationsโlike Googleโs required attributes or Facebookโs catalog rules, so you can publish compliant feeds in one click and avoid disapprovals.
Key Features to Look For
- Oneโclick exclusion of outโofโstock items (โRemove Out of Stock Products?โ toggle)
- Advanced filtering by stock quantity, categories, tags, or custom fields
- Automatic scheduling to regenerate feeds at set intervals, so sold-out items never linger
- Multi-format support (XML, CSV, TSV, JSON, XLS) to cover Google Shopping, Facebook Ads, priceโcomparison sites, and more
According to the above requirements, one plugin checks all; the market leader, CTX Feed. Let us walk you through how to remove out of stock products from WooCommerce product feeds using this plugin.
How to Remove Out of Stock Products from WooCommerce Product Feeds Using a Plugin?
Here are the steps.
1. Install & Activate CTXโฏFeed Pro
You will need the pro version for removing out of stock products. However, both the free and pro version needs to be installed and activated.
- Go to Plugins > Add Plugin.
- Search, install, and activate the CTX Feed free version.
- Again, go to Plugins > Add Plugin and click on Upload Plugin.
- Upload the pro version zip file and activate.
2. Create or Edit Your Feed
- Navigate to CTXโฏFeed > Manage Feeds.
- Either click New Feedto create a feed for a platform (Google, Facebook, etc.) or click Edit to modify an existing feed.
3. Set Up Basic Feed Details
- Choose your Feed Template(e.g., Google Shopping). This will automatically populate necessary attributes.
- Name your feed (e.g., โGoogle Shopping Feedโ).
- Select the File Typefrom the dedicated dropdown.
Map & Customize Attributes
- Review the Feed Config section to ensure required fields (ID, Title, Price, Stock Status) are correctly assigned.
- Add any custom fields or dynamic values as needed for your chosen channel.
4. Configure Exclusion Filters
- Switch to the Filters tab.
- Remove Out Of Stock Products? โ Select Yes
- This tells CTXโฏFeed to automatically exclude any product whose WooCommerce Stock Status is โoutofstock.โ
- Include Hidden Products? โ No
- This ensures products set to โHiddenโ under WooCommerce โบ Settings โบ Products โบ Inventory โบ Hide out of stock items from the catalog are also omitted.
- (Optional) Include Hidden Products for Special Campaigns
- If you run a private or membersโonly collection thatโs hidden from your storefront but should appear in a specific feed:
- Include Hidden Products? โ Yes
- Add a Category or Tag filter:
- Taxonomy: Category (or Tag)
- Condition: IN
- Value: your_special_collection_slug
- Now only items in that category/tag will flow into this feed, even though theyโre hidden on your main site.
- If you run a private or membersโonly collection thatโs hidden from your storefront but should appear in a specific feed:
5. Configure Scheduling
- From Manage Feeds, you can set Update Interval (e.g., 1 Hour โ checks your store every hour for changes and updates the feed) so the feed automatically regenerates and always reflects current stock.
6. Preview, Test & Publish
- Under Manage Feeds, click the gear icon and View to inspect the first 50 linesโconfirm no โout of stockโ or hidden items appear.
- If everything looks correct, use the Download button or copy the Feed URL.
- Submit this URL to your platform (e.g., Google Merchant Center, Facebook Business Manager).
By following these detailed CTXโฏFeed steps, you ensure that every time your feed runs, only in-stock and appropriately visible products are included, maximizing ad efficiency and maintaining a flawless shopping experience. This is how you disable out-of-stock products in Google Merchant Center in the quickest way as well.
Plugins like CTX Feed also help in troubleshooting feed errors from different platforms, such as Google Merchant Center, Meta Commerce Manager, etc.
How to Remove Out of Stock Products from WooCommerce Product Feeds Using Native Settings?
You can combine some core WooCommerce settings with any of the official Google Shopping or Facebook WooCommerce integration plugins to filter out-of-stock products from the WooCommerce feed.
Hereโs how you can do it.
- Navigate to the Inventory Settings
- From your WordPress admin panel, go to WooCommerce > Settings > Products > Inventory.
- Enable โHide out of stock items from the catalogโ
- Check the box labeled Out of stock visibility (โHide out of stock items from the catalogโ).
- Click Save Changes to apply.
- How It Affects Your Storefront
- Any product whose Stock Status is set to โout of stockโ now becomes hidden rather than โpublished.โ
- These items vanish from shop pages, category archives, and search resultsโcleaning up your customerโs browsing experience.
- Impact on Basic Feeds
- Simple exports that pull only โpublished + visibleโ products (for example, WooCommerceโs built-in Google Product Feed plugin) will automatically exclude these hidden posts.
- No extra steps are needed if you rely solely on those basic feeds.
- Why This Alone Isnโt Enough
- Advanced feed plugins (CTXโฏFeed Pro, ProductโฏFeedโฏPro, WPโฏMarketingโฏRobot, etc.) often maintain their own visibility logic: they may still include hidden products unless you explicitly disable them in the pluginโs settings.
- Variation quirks: By default, WooCommerce considers a parent productโs stock status. If a parent is โin stockโ but all its variations sell out, the parent can still appear, even though no variant is purchasable.
- Prerequisite: You must have Manage stock enabled on each product. Otherwise, the โhideโ toggle doesnโt do anything.
Drawbacks of Relying Solely on Native Settings
- Inconsistent Feed Behavior
Unless your feed tool honors WooCommerceโs catalogโvisibility, hidden items can sneak back into your XML/CSV exports. - Limited Control
You canโt target custom rules (e.g., exclude by category or tag) or schedule automatic removals beyond the once-off โhideโ toggle. - Variation Oversights
Parent products may remain visible even if none of their child variations are in stock, which can confuse customers who click through and find nothing to buy. - Plugin Conflicts & User Frustration
Reports on support forums note that some feed plugins ignore this core setting or introduce bugs, leading to wasted ad spend, feed errors, and extra troubleshooting.
Because of these limitations, the native โhideโ option is a useful first step, but not a complete solution for keeping your product feeds clean and efficient.
How to Remove Out of Stock Products from WooCommerce Product Feeds Implementing Custom Code?
Disclaimer: Customizing your site with code requires comfort in PHP and WordPress development. Always work in a child theme, keep a recent backup, and test on a staging environment before touching your live store.
When to Consider Custom Code
- Unique filtering needs: You want to exclude products based on complex rules (e.g., a combination of stock status, custom fields, or thirdโparty API data) that no plugin can express.
- Performance optimizations: You need a lightweight solution without the overhead of an extra plugin.
- Full control: Youโd rather hook directly into WooCommerceโs query process than rely on another toolโs interface.
Stepโฏ1: Prepare Your Environment
- Create (or verify) your child theme so that customizations survive theme updates.
- Enable debugging in wp-config.php (set WP_DEBUG to true) to catch any PHP errors immediately.
- Backup your site (filesโฏ+โฏdatabase)โthis gives you a restore point if anything goes wrong.
Stepโฏ2: Hook into WooCommerceโs Query Process
WooCommerce product feeds use internal WordPress queries (WP_Query) to gather products. The pre_get_posts action fires just before any query runs, letting us alter its parameters.
Stepโฏ3: Add Your Custom Filter Function
- In your child themeโs functions.php, append a new function.
- Name the function something unique, like exclude_outofstock_from_feed.
- Hook it to pre_get_posts.
Stepโฏ4: Detect the Feed Context
Inside your function, first ensure youโre modifying only the feed you care about (so you donโt hide products everywhere):
- Use is_feed() to check for any RSS/XML feed.
- If you have a custom feed URL (e.g., for Google or Facebook), also check $_GET[‘feed’] or URL path segments.
Stepโฏ5: Inject the StockโStatus Filter
- Retrieve the existing meta_query array from $query->get(‘meta_query’).
- Append a clause excluding outโofโstock items:
[
'key' => '_stock_status',
'value' => 'outofstock',
'compare' => '!=',
]
- Set the modified meta_query back onto the $query object.
This ensures that any product whose _stock_status equals โoutofstockโ is left out of the results.
Stepโฏ6: Full Example (Illustrative)
add_action( 'pre_get_posts', 'exclude_outofstock_from_feed' );
function exclude_outofstock_from_feed( $query ) {
// Only modify frontend feeds, not admin
if ( is_admin() || ! $query->is_main_query() || ! is_feed() ) {
return;
}
// Optionally: target a specific feed name or URL pattern
// if ( ! isset( $_GET['feed'] ) || $_GET['feed'] !== 'google' ) { return; }
// Get existing meta queries (if any)
$meta_query = (array) $query->get( 'meta_query' );
// Add our stock-status filter
$meta_query[] = [
'key' => '_stock_status',
'value' => 'outofstock',
'compare' => '!=',
];
// Apply the modified meta_query
$query->set( 'meta_query', $meta_query );
}
Stepโฏ7: Test & Verify
- Regenerate your feed URL (or view your RSS/XML).
- Search for any “outofstock” entriesโthere should be none.
- Spotโcheck a few inโstock products to confirm theyโre still present.
Key Takeaways
- This code runs before WooCommerce builds its product list, so outโofโstock items never even enter the feed.
- Because itโs a global hook, be precise with your is_feed() (and optional $_GET[‘feed’]) checks to avoid hiding products elsewhere.
- Maintain this snippet in version control and document its purposeโfuture you (or another developer) will thank you.
By following these steps, you gain complete control over which products appear in your WooCommerce feedsโwithout relying on thirdโparty plugin settings.
Best Practices and Advanced Considerations
Keeping your product feeds clean is only half the battle. Following these best practices can make sure you stay ahead of inventory issues and maintain peak ad performance.
Regular Feed Updates
Aim to regenerate or sync your feed at least once a day, more often if stock levels shift rapidly.
Google Merchant Center requires daily uploads for local feeds to reflect pricing and availability changes accurately. For global feeds, consider incremental updates every 24โฏhours at a time when your stock data is most stable (e.g., overnight).
Thorough Feed Testing
After each update, download your XML/CSV and search for any โoutofstockโ entries to verify theyโre truly gone. Then, check your platformโs Diagnostics or Needs Attention tab in Merchant Center, this will flag any remaining availability mismatches or feed errors.
Handling Product Variations
Variable products add complexity: if a parent product remains โin stockโ while all of its child variations sell out, the parent may still appear in your feed. Plugins like CTX Feed automatically exclude soldโout variations; others require explicit filters by the _stock_status meta key on each variation. Always spotโcheck variation listings in your preview to ensure no ghost items slip through.
Temporary vs. Permanent Stockouts
Restockable items: For products youโll replenish, consider backโinโstock notifications or a preโorder label rather than outright exclusionโthis keeps users engaged and reduces lostโsale risk.
Discontinued items: If an item will never return, implement a 301 redirect from its product page to a relevant alternative or archive it completely. This preserves SEO value and prevents 404 errors.
Monitoring Performance
Track key metrics – click-through rate, conversion rate, and return on ad spend, both before and after you enforce stock filters. Use Google Analytics or your ad platformโs reporting to spot dips that might indicate over-filtering or missing inventory opportunities.
Understanding Feed Diagnostics
Google Merchant Centerโs Diagnostics section offers granular insights: it lists errors (e.g., mismatched availability), warnings, and notifications at the product and feed levels. Addressing these promptly keeps your feed healthy and prevents disapprovals that waste ad spend.
By updating feeds regularly, rigorously testing exclusions, and tailoring your approach to both simple and variable products, youโll ensure your campaigns run lean and only promote whatโs truly available.
Wrap Up
There you go, now you know all about how to remove out of stock products from WooCommerce product feeds.
To wrap it up, itโs pretty evident you cannot keep your out of stock products in your feed files. Otherwise, customers will continue to be frustrated, leave you forever, and jump to your competitors.
So, in a way, you are feeding your competitors by allowing these mistakes on your feeds. Therefore, without any further ado, fix your feed files immediately and watch your sales grow.