In short
Almost never. A product that is temporarily unavailable should keep its URL, stay indexed, state its availability honestly and offer a back-in-stock alert, because removing it discards the links, internal paths and query history the page built up. Redirect only when the product is gone for good, and send it to the closest replacement or its parent category. The feed is a separate decision: an unavailable item should be marked out of stock in Merchant Center rather than pulled out of the feed.
A temporary stockout is a merchandising problem, not an indexing one
Keep the URL if the item is coming back. A page accumulates value slowly through links, internal navigation and the queries it has learned to satisfy, and none of that survives a 404. If the product returns in six weeks to a deleted address, the page starts again from nothing.
Google's guidance has been to keep the page live and mark the product unavailable rather than remove it. A page returning a normal 200 response with a clear unavailable state still carries the product name, images, specification, price history and reviews, so it is not the empty shell that gets treated as a soft 404.
The exception is a page that never had anything to lose. A one-off variant with no sessions, no links and no chance of restocking can go quietly. Anything with history is worth keeping.
What belongs on the page while the product is away
Say plainly that the item is unavailable, and give the shopper something to do. The strongest option is a back-in-stock alert that captures an email address or phone number, because it turns a dead end into a list of people who have already chosen the product. Those alerts convert well when they fire, and the sign-up is the only thing on the page that recovers the visit.
Show alternatives that genuinely substitute: the same product in another size or colour, the newer generation, or two or three items from the same range at a similar price. A generic block of bestsellers is weaker than three considered swaps.
Keep the price visible unless it is genuinely unknown, keep the reviews and the full description, and set the availability value in your Product structured data to the out of stock state so the markup agrees with what the page says. Do not remove the markup entirely, and do not leave it claiming the item is in stock.
Discontinued products need a redirect or a farewell, not a delete
When a product is never coming back, a 301 redirect to the closest equivalent is usually the right move. Closest means a product the same shopper would accept: the successor model, the same item from the replacement supplier, or the same style in the current season. Mention the change on the destination page so the arrival makes sense.
When there is no equivalent, redirect to the parent category rather than the homepage. Google treats a mass redirect of unrelated pages to the homepage as a soft 404, so the link value you were trying to preserve is lost anyway and the shopper lands somewhere unhelpful.
There is a third option worth using on products with real traffic and links: leave the page up, state clearly that the item has been discontinued, and link to what replaced it. This suits equipment, parts and anything where people search by model number long after the product stopped being sold, because the page keeps answering the question that brought them.
The feed follows different rules from the storefront
Leave out-of-stock items in the product feed and change the availability attribute. Removing an item from the feed and adding it back later restarts the review process for that product and loses the performance history attached to the offer, whereas an item marked out of stock stays known to Merchant Center and can serve again quickly when stock returns.
The hard requirement is agreement. If the feed says in stock and the landing page says sold out, the item is liable to be disapproved for an availability mismatch, and repeated mismatches across a catalogue affect the account rather than a single product. Shopify's Google and YouTube channel syncs availability from the inventory record automatically; a custom or app-generated feed needs a fetch schedule fast enough that a sell-out is reflected within hours, not days.
One detail catches stores with back-in-stock forms: if the form replaces the buy button, make sure the price and availability microdata still render, because some setups strip the whole offer block and leave Merchant Center unable to read either value.
Turning this into a rule your catalogue can run on
Write the policy once and apply it by product type rather than deciding item by item. A workable default: seasonal and restocking items stay live and indexed with an alert form, discontinued items with a successor get a 301 to that successor, discontinued items without one keep a discontinued page if they have organic sessions or referring links in the past year and otherwise redirect to the category.
Keep live and redirected URLs out of each other's way in the sitemap. A page you are keeping stays in the sitemap; a redirected URL comes out of it at the next generation, because a sitemap full of redirects wastes crawl attention on a large catalogue.
Review the list quarterly. Pull every product with zero inventory for more than ninety days, join it to sessions, revenue and referring domains, and let the numbers decide which bucket each one belongs in. On a catalogue of any size this is the difference between a considered policy and thousands of quiet 404s nobody notices until organic revenue drifts.
Related questions
Do out-of-stock pages damage the rest of a store's rankings?
A reasonable number of them does not. The risk appears at scale, when a large share of indexed products are permanently unavailable and the site starts to look thin to a crawler and unreliable to a shopper. The fix is the redirect and discontinued-page policy applied consistently, not deleting individual pages as they sell out.
Should a sold-out product stay in the XML sitemap?
Yes, while the page is still live and returning a normal response. The sitemap should list URLs you want crawled, and a temporarily unavailable product is one of them. Remove it only when the URL starts redirecting or returning a gone status, and regenerate the sitemap on a schedule so it never fills up with URLs that no longer resolve.
Is it better to redirect a discontinued product to its category page?
Only when no single product replaces it. A redirect to a close equivalent keeps the shopper's intent intact, while a category redirect asks them to start choosing again. Redirect to the category when the range has moved on entirely, and prefer a discontinued page that links forward when the model number still attracts searches.