Skip to content
Tell us about your project

SEO and performance · 5 min read

301 redirects when migrating to Shopify: how to keep your SEO

The part of a migration that can cost you the most traffic is the one nobody sees: the URLs. If your old pages return a 404 error on launch day, Google and your customers hit a dead end. This guide explains how to prepare the URL map and load the redirects into Shopify.

Why your URLs change when you move to Shopify

Shopify uses a URL structure with fixed prefixes that cannot be changed. It does not matter which platform you come from: WooCommerce, PrestaShop, Magento or a hand-built store will almost certainly have different paths.

The only thing you control is the final identifier (handle) of each URL, which you can edit in the URL field of the SEO section on every product, collection, page or article. It is worth keeping the same slug you had whenever it makes sense, because it simplifies the mapping and keeps the keywords in the URL.

  • Products: /products/handle
  • Collections: /collections/handle
  • Pages: /pages/handle
  • Blogs and articles: /blogs/blog-name/handle

How to build the URL map

The URL map is a two-column table: old URL and new URL. For the source column, do not stop at the current sitemap. Gather URLs from Google Search Console (pages with impressions and clicks), from your analytics, from pages with external backlinks and from a full crawl of the site with a crawling tool.

Then assign each old URL its closest destination. A product goes to its product, a category to its collection, a blog post to its article. If a product no longer exists, redirect it to the most closely related collection, not to the homepage: redirecting everything to the homepage is a bad signal for search engines and users alike.

Work on the map in a shared spreadsheet and add a status column (pending, reviewed, imported). Prioritize URLs by traffic and backlinks: the top hundred deserve a manual review one by one, while long-tail URLs can be mapped with rules based on the slug.

Creating redirects in the Shopify admin

Redirects are managed in Online Store > Navigation > URL Redirects. There you can create them one at a time by entering the source path and the destination. Shopify creates permanent (301) redirects.

When you change the handle of a product, collection, page or article that is already published, Shopify offers a checkbox to automatically create a redirect from the previous URL. Always keep it checked when you change a URL that is already indexed.

Importing redirects by CSV

If you have hundreds or thousands of URLs, creating them by hand is not realistic. From the same URL Redirects screen you can import a CSV file with two columns: the source path and the destination. Shopify provides a sample template so you get the format right.

Clean the file before importing. Remove duplicates, check there are no chains (a URL that redirects to another that redirects again) and that no destination is itself an old URL. Also review special characters and encoded accents in the paths, which are a common source of errors.

  • One row per old URL, no duplicates
  • Source as a relative path, destination as a path or full URL
  • No redirect chains or loops
  • Destinations that exist and return a 200

What you need to know about how they work on Shopify

A Shopify redirect only applies if there is no content at the source path. If you create a redirect from a path that belongs to an active product or page, the store will show that content and the redirect will have no effect. Keep this in mind if you reuse handles.

Query parameters and URL variations with a trailing slash or capital letters may behave differently from what you expect. After importing, test a wide sample of old URLs with a tool that shows the status code and the final destination.

A good method is to run the complete list of old URLs through a crawler in list mode right after switching the domain. Any URL that returns a 404, or that reaches its destination after several hops, should be fixed on launch day.

Search Console before and after the switch

Before migrating, verify your domain in Google Search Console as a domain property if it is not already, and export the performance data for the last few months. You will use it for comparison and to make sure no important URL is forgotten.

After launch, submit the sitemap Shopify generates automatically at /sitemap.xml. Over the following weeks, watch the page indexing report: any 404 errors that show up are URLs missing from your map. Add the corresponding redirect as soon as you spot them. If you are also changing domains, use the Change of Address tool in Search Console.

Other SEO elements you should not forget

Redirects protect your URLs, but content matters too. Migrate titles and meta descriptions, keep category copy on your collections, preserve image alt text and make sure the internal links in your content point to the new URLs rather than to redirects.

Shopify themes output canonical tags to avoid duplicates, for example when a product is viewed inside a collection. Check that your theme keeps them, and review the robots.txt file, which on Shopify you can customize with the robots.txt.liquid template if needed. If you want help with the whole process, at Weblineo we prepare the URL map and redirects as part of our migration service.

Frequently asked questions

Are Shopify redirects 301s?

Yes. The URL redirects you create in the Shopify admin, by hand or by CSV, are permanent 301 redirects.

Can I remove the /products/ prefix from my URLs?

No. The /products/, /collections/, /pages/ and /blogs/ prefixes are fixed in Shopify. You can only edit the final handle of each URL.

How long should I keep the redirects?

Indefinitely. External links, bookmarks and old search results will keep pointing to your old URLs for a long time, and redirects do not penalize the store.

Should I redirect deleted products to the homepage?

Better not. Redirect them to the most closely related collection or alternative product. That way the user finds something useful and search engines understand how the pages relate.

Your next Shopify store starts here

Tell us about your project in a few minutes. If it’s a fit, you book a 30-minute call with a developer and we send you a fixed-price proposal.

Tell us about your projectWe reply within 24 hours