Case study 12: Adding, updating, and deleting Instant Site redirects with import and export
You can add, update, or delete Instant Site redirects using catalog import and export. For example, if you’re moving from another ecommerce platform, or if you want to make bulk changes to all redirects on your site.
Let’s perform three tasks:
- First, add new redirects for your site and store.
- Second, update redirects (say, you want to fix a typo).
- Third, delete existing redirects that you no longer need.
Creating new redirects
Before you start: Make sure you have a list of all the pages on your site that you want to add redirects for. You can use a third-party SEO tool that crawls your site automatically, providing you with a list of broken links. If you’re moving from another ecommerce platform, you can export this information before you leave.
To create new redirects for your Instant Site and store:
- In your store admin, add your products and categories manually or using import.
URLs are created automatically as the product is added to your store. You cannot set URLs for new products yourself.
- Export your store catalog or specific products, then open the CSV file in your preferred spreadsheet editor.
- Locate the “url” column at the end of the file for “product” and “category” rows. It contains URLs of products and categories in your storefront:
- Create a new file in your spreadsheet editor.
- Enter “type” in the first cell. Then enter “site_redirect” in the row below it:
Now you’ve specified that the second row is about a redirect. - In the next column, enter “site_redirect_from_url” and the old URL. In our example it’s https://teststore.shopsettings.com/products/Blue-Pants-p538396664:
- Then add “site_redirect_to_url” in column C and fill it out with an existing URL from your store that you want to redirect to (see the “url” column in the file you’ve exported in Step 2 or simply open a product page in your storefront and copy the URL from the browser’s address bar). In our example, it’s https://teststore.shopsettings.com/products/Navy-Pants-p538396664:
- Now add a new “site_redirect” row below and repeat the process for another pair of URLs.
- After you’ve listed all the redirects you want to create, save the file as .csv to your device.
- Upload the file on the Catalog → Data Import & Export page in your store admin.
That’s it! The redirects are now added to your Instant Site. They will appear on the Instant Site Redirects page in your store admin.
Changing existing redirects
To change existing redirects for your Instant Site and store:
- Go to the Instant Site Redirects page in your store admin, tick the redirects you want to edit and click Import or Export Redirects → Export Redirects.
- Open the CSV file in your preferred spreadsheet editor. You will see four columns there: “type”, “site_redirect_internal_id”, “site_redirect_from_url”, and “site_redirect_to_url”:
URLs are exported in the relative form, so /products/Navy-Pants-p538396664 is actually https://teststore.shopsettings.com/products/Navy-Pants-p538396664 on your Instant Site. - Make edits to URLs in the “site_redirect_to_url” column where needed.
- Save the file as .csv to your device.
- Upload the file on the Catalog → Data Import & Export page in your store admin.
That’s it! You’ve updated redirects for your Instant Site. They will appear on the Instant Site Redirects page in your store admin.
Deleting existing redirects
To delete redirects for your Instant Site and store:
- Go to Instant Site Redirects in your store admin, tick the redirects you want to delete and click Import or Export Redirects → Export Redirects.
- Open the CSV file in your preferred spreadsheet editor. You will see four columns there: “type”, “site_redirect_internal_id”, “site_redirect_from_url”, and “site_redirect_to_url”.
- Add the “change_strategy” column to your file and fill it out with the “delete_only” value for all the rows with redirects that you want to delete:
You can use the “change_strategy” column with the “delete_only” value for deleting redirects only (and not for deleting products, categories, etc.) - Save the file as .csv to your device.
- Upload the file on the Catalog → Data Import & Export page in your store admin.
That’s it! You’ve deleted redirects from your store. They will no longer appear on the Instant Site Redirects page in your store admin.