WeglotHreflangs
menu_bookHREFLANG GUIDE

Best practices & common mistakes

Advanced usage tips to implement hreflang correctly — and the errors that quietly break international SEO.

1. Best practices for implementing hreflang tags

a. Use correct language and country codes

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, CA). For example:

<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-ca" href="https://example.com/ca/" />

c. Implement "x-default" for a general fallback (optional)

The x-default hreflang tag helps when no specific language version is available:

<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />

d. Avoid using hreflang on noindexed pages

Hreflang tags should not be used on pages marked with noindex. Search engines ignore such pages, making hreflang ineffective.

e. Regularly audit hreflang implementation

Using tools like Google Search Console, Screaming Frog, or hreflang checker tools helps identify missing return links, incorrect codes, or duplicated tags.


2. Common hreflang error messages

a. No hreflang tags

If your site lacks hreflang tags, copy the required links from your website management tool or platform (e.g. Weglot Dashboard).

b. Conflict with custom hreflang tags

Your original and translated pages must have the exact same hreflang tags. If you have three hreflang tags:

<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />

These same hreflang tags must appear on all these pages.

c. Duplicate hreflang tags

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.

d. Canonical issues

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.

e. HTML lang attribute doesn't match

If the lang attribute in your HTML does not match your hreflang tags, it can cause issues. Example:

<!-- Problematic: HTML lang doesn't match hreflang -->
<html lang="en-US">
...
<link rel="alternate" hreflang="en" href="https://example.com/" />

To resolve this, change the HTML lang attribute to match the hreflang tag (e.g. en instead of en-US).

f. Missing x-default

Google recommends adding an x-default tag when no specific language version matches the user. It is best used for a language selector page.

Following these best practices and avoiding common errors ensures that your website is correctly indexed for international users.

Audit your implementation

Catch missing return links, bad codes, and duplicates in seconds.

Open the checker