Use hreflang tags in your theme
This guide describes how to use hreflang tags in your theme to allow search engines to surface regionalized and translated content.
How it worksAnchor link to section titled "How it works"
When search engines crawl websites, they look for hreflang tags to determine the language and region that the website is intended for, and then use that to serve the correct URL based on a user's language and location.
For example, if a store has a default URL of
your-store.myshopify.com, and a Spanish language version of
es.your-store.myshopify.com, then including hreflang tags in your theme will ensure that a customer located in Spain, or with a Spanish language setting, will be served the Spanish URL.
hreflang tags in theme.liquidAnchor link to section titled "hreflang tags in theme.liquid"
An hreflang tag is a
link element that identifies a localized URL of a website. You should add a unique hreflang tag for each language or region URL that exists, and they should be included in the
<head>, which is commonly found in
The following examples show how to add hreflang tags to collection and product pages: