Website Building » Shopify » How Do I Add a 301 Redirect in Shopify?

How Do I Add a 301 Redirect in Shopify?

Last updated on October 1, 2022 @ 9:59 pm

Adding a 301 redirect in Shopify is a pretty simple process. You just need to add a few lines of code to your theme’s header.liquid file. Here’s how:

1. Log into your Shopify admin and go to Online Store > Themes.

2. Find the theme you want to edit, and then click Actions > Edit code.

3. In the Layout folder, click on header.liquid to open it in the online code editor.

4. Find the section of the code and add the following code just below it:

5. Replace http://www.com/ with the URL you want to redirect to.

PRO TIP: When creating a 301 redirect in Shopify, be sure to use the correct format for the from and to fields. Incorrectly formatted redirects can result in errors and broken links on your site.

6. Click Save and you’re done!

The 301 redirect is a permanent redirect which tells the search engines that a page has moved to a new location and that they should update their indexes accordingly. This is the best way to ensure that users end up at the correct page when they visit your site and also helps to preserve your search engine rankings for that page.

A 302 redirect is a temporary redirect which tells the search engines that a page has moved temporarily and that they should not update their indexes accordingly. This is generally used when a site is undergoing maintenance or if there are temporary changes to a page.

Adding a 301 or 302 redirect in Shopify is pretty simple and only requires adding a few lines of code to your theme’s header.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.