Discontinued Products: When to Use 301 Redirects vs 404
Out of stock, discontinued or replaced? Learn when to keep the page, 301 redirect it or return a 404, plus how to set up redirects on Shopify.
When a product is discontinued, the right move depends on whether it is coming back and whether you have a replacement. Only out of stock: keep the page live and mark it unavailable. Gone for good with a close replacement: 301 redirect to that product or the most relevant collection. Nothing similar: let the URL return a 404 or 410. Avoid redirecting every removed product to your homepage; Google may treat those as soft 404s.
Should you remove a page when a product is out of stock?
No. If the product will be restocked, keeping the page is usually best:
- The page stays indexed, so you do not have to rebuild rankings after restocking.
- Say clearly that it is out of stock, give an expected date if you have one, and offer a back-in-stock alert.
- Make sure the
availabilityvalue in your Product structured data says out of stock. Most Shopify themes output this automatically from inventory; check your theme to be sure.
Deleting a product and recreating it later can change its URL, and you may lose backlinks and rankings in the process.
Discontinued for good: 301, 404 or 410?
| Situation | What to do | Why |
|---|---|---|
| Direct replacement (new version, same item in a new color) | 301 to the replacement | Shoppers land on what they wanted; signals pass to the new page |
| No direct replacement, but similar products | 301 to the relevant collection | Shoppers can still browse the category |
| Nothing related at all | Return 404 or 410 | Tells search engines honestly that the page is gone |
| Temporarily out of stock | Keep the page | See the section above |
On 404 vs 410: Google says both eventually drop the page from the index; 410 may be slightly faster, but the difference is small, so a 404 is fine for most stores. Make your 404 page useful, with a search box and links to popular collections.
Why not redirect everything to the homepage?
A shopper who clicks a specific product and lands on the homepage is about as lost as one who sees a 404, and more confused. Google may also treat redirects to irrelevant pages as soft 404s, so the trick does not keep your rankings. The rule: redirect only to genuinely similar pages; otherwise return a 404.
How do you set up 301 redirects on Shopify?
- When you change a product handle: Shopify offers a "create a URL redirect" option on save. Keep it ticked and the 301 is created for you.
- Manually: use the URL redirects feature in your admin and enter the old path and the new path. Shopify has moved this menu before, so if you cannot find it, search "redirects" in the admin search bar and follow the official Help Center.
- In bulk: URL redirects can be imported from a CSV file, which helps when you retire many products at once.
One catch: Shopify URL redirects only take effect when the old URL no longer loads (returns a 404). Deleting the product, setting it to draft or unpublishing it from the Online Store channel makes the old URL 404, so the redirect then works.
How do you check you got it right?
- Open the old URL in a browser and confirm it lands on the intended page in one hop. Avoid redirect chains: change A to B to C into a direct A to C.
- Update any menus, collections or blog posts that still link to the old URL.
- After a few weeks, open the Pages report in Google Search Console and review "Not found (404)", "Soft 404" and "Page with redirect" for anything unexpected.
For more pitfalls, see 10 common SEO mistakes online stores make.
FAQ
How long should I keep a 301 redirect?
Ideally for good. Google recommends keeping redirects for at least a year, but old URLs live on in other sites, bookmarks and emails, so keeping them longer helps shoppers.
Will lots of removed products hurt my whole site?
Normal 404s do not trigger a sitewide penalty. What matters is old URLs that had backlinks or rankings: redirect those to a relevant page so the signals are not wasted.
What about seasonal products I sell every year?
Keep the same URL year round. Mark it out of stock off-season or note when it returns, instead of deleting and recreating it each year.