How to Fix 404 Errors and Broken Links on Shopify
Shopify stores pick up 404 errors in predictable ways. A product is deleted when it sells out, a handle is changed to tidy up a name, a collection is merged, or a store moves over from another platform with different addresses. Every old address that people, search engines and other sites still use then lands on the not found page. Shopify gives you good tools to fix this, but it does not create every redirect for you, and its redirects only work in certain conditions. This guide shows how to find the 404s and broken links in your store, how to redirect them one at a time or in bulk with a CSV file, and how to fix links inside your theme and content.
- Why Shopify stores get 404 errors
- The common causes in a Shopify store
- How to find 404s and broken links in your store
- Fixing 404s with Shopify URL redirects
- Bulk redirects with a CSV file
- Fixing broken links in your theme and content
- The fix, step by step
- Edge cases worth knowing
- Keeping your Shopify store free of 404s
- Questions and answers
Why Shopify stores get 404 errors
A 404 means the store has no page at the address requested. Shopify builds addresses from fixed prefixes plus a handle, the short text name of each item:
| Content | Address pattern |
|---|---|
| Product | /products/lemon-drizzle-cake |
| Collection | /collections/birthday-cakes |
| Product in a collection | /collections/birthday-cakes/products/lemon-drizzle-cake |
| Page | /pages/delivery |
| Blog post | /blogs/news/summer-menu |
Change the handle, or remove the item, and the old address stops working. Not every 404 needs fixing. Random bot requests and mistyped addresses can be ignored. The ones that matter are addresses that used to be real pages, especially those with visits, links from other websites or a place in Google results. Losing those means lost sales and lost link value.
A 404 is also the honest answer for something that never existed. Shopify serves your theme's 404 template with a correct 404 status, so the aim is not to hide every 404, but to redirect the ones that have an obvious new home and fix any links on your own store that point to missing pages. The 404 errors guide covers the general principles.
The common causes in a Shopify store
| Cause | Does Shopify redirect automatically? | Fix |
|---|---|---|
| Product handle changed | Yes, if the redirect box stays ticked when you save | Check the redirect exists; add it if the box was cleared |
| Product deleted | No | Redirect to the replacement or the closest collection |
| Product set to draft or archived | No, it returns 404 on the storefront | Republish it, or redirect if it will not return |
| Collection renamed or deleted | Only for handle changes with the box ticked | Redirect the old collection address |
| Page or blog post removed | No | Redirect to the nearest equivalent |
| Moved from another platform | No | Bulk import redirects from old addresses |
| Hard-coded link in theme or content | Not applicable | Edit the link itself |
The most common surprise is the deleted product. Shop owners delete items that have sold out or been discontinued, and every link to them breaks at once, including links in old emails, social posts and Google Shopping history. For seasonal or temporarily unavailable products, keep the product live and mark it out of stock instead. It keeps its address and any search ranking it has earned.
After a move from WooCommerce, Magento or another platform, the old addresses usually had a different shape, such as /product/lemon-drizzle-cake/ or /cakes/lemon-drizzle.html. None of them exist on Shopify. The Shopify migration guide covers mapping old addresses before you switch.
How to find 404s and broken links in your store
Use three sources, because each one sees a different set of problems.
Google Search Console
Open the Page indexing report and select the Not found (404) reason. It lists addresses Googlebot tried that returned 404, which usually means they were once linked or indexed. Export the list. It may include some old junk, so sort out the real former pages first.
A crawl of your store
A crawler follows every link on your storefront and reports any that lead to a 404. These are broken links you control: menu items, buttons, links in product descriptions, blog posts and theme sections. Run the site crawler and filter for internal links with a 404 status, noting the page each link sits on.
Old address lists
If you moved platform, export the old sitemap or product list from the previous system, or take it from a backup. Then test each address on the live store:
while read path; do
code=$(curl -s -o /dev/null -w "%{http_code}" "https://www.example.com$path")
echo "$code $path"
done < old-paths.txt | grep '^404'
That prints every old path still returning 404, ready to map. Links from other websites to missing products are covered in the broken backlinks guide; they are worth redirecting first because they carry link value.
Fixing 404s with Shopify URL redirects
Shopify's URL redirects send visitors and search engines from an old path to a new one with a permanent 301 redirect. In the Shopify admin, search for URL redirects; it sits alongside the navigation and menu settings. Click Create URL redirect, then fill in two fields:
- Redirect from: the old path, starting with a slash, such as
/products/lemon-cake-old. - Redirect to: the new path, such as
/products/lemon-drizzle-cake, or a full address if it goes to another domain.
Choose the target carefully. Send each old address to the closest real match: the replacement product, then the collection it belonged to, and only then a broader page. Sending everything to the home page helps nobody, and Google may treat it as a soft 404.
Changing a handle safely
When you edit a product's handle in its search engine listing, Shopify shows a box to create a redirect from the old address to the new one. It is ticked by default. Leave it ticked. If you or an app changed handles without it, add the redirects by hand.
Bulk redirects with a CSV file
For more than a handful of addresses, import redirects in bulk. From the URL redirects screen choose Import and upload a CSV file with two columns:
Redirect from,Redirect to
/products/lemon-cake-old,/products/lemon-drizzle-cake
/products/xmas-pudding-2024,/collections/christmas
/collections/birthday,/collections/birthday-cakes
/pages/delivery-info,/pages/delivery
/product/carrot-cake/,/products/carrot-cake
A few rules keep the import clean:
- Use paths that start with a slash in the first column.
- Point each row straight at the final address. If
/agoes to/band/balready goes to/c, change the first row to/c. The redirect chains guide explains why. - Check each target returns 200 before you import. A redirect to a missing page just moves the 404.
- Remove duplicate source paths; one old address can only go to one place.
Shopify's built-in redirects match exact paths only. If you need patterns, such as every address under an old folder, you will need to list each one, or use a redirect app that supports wildcards.
Fixing broken links in your theme and content
A redirect repairs the old address, but links on your own store should go directly to the live page. Every internal link that passes through a redirect or hits a 404 wastes a request and looks careless to visitors.
- Menus. Check every item in the main menu and footer menu. Items pointing at deleted products or collections need updating or removing.
- Theme sections. Buttons, image banners and featured collection blocks in the theme editor often carry hard-coded links. Open each template and check them.
- Product descriptions and pages. Links written into rich text, such as see our matching candles, break silently when the target goes.
- Blog posts. Older articles are the worst offenders, because they link to products from that season.
- Theme code. If a developer hard-coded addresses in Liquid files, search the code editor for
/products/and/collections/to find them.
Shopify's 404 template is worth improving at the same time. A search box and links to your main collections help anyone who still lands there. The custom 404 page guide covers what to include.
The fix, step by step
Step 1
Collect the missing addresses
Export the Not found (404) list from the Page indexing report in Google Search Console. Add any old paths from a previous platform, a sitemap backup or a product export. Put them in a spreadsheet with one path per row. Remove obvious junk such as random strings or bot probes. You should end up with a list of addresses that used to be real products, collections, pages or posts on your store.
Step 2
Confirm each one returns 404
Test every path against the live store with curl -s -o /dev/null -w "%{http_code}" or a crawler. Keep only the rows that return 404. Paths that already return 200 or 301 need no work. If a path you expected to be missing returns 200, a live item still uses it, so any redirect you add for it will be ignored until that item is renamed or removed.
Step 3
Choose a target for each path
For each missing address, add a second column with the best live match. Prefer the replacement product, then the collection the item belonged to, then a closely related page. Avoid sending everything to the home page. Check each target returns 200 and is not itself redirected. Leave genuine junk without a target, because a 404 is the correct answer for addresses that never had useful content.
Step 4
Import the redirects in bulk
Save the spreadsheet as a CSV with the headers Redirect from and Redirect to, one row per address, paths starting with a slash. In the Shopify admin, search for URL redirects, choose Import and upload the file. Review the preview for errors, then confirm. For a single address, use Create URL redirect instead. Afterwards the redirect list should show every row you imported.
Step 5
Test the redirects
Run curl -sI on a sample of the old paths. Each should return 301 with a Location header pointing at the target, and the target should return 200. If a redirect does nothing, check whether a live product, collection or page still exists at the old path, because Shopify only redirects addresses that would otherwise be missing. Fix any chain by pointing the old path straight at the final address.
Step 6
Fix the links inside your store
Crawl the storefront and filter for internal links returning 404 or 301. For each one, open the page that holds the link and update it to the live address: menu items in navigation, buttons and banners in the theme editor, links in product descriptions and blog posts, and any addresses hard-coded in Liquid files. Crawl again and confirm no internal link leads to a missing page or a redirect.
Step 7
Improve the 404 template
Open the theme editor, switch to the 404 page template and add a clear message, a search bar and links to your main collections. This catches visitors who still reach an address you chose not to redirect. Visit a made-up address such as /products/no-such-item-7391 and confirm the page looks right and that curl reports a 404 status rather than 200.
Step 8
Monitor and repeat
Each month, check the Not found (404) list in Search Console and run a crawl. Redirect any new former pages that carry visits or links, and fix new broken internal links at their source. Before deleting a product in future, add its redirect first. Use Validate fix in Search Console after a large batch so Google rechecks the addresses, and expect the report to update over the following weeks.
Edge cases worth knowing
- Collection-scoped product addresses. When a product leaves a collection, links of the form
/collections/x/products/ymay still resolve, because Shopify finds the product by its handle. They break when the product is deleted. - Query strings. Addresses with tracking parameters usually still work as long as the base path exists. Redirect the path, not each tagged variation.
- Markets and languages. Stores with translated or regional subfolders such as
/fr/or/en-gb/have extra addresses for each item. Test a few of them after redirecting. - Sitemaps. Shopify generates the sitemap and removes deleted items automatically. If Search Console still reports sitemap 404s, see the sitemap 404s guide.
- Google Shopping. A deleted product can stay in a product feed for a while. Fix the feed source so it stops sending visitors to a missing page.
Keeping your Shopify store free of 404s
- Archive less, redirect more. Before deleting or archiving a product, decide where its address should go and add the redirect the same day.
- Leave the redirect box ticked every time you change a handle, and check app or bulk editor settings that can change handles for you.
- Crawl monthly. A scheduled crawl catches new broken links in menus, sections and posts. The Shopify site audit guide covers what else to look at.
- Review Search Console. Check the Not found (404) list each month, and redirect any new former pages that carry visits or links.
- Keep a redirect log. Export your redirects after each batch, so you can audit them later and avoid chains.
1. How do I fix a 404 error on Shopify?
You fix a Shopify 404 by redirecting the missing address to the closest live page with a URL redirect, or by restoring the product, collection or page that used to be there. In the Shopify admin, search for URL redirects, create a redirect from the old path to the new one, then test the old address to confirm it returns a 301 to a working page. For many addresses, import a CSV file. Also update any links on your own store that point to the missing page.
2. How do I fix broken links on Shopify?
You fix broken links on Shopify by finding each link that points to a missing page and changing it to the live address. Run a crawl of your storefront to list internal links that return 404, then edit them in the place they live: navigation menus, theme editor sections, product descriptions, pages, blog posts or Liquid theme files. Redirects repair old addresses for outside visitors, but links on your own store should go straight to the live page without a redirect.
3. Does Shopify redirect deleted products automatically?
No, Shopify does not create a redirect when you delete a product, so its address returns 404 straight away. Shopify only offers an automatic redirect when you change a product or collection handle and leave the redirect box ticked. Before deleting a product, add a URL redirect from its address to the replacement product or the collection it belonged to. For items that are only temporarily unavailable, keep the product live and mark it out of stock instead.
4. Why is my Shopify URL redirect not working?
A Shopify URL redirect usually fails because something still exists at the old address, and Shopify only redirects paths that would otherwise return 404. Check whether a live, draft-preview or renamed product, collection or page still uses that path. Other causes are a typing error in the path, a missing leading slash, browser caching of an older response, or a target that itself redirects or returns 404. Test with curl to see the real status and Location header.
5. Can I bulk import redirects into Shopify?
Yes, Shopify lets you bulk import redirects from a CSV file with two columns headed Redirect from and Redirect to. Put the old path, starting with a slash, in the first column and the new path or full address in the second. Use the Import option on the URL redirects screen, review the preview and confirm. Check every target returns 200 before importing and point each row at the final address so you do not create redirect chains.
6. Do 404 errors hurt a Shopify store's SEO?
A few 404 errors on addresses that never mattered do not hurt your rankings, because Google treats 404 as a normal response. They do cost you when former product or collection pages with search traffic or links from other sites go missing, because that traffic and link value is lost. Broken internal links also waste crawling and frustrate shoppers. Redirect the former pages that matter, fix your own links and leave genuine junk addresses as 404.
7. Should I redirect Shopify 404s to the home page?
No, you should not send every Shopify 404 to the home page. Shoppers who wanted a particular product land somewhere unrelated and usually leave, and Google may treat a redirect to an unrelated page as a soft 404, so you gain nothing in search either. Redirect each old address to its closest match, such as a replacement product or the original collection. If there is no sensible match, let it return 404 and show a helpful 404 page.
The HTTP error audit crawls your Shopify store, lists every page and link that returns a 404 and shows where each broken link sits, so you can redirect or relink it.
Open HTTP Error Fixes โ