Using hreflang Tags in Your Theme

When search engines crawl a website, they look for hreflang tags to find the website's target region and language. This ensures that the correct URL is served to users based on their language and location.

For example, if a store's default URL is my-store.myshopline.com and the American version is es.my-store.myshopline.com, adding hreflang tags in your theme ensures that customers in America or with American settings will get the American URL.


hreflang Tags

hreflang tags are link elements that specify localized URLs for a website. You should include a distinct hreflang tag for each region or language URL, and it should be included in the <head> section of theme.html.

For example:

<head>
<link hreflang="us" href="us.my-store.myshopline.com" rel="alternate" />
<link hreflang="en" href="my-store.myshopline.com" rel="alternate" />
</head>
Tip

For more information on hreflang tags and their usage, please refer to Google's documentation.

Was this article helpful to you?