Out-of-stock products on Shopify: hide, keep or redirect them without losing Google rankings
Nico Bértolo · 2026-11-27
In short
- If the product is coming back, keep the page live with a clear "Sold out" and a restock alert, and pull it from collections with the condition "Inventory stock is greater than 0".
- If it isn’t, set it to draft and redirect its URL to the closest product or its collection. Shopify only redirects URLs that are already broken, so draft comes first.
- Unpublishing with the Flow template leaves the URL on a 404: Google stops using it and the page loses its place when you restock.
What to do with out-of-stock products on Shopify comes down to one question: is it coming back? If it is, the product page stays live, with the sold-out state clearly visible and a way forward for the shopper, and what you remove is its spot in collections. If it isn’t, set it to draft and redirect its URL to whatever is closest. Right after Black Friday is when stores have the most greyed-out products, and when it’s easiest to make the wrong call with one click.
What should I do with an out-of-stock product on Shopify?
Three cases, three answers:
- Temporarily sold out (back in weeks): keep the page live, show "Sold out" or "Notify me when it’s back", and remove it from collections or push it to the end.
- Back on a known date and you want to take payment now: keep selling without stock as a backorder or pre-order, with the date written on the page.
- Discontinued (not coming back): set to draft and 301 redirect to the closest replacement. If there isn’t one, to its collection.
What we’d never do: delete the product without a redirect, or send everything to the homepage. Someone arriving from Google or an old link was looking for that bag, not your home page.
Why not unpublish sold-out products with Shopify Flow?
Because unpublishing isn’t hiding. Shopify’s help offers a Flow template, "Publish and unpublish products based on inventory level", that unpublishes the product when its inventory changes and republishes it on restock. Convenient. But a product that isn’t available on the online store has no page: its URL returns a 404.
Google explains it in its documentation on status codes: it doesn’t use content from URLs that return a 4xx, already-indexed URLs are removed from the index over time and crawled less and less. So if a product page that brought in traffic spends December on a 404, it’s republished in January but Google has to rediscover it. For a store that restocks every few weeks, that means dropping in and out of Google all year.
A sold-out product page that stays live is still working: it brings in visits, collects sign-ups and links to what you do have.
Nico Bértolo, 224
How do I hide sold-out products from collections without deleting the page?
With a condition on automated collections. It’s the method Shopify documents and it doesn’t touch the product URL:
- Turn on inventory tracking for your products.
- In each automated collection add the condition "Inventory stock" "is greater than" 0, with "all conditions" selected. It doesn’t work with "any condition".
- For the default catalog (/collections/all), Shopify suggests replacing it with your own collection using the same condition.
- Products return to the collection on their own when you receive stock.
If you’d rather show sold-out items at the end (it helps in fashion: shoppers see the style exists and sign up for the alert), Shopify doesn’t do it out of the box: you need a sorting app. Either way, the product page stays live for Google and for anyone arriving directly.
Discontinued product: how to set up a 301 redirect on Shopify
The detail almost nobody knows: Shopify only redirects broken URLs. Its help puts it plainly: if the URL still loads a valid page, the redirect won’t work. That’s why the order matters.
- Set the product to draft: Or remove it from every sales channel. From then on its URL returns a 404 and can be redirected.
- Pick the destination: The same style in another colour, its newer version or, failing that, the collection it came from. The homepage only if nothing similar is left.
- Create the redirect: Content > Menus > View URL redirects > Create URL redirect. "Redirect from" the old path (/products/christmas-bag) and "Redirect to" the new one. It works immediately.
- If there are many, use CSV: On the same screen, Import: one row per URL with source and target. Shopify allows up to 100,000 redirects (20 million on Plus).
- Check it: Open the old URL in a private window and make sure it lands where it should. Then remove the product from menus and homepage sections so you’re not linking to a redirect.
To automate it, Flow has a "Create redirect URL" action (source path, target and whether to overwrite an existing redirect). Shopify’s own help warns that if the product had a custom handle, the workflow may not work: check the first few by hand.
What if there’s nothing similar? Google has no hard rule. John Mueller of Google summed it up in 2016: do what works best for the user, which is sometimes a redirect and sometimes a helpful 404 page. We redirect when there’s a destination the shopper would accept as an answer, and keep the 404 (with search and collections in view) when there isn’t.
What about Google Shopping and structured data?
Merchant Center accepts four availability values: in_stock, out_of_stock, preorder and backorder. Whatever you say in the feed must match the product page: for a sold-out item a clear "Sold out" or a disabled buy button is enough. If they don’t match, Google disapproves the product.
- Temporarily sold out: out_of_stock. Google asks you not to delete the item from the feed; to hide it for a few days, use pause (up to 14 days) or exclude the destination.
- You sell without stock and restock on a date: backorder, with availability_date and that date visible on the page. Preorder is only for new products not yet released.
- Discontinued: Google says to delete it from the data source, not leave it on out_of_stock forever.
Product structured data on your site works the same way: the offer carries its availability (InStock, OutOfStock, BackOrder, PreOrder, Discontinued…). Most themes fill it in from inventory, but it’s worth running a sold-out product page through the Rich Results Test and checking it doesn’t say InStock.
An example: 40 sold-out products after Black Friday
Take a handbag brand with 180 products that has 40 greyed out on Monday. Here’s how we’d split them:
- 30: back in January: page live, restock alert and out of collections
- 6: were the Christmas edition: draft and 301 to the closest style
- 4: discontinued colours: 301 to the same bag in another colour
On the 30 that are coming back, the page swaps the buy button for a back-in-stock alert and shows two similar bags that are available underneath. That sign-up list also tells you what to restock first.
What I’d do this week
- Export products with inventory at 0 or below and tag each one: coming back, coming back on a date, or not coming back.
- If the Flow template that unpublishes by inventory is on, turn it off and use the stock condition on collections instead.
- Set the ones that aren’t coming back to draft and upload their redirects in a single CSV.
- Check the Pages report in Search Console for new product-page 404s over the last month.
- Check in Merchant Center that sold-out items show as out_of_stock, not disapproved.
Half your store showing "Sold out"? We review your catalogue and tell you what to keep, what to hide and what to redirect. Book a call
Sources
- Hiding out of stock products · Shopify Help Center (documentación oficial)
- Creating and managing URL redirects · Shopify Help Center (documentación oficial)
- Create redirect URL (Shopify Flow) · Shopify Help Center (documentación oficial)
- How HTTP status codes, and network and DNS errors affect Google Search · Google Search Central
- Availability [availability] · Google Merchant Center Help
- Merchant listing (Product, Offer) structured data · Google Search Central
- Google's John Mueller On Redirecting vs 404ing Products That No Longer Exist · Search Engine Roundtable
Frequently asked questions
Are out-of-stock products bad for SEO on Shopify?
No, as long as the page stays live and clearly says it’s sold out. What hurts is the URL returning a 404 every time it sells out and coming back on restock.
How do I hide out-of-stock products on Shopify?
In each automated collection, add the condition "Inventory stock is greater than 0" with "all conditions". The product disappears from the collection but its page stays live.
Why isn’t my Shopify redirect working?
Because Shopify only redirects URLs that no longer load. If the product is still published, set it to draft or remove it from all channels and the redirect will start working.
Should I redirect a discontinued product to the homepage?
Better not. Redirect to the closest product or its collection; if nothing answers what the shopper was looking for, a helpful 404 with search beats the homepage.
What availability should I use in Google Merchant Center for a sold-out product?
out_of_stock if it’s temporary (without deleting it from the feed) and backorder if you keep selling with a restock date visible on the page. If it’s discontinued, delete it from the data source.