Redirect a non-404 page on Shopify

Hiriji
Tourist
8 0 3

Hi there,

I know some forms of this have already been discussed on this forum but none of them seems to have appropriate solutions. I am needing to redirect pages that aren't a 404.

My client is using a plugin that essentially creates product tabs using pages within Shopify (so there's a page for "Ingredients" and this is references on the product page using tags). The problem with this is that these tab pages come up in Shopify's search and Google search results and are resulting in increased bounce rates as users aren't actually finding the products.

I am looking for an app that does advanced redirects using patterns etc. for existing pages. Most of the apps seem to also rely on the pages resulting in a 404 which isn't useful for me as these pages can't be set to hidden.

It's 2021 and I feel like we should be able to redirect anything we want, surely there must be a solution?

Replies 8 (8)

KieranR
Shopify Partner
333 27 115

There are ways to do what you're asking but there are tradeoffs. 

What do the URLs look like? 

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
GregBernhardt
Visitor
2 0 5

I also am interested in this. I want to redirect all the Shopify vendor pages to pages I built with an app. The vendor pages are tied to collection templates. To redirect I'd have to 404 all my collection pages. C'mon Shopify. Your stock price is like $1200. Honestly, this kinda boggles my mind and I'd love to know the reason why Shopify devs have built it this way and for so long. I can't think of any legit reason for this limitation. This is a serious SEO limitation.

KieranR
Shopify Partner
333 27 115

So here are some workarounds: 

  • JS redirects
  • meta redirects
  • canonicalisation
  • no-index
  • remove internal links (so no one gets there)
  • CloudFlare O2O + custom workers (or another proxy) to setup 301s

Depends on your specific end goal, there are pros and cons to each of those in terms of SEO and implementation complexity/cost.

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
Hiriji
Tourist
8 0 3

Hi all,

Kieran thanks for offering up some guidance, my hope was really to do this server-side but guess it's not possible.

For anyone still looking for a scalable solution, I've decided to use a combination of Metafields and a JS redirect. 

I've added the below to theme.liquid. Add it right below your opening <head> tag to avoid any flickering. This essentially takes the current page and looks for a "RedirectURL" metafield. You can then edit these metafields by using this URL format: https://yourusername.myshopify.com/admin/bulk?resource_name=Page&edit=metafields.global.RedirectURL.

This isn't first prize but it's working well for my use case. 

{%- if pages[handle].metafields.global.RedirectURL -%}
    <script>
         window.location = "{{ pages[handle].metafields.global.RedirectURL }}";
     </script>
 {%- endif -%}

 

GregBernhardt
Visitor
2 0 5

Very clever 

SamuelFi
Tourist
9 0 0

Wow

that looks like it might help me too.

thank you so much for sharing

 

Sami

SamuelFi
Tourist
9 0 0
Click to expand...
 

Hi

Handle refers to the "tail" of the url right? so:

myshop.com/pages/[handle]

Doesnt help me then, my issue is I have content duplication across entire language version of site, like this:

 

  1. English/Primarydomain: myshop.com/pages/[handle]
  2. Finnish/Primarydomain: myshop.com/fi/pages/[handle]
  3. FInnish/thirdparty domain: localshop/pages/[handle]

Where unfortunately urls 2 & 3 contain identical content across the whole site.

I cant redirect url 2 to url 3 since 2 isnt giving a 404

Url to canonicalises to itself (url 2 ->canonical -> url2) and I cant address that

I am yet to even try to worry about hreflang tags

 

Strange this cant be addressed. In mycase all I need is

either

 url2 -> 301 redirect -> url3

OR

url 2- > canonical target -> url3 

 both very straight forward  as the sites are identical, url1 can remain live as its english.

 

I understood this platform was getting better at SEO performance management but apparently you cant do any of these things?  So any advice anyone can share regarding how to deal with these types of issues is much appreciated.

 

thanks

Sami

 

 

Hiriji
Tourist
8 0 3

Hi all,

 

I've written about this in a bit more detail here for anyone interested in this solution. Hope this is allowed.