Skip to content
Replatly, home

301 redirects from WooCommerce to Shopify

How WooCommerce URLs map to Shopify (/product/ to /products/, categories to /collections/), how to handle accents, long slugs and duplicates, and how to import the map as a CSV in Shopify.

UPDATED · 8 MIN READ

Shopify uses fixed URL patterns, so almost every WooCommerce URL changes when you move. A 301 redirect sends visitors and search engines from each old address to the new one. Here is how the patterns map, which cases need care, and how to load the whole map into Shopify in one import.

01

Why every URL changes

WooCommerce lets you choose permalink bases (Settings → Permalinks). Shopify does not: products always live under /products/, collections under /collections/, pages under /pages/ and blog articles under /blogs/<blog-name>/. So /product/linen-apron/ becomes /products/linen-apron even when the slug stays the same.

Without redirects, those old URLs return a 404 page: links from other sites, bookmarks, old emails and search results all land on an error.

02

The URL patterns, type by type

Default WooCommerce paths and their Shopify target
TypeWooCommerce (default)Shopify
Product/product/linen-apron//products/linen-apron
Category/product-category/kitchen//collections/kitchen
Sub-category/product-category/kitchen/aprons//collections/aprons
Product tag/product-tag/gift-idea//collections/all/gift-idea
Shop page/shop//collections/all
Page/about-us//pages/about-us
Blog post/2024/03/how-to-wash-linen/ or /blog/how-to-wash-linen//blogs/news/how-to-wash-linen
Blog category/category/recipes//blogs/news/tagged/recipes
My account/my-account//account

/collections/all/<tag> is Shopify's built-in tag filter on the all-products collection. If a tag deserves its own landing page, create a collection for it and redirect there instead. news is the blog every Shopify store starts with; use your blog's handle if you created another one.

If you changed the permalink bases in WooCommerce (for example /shop/ or /item/ instead of /product/), the left column changes but the right one does not.

03

What the map looks like

Shopify imports redirects from a CSV file with two columns, Redirect from and Redirect to. One line per old URL:

redirects-shopify.csv

8 ROWS · 301

Sample redirect map: old WooCommerce paths in the first column, new Shopify paths in the second
LineRedirect fromRedirect to
2/product/linen-apron-natural/products/linen-apron-natural
3/product/caf%C3%A9-mug-12oz/products/cafe-mug-12oz
4/product-category/kitchen/aprons/collections/aprons
5/product-tag/gift-idea/collections/all/gift-idea
6/shop/collections/all
7/about-us/pages/about-us
8/2024/03/how-to-wash-linen/blogs/news/how-to-wash-linen
9/my-account/account
Sample redirect map in the CSV format Shopify imports, generated from example WooCommerce URLs by the same code we use for client maps.

04

Accents, long slugs and duplicates

  • Accents and non-Latin characters. WordPress keeps them in slugs and browsers request them percent-encoded (/product/caf%C3%A9-mug/). Keep the old path exactly as it was requested in Redirect from, and use the handle Shopify actually created (often cafe-mug) in Redirect to.
  • Slugs longer than 255 characters. Shopify handles are limited to 255 characters. Long slugs are cut, so check the real handle after import.
  • Two products, one handle. When two items end up with the same handle, Shopify adds -1, -2 to the next ones. Nested categories are a common cause: /men/shirts/ and /women/shirts/ both want shirts. Your map must point to the handle each item actually received.
  • The same old URL twice. /product/mug, /product/mug/ and /product/mug?ref=email are one URL for the redirect. Keep one line, without the trailing slash or query string.
  • Paths that should not be redirected. /cart exists on both platforms. Media files, feeds and wp-admin paths do not need a line.

05

Build the map from your URL list

  1. Collect every old URL: the XML sitemaps from your SEO plugin (/sitemap_index.xml with Yoast or Rank Math, /wp-sitemap.xml otherwise), plus Search Console's indexed pages and top linked pages.
  2. Add the type of each URL when posts and pages share the same /%postname%/ permalink, because the path alone cannot tell them apart.
  3. Generate the target for each line with the patterns above.
  4. After the Shopify import, replace each target handle with the one Shopify actually created, then remove duplicates.
  5. Check that no target is itself redirected: one hop, A to C, not A to B to C.
redirects-shopify.csv
Redirect from,Redirect to
/product/linen-apron-natural,/products/linen-apron-natural
/product-category/kitchen/aprons,/collections/aprons
/about-us,/pages/about-us

06

Import the CSV in Shopify

  1. In the Shopify admin, open the URL redirects screen (Online Store → Navigation → URL redirects, or Content → Menus → URL redirects in newer admins).
  2. Choose Import, upload the CSV and review the preview Shopify shows.
  3. Leave "Override existing redirects" unchecked on the first import.
  4. When the import finishes, compare the number of redirects Shopify reports with the number of lines in your file.

You can import before the switch-over and test on the preview store's address. After the domain points to Shopify, test again on the real domain:

Terminal
tail -n +2 redirects-shopify.csv | cut -d, -f1 | while read -r path; do
  curl -s -o /dev/null -w "%{http_code} $path -> %{redirect_url}\n" "https://yourstore.com$path"
done

Every line should print 301 followed by the right Shopify address. For the steps around it, see the migration checklist.

NEXT STEP

See your own counts in about ten seconds

  • Products, categories, posts and pages, read from public data
  • The fixed-price package that fits
  • No account, nothing changed on your store
Scan my store free