Re directing old urls to new urls

Hi, I am not a developer, but have a question I was hoping for some help with?
I have scrapped the internet for existing urls and found over 200 pages for our site - most of which are old and we do not want to have published or visible to the world anymore.
We are launching a new theme for our Shopify site shortly. Is there a way to take all the existing urls and point them to one of newly created pages? If so - how do I do this?
I am not sure if I am using the right terminology, but I don’t want to create alias urls - I just want to make sure those old pages can no longer be found by anyone.

Hey, @Udrake ,

Welcome to the Shopify Community!

To redirect old URLs to a new page on your Shopify site, you can use a Redirect app from the Shopify App Store. The app will allow you to create redirect rules for each old URL, and specify the new URL that you want it to redirect to. This will ensure that when someone visits the old URL, they will be automatically redirected to the new page, and the old URL will no longer be accessible.

Alternatively, you can also create redirects directly in the theme code by using the “redirect” liquid tag. You’ll need to access your Shopify theme code and add the following code to the theme.liquid file:

{% if request.path == '/old-url' %}
  {% redirect '/new-url' %}
{% endif %}

Replace “/old-url” with the old URL you want to redirect, and “/new-url” with the new URL that you want it to redirect to. Repeat this code for each old URL that you want to redirect.

Note: If you are not familiar with HTML and Liquid, it is recommended to use a Redirect app to avoid breaking your site.

Amazing thank you for these options. I will send the code to the developer and see if that can be done, otherwise will try the app.

@Udrake

No problem! The exact implementation of the redirect code may vary slightly depending on the theme, as the structure of the theme.liquid file can differ between themes. In some cases, you may need to modify the code to match the specific structure of your theme, but the basic concept remains the same. Your developer should have no trouble with this.

Thanks so much. We are using Pipeline… hopefully the code is not too different. Have sent yr comment to our developer to review. Thanks again.

Don’t hesitate to reach back out if you require any further assistance as you continue to work on your store.

All the best,