Can I redirect traffic from a custom product page to my Shopify store homepage?

Asked a month ago

I have a problem with my Shopify store- I deleted one of my custom product pages, but the URL is still available to my customers. I want to redirect the customers on my Shopify store from this deleted page to my store homepage using a 301 redirect. Will it improve my SEO and prevent a 404 error? If so, how do I redirect traffic from a deleted page to my store homepage using a 301 redirect?

Elliot Stafford

Friday, August 26, 2022

You can redirect the incoming traffic from a custom product page to your home page only if the page shows a 404 error. Use your product template.liquid file and add the script given below at its start:

<script>

window.onload = function WindowLoad(event) {

window.location.replace("http://www.yourdomain.com");

}

By following this method, all your custom page traffic will be directed to the homepage.

Note: Make sure to replace the domain in the script with your store's domain name.





Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?