Hreflang tags should follow the ISO 639-1 standard for language codes (e.g., "en" for English, "fr" for French) and the ISO 3166-1 standard for country codes (e.g., "US" for the United States, "CA" for Canada). For example:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
Incorrect ordering, such as "us-en" instead of "en-us," can cause issues in search engines identifying the right content.
Each alternate page should reference back to the original page. Missing return links can cause hreflang signals to be ignored:
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
The x-default hreflang tag helps when no specific language version is available:
<link rel="alternate" hreflang="x-default" href="https://example.com/global/" />
Hreflang tags should not be used on pages marked with noindex
. Search engines ignore such pages, making hreflang ineffective.
Using tools like Google Search Console, Screaming Frog, or hreflang checker tools helps identify missing return links, incorrect codes, or duplicated tags.
If your site lacks hreflang tags, copy the required links from your website management tool or platform (e.g., Weglot Dashboard).
Your original and translated pages must have the exact same hreflang tags. If you have three hreflang tags:
<link rel="alternate" hreflang="en" href="http://www.mywebsite.com/" />
<link rel="alternate" hreflang="fr" href="http://www.mywebsite.com/fr/" />
<link rel="alternate" hreflang="es" href="http://www.mywebsite.com/es/" />
These same hreflang tags must appear on all these pages.
Ensure your hreflang tags are not duplicated in your HTML source code. On Shopify, check Settings > Store Languages and remove extra registered languages if needed.
Weglot and other translation tools do not automatically add canonical tags. You must manually set the canonical tag on your original page. Weglot will adjust it automatically for translated pages.
If the lang
attribute in your HTML does not match your hreflang tags, it can cause issues. Example:
<html lang="en-US">
<link rel="alternate" hreflang="en" href="https://www.mywebsite.com" />
To resolve this, change the HTML lang attribute to match the hreflang tag (e.g., "en" instead of "en-US").
Google recommends adding an x-default
tag when no specific language version matches the user. It is best used for a language selector page.
Keep in mind that this x-default
tag is optional and shouldn't have any negative impact regarding the SEO of your website
Following these best practices and avoiding common errors ensures that your website is correctly indexed for international users. 🚀