Fixing 404s After a Shopify Migration

You migrated to Shopify, and traffic fell off a cliff. Search Console is filling with 404s for URLs that ranked last month.
This is recoverable, and the window matters: Google drops a 404 from the index far faster than it re-earns a ranking. Here is the order to work in.
Symptom
- Search Console → Pages shows a spike in Not found (404).
- Rankings for product and category pages fall within days.
- Old URLs like
/product-category/mens-shoesor/products/blue-shirt.htmlreturn 404. - Referral traffic from existing backlinks stops converting.
Cause
Platforms use different URL structures, and Shopify enforces its own prefixes. Nothing carries over automatically:
| Old platform | Old URL | Shopify URL |
|---|---|---|
| WooCommerce | /product/blue-shirt/ | /products/blue-shirt |
| WooCommerce | /product-category/shirts/ | /collections/shirts |
| Magento | /blue-shirt.html | /products/blue-shirt |
| BigCommerce | /blue-shirt/ | /products/blue-shirt |
Shopify's /products/ and /collections/ prefixes are not configurable, so every product and category URL changes. If redirects were not created during the migration, every one of them is now a 404.
Fix
1. Get the complete list of old URLs
Do not rely on memory or a sitemap alone. Pull from three sources and merge:
- Search Console → Pages → export everything with impressions in the last 12 months.
- Your old sitemap.xml, if you still have it or a crawl of it.
- Ahrefs or Screaming Frog crawl of the old site, if it is still reachable.
Prioritise by impressions. A URL with 2,000 impressions matters more than 200 with none.
2. Build the mapping
Create a CSV with exactly these headers — Shopify's importer is strict:
Redirect from,Redirect to
/product/blue-shirt/,/products/blue-shirt
/product-category/shirts/,/collections/shirts
/blue-shirt.html,/products/blue-shirt
Rules that save time:
- Paths only, no domain.
/product/xnothttps://old.com/product/x. - One-to-one wherever possible. Redirecting everything to the homepage is treated as a soft 404 and passes almost nothing.
- Trailing slashes matter. Include both variants if the old site served both.
- If no equivalent page exists, redirect to the closest collection, not the homepage.
3. Import
Online Store → Navigation → URL Redirects → Import. Shopify accepts up to 100,000 redirects, which is more than almost any catalogue needs.
For a handful, add them manually. For anything over about twenty, use the CSV.
4. Handle patterns the importer cannot
Shopify's built-in redirects are exact-match only — no wildcards. For pattern-based rules, add a fallback in templates/404.liquid:
{% comment %}
Catch legacy Magento .html product URLs and map them to Shopify handles.
Only fires on a real 404, so it costs nothing on normal traffic.
{% endcomment %}
{% assign path = request.path %}
{% if path contains '.html' %}
{% assign handle = path | remove: '.html' | remove: '/' %}
{% assign candidate = all_products[handle] %}
{% if candidate != empty %}
<script>window.location.replace('{{ candidate.url }}');</script>
{% endif %}
{% endif %}
A client-side redirect is weaker than a 301 — use it as a safety net while you fill in the real redirects, not as the plan.
Verify
Check a redirect actually returns 301, not 302:
curl -sI https://yourstore.com/product/blue-shirt/ | head -3
You want HTTP/2 301 and a location: header pointing at the exact new path. A 302 is temporary and passes no authority.
Then:
- Re-crawl the old URL list and confirm zero 404s remain among high-impression pages.
- In Search Console, use URL Inspection on three or four important old URLs and confirm Google sees the redirect.
- Submit the new sitemap.
- Watch Pages → Not found weekly; the count should fall steadily.
Prevent
- Export the old URL list before you migrate, not after. Once the old site is down, recovering the list is guesswork.
- Build redirects as part of the migration, not as cleanup.
- Keep redirects live for at least 12 months. Google keeps consulting them long after the move.
- Never bulk-redirect to the homepage. It looks like a fix in the redirect count and is not one.
Frequently asked questions
How long until rankings recover?
Typically a few weeks to a few months, depending on how quickly redirects went in and how much authority the site had. Rankings usually recover faster than they fell if the redirects are one-to-one.
Do I need redirects for pages with no traffic?
If they have no impressions and no backlinks, low priority. Spend the effort on the top few hundred URLs by impressions.
Will Shopify redirect old URLs automatically?
No. Shopify creates a redirect automatically only when you change a handle inside Shopify. Anything from a previous platform is entirely manual.
Related reading
- Metafields not showing in Liquid
- Choosing an agency for your migration
- Shopify migration — our service page
Need a hand?
We handle Shopify migrations with redirect mapping built in, for merchants in the USA, UAE, Saudi Arabia, Qatar and the UK. If a migration has cost you traffic, get a free audit or read about our Shopify migration process.
The Yaxify Team
Shopify & Web Development Agency
We build custom Shopify stores and high-performance websites for growing businesses across the USA, UK, and UAE. Everything we publish comes out of client work we have actually shipped.
More about Yaxify →