Incomplete hreflang not referencing core language/location

My client’s website is missing a line of hreflang code for their main target language/location. Here is the setup we have:

Three languages with English being assigned to the domain as a default:

Four active markets:

This creates sub-folders for France, Germany and European Union but NOT for the UK (intentional):

The UK market inherits the English language from the store default:
img4

What this results in is a hreflang implementation which is missing the “en-gb” that I would expect/want to see referencing the root .com version of the site. All other markets/languages are referenced correctly, and x-default references the .com.

Is there something in the above configuration which is causing this to happen?

Thanks

Hi @user79

This is David from PieLab here.

Shopify does not produce a hreflang"en-gb" tag even though the UK market is active unless both of these conditions are met:

  • A distinct domain or subfolder (such as /en-gb) is allocated to the UK market, and

  • The UK market is specifically designated for the English language.

In your existing configuration:

Since English is the root.com domain’s default language, Shopify handles this as x-default or general en. And as you have pointed out, the UK market lacks a distinct subfolder or domain.

As a result, Shopify ignores that hreflang and does not consider the UK to have a separate language variant (en-gb).

To resolve this, you can assign a unique subfolder or domain to the UK market (e.g., /en-gb), even if it uses the same content as your main .com.

  • Go to Settings > Markets > United Kingdom
  • Assign a domain suffix like /en-gb
  • Assign English to the UK market explicitly (even if it’s the same language)

This will cause Shopify to generate a proper hreflang"en-gb" tag for that version of the site.

Hope this helps! Let me know how it goes!

Cheers,
David

Hi David

Thanks very much for your reply, that is really helpful. However, I have seen websites with an en-gb hreflang instance despite not using a dedicated subfolder for the region, see: www.xposedlondon.com

Is it possible that this has been hard coded into the liquid file?

Thanks

Hey,

This is David here. You can hard code the hreflang into your liquid theme should you want to but I believe that creating a subfolder should be more trouble free?

Whatever suits you the best!

Cheers

I would rather not create a new subfolder because that would involve redirects, and an unnecessary version of the website