Fix guides

Fix: Missing hreflang and language versions

Link language and country versions with hreflang: return links, self-reference, x-default and absolute URLs, for WPML, Polylang, Weglot, Shopify Markets and HTML.

Updated Oct 24, 2026

hreflang tells Google which pages are translations or regional versions of each other, so each searcher gets the right one. This guide covers the crawl notice Missing hreflang, the Lighthouse hreflang item and setting hreflang up correctly. Google’s own rules: Tell Google about localized versions of your page.

Find the language versions in the app

  1. Site crawl › open the crawl › Pages: search Search URL or title for language folders such as /de/, /fr/, /es/, /en-gb/, or subdomains if you crawled with Include subdomains on (see Run a site crawl).
  2. Check one page: Ctrl+U and search hreflang. You should see one <link rel="alternate" hreflang="…"> line for every version, including the page itself.

Missing hreflang

How we detect it

Missing hreflang (notice) means language versions are not linked to each other. The crawler records whether any page has hreflang links, but it doesn’t guess whether a site is multilingual, so this notice is rarely shown. Use this section for any site that has more than one language or country version.

Why it matters

  • Without hreflang, Google may show the English page to Spanish searchers, or the US page (with US prices) in the UK.
  • Country versions in the same language (en-GB, en-US, en-AU) look like duplicates. hreflang tells Google they’re intentional.
  • Broken hreflang (missing return links, wrong codes) is ignored, so it’s as if there were none.

Common causes

  • If the site has translations but no tags → the translation plugin’s hreflang output is off, or translations aren’t linked to each other.
  • If only the home page has tags → tags were added by hand in the header, not per page.
  • If tags exist but Google ignores them → missing return links, relative URLs, or canonicals pointing to the main language.
  • If other versions never get indexed → automatic IP or browser-language redirects hide them from Googlebot.

Fix: basic

The rules every version must follow:

  1. Every version lists every version, including itself (self-reference).
  2. Return links: if the English page points to the German page, the German page must point back.
  3. Absolute URLs with protocol: https://www.example.com/de/, not /de/.
  4. Valid codes: language in ISO 639-1 (en, de, fr), optionally plus country in ISO 3166-1 alpha-2 (en-GB, en-US, pt-BR). en-UK is wrong (use en-GB); a country alone (gb) is invalid.
  5. x-default for the fallback page (language selector or main version).
  6. Canonical points to itself on each version, never to another language (see Fix: canonical tag).
  7. Link only to indexable, 200 pages: no redirects, no noindex pages.
  8. Don’t force redirects by IP or browser language; show a language banner instead.

Then turn on the hreflang output of the site’s translation tool (see Platform steps). Use one method per page (head, sitemap or header), not several with different data.

Fix: expert

For a site with English (global), English UK, German and French pages, put the same block in the <head> of all four pages:

<link rel="alternate" hreflang="en" href="https://www.example.com/services/">
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/services/">
<link rel="alternate" hreflang="de" href="https://www.example.com/de/leistungen/">
<link rel="alternate" hreflang="fr" href="https://www.example.com/fr/services/">
<link rel="alternate" hreflang="x-default" href="https://www.example.com/services/">

Each page also has its own canonical:

<!-- on the German page -->
<link rel="canonical" href="https://www.example.com/de/leistungen/">

Alternative for big sites: hreflang in the XML sitemap. Every URL lists all versions, including itself:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.example.com/services/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/services/"/>
    <xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/leistungen/"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/services/"/>
  </url>
  <url>
    <loc>https://www.example.com/de/leistungen/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/services/"/>
    <xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/de/leistungen/"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/services/"/>
  </url>
</urlset>

For PDFs and other non-HTML files, send an HTTP header:

Link: <https://www.example.com/guide.pdf>; rel="alternate"; hreflang="en", <https://www.example.com/de/guide.pdf>; rel="alternate"; hreflang="de"

Hand-coded or custom CMS: generate the head block from the translation table in the template, so every page lists all its versions.

Platform steps

WordPress (WPML)

  1. In WordPress admin, WPML › Languages: check every language is active and the URL format is set (Different languages in directories is most common).
  2. Make sure each page is translated and published (WPML › Translation Management); untranslated pages get no pair.
  3. WPML › Languages › SEO Options › tick Display alternative languages in the HEAD section › Save.
  4. With Yoast SEO or Rank Math, keep the WPML SEO compatibility plugin (Yoast SEO Multilingual) active so canonicals and sitemaps match.

WordPress (Polylang)

  1. In WordPress admin, Languages › Languages (Polylang): add each language.
  2. Languages › Settings › URL modifications: choose The language is set from the directory name in pretty permalinks.
  3. In each page’s Languages box, connect its translations. Polylang then outputs hreflang (and x-default when the language is set from the URL).

Weglot

  1. In the Weglot dashboard (Settings › Setup) check the translated pages are public. Weglot adds hreflang to all translated versions automatically.
  2. On WordPress, let Weglot handle hreflang and don’t add another plugin’s hreflang output.

Shopify (Markets)

  1. In Shopify admin › Settings › Languages: add and publish each language.
  2. Shopify admin › Settings › Markets: create a market per country/region; under Domains and languages, choose subfolders (/en-gb/, /de/) or separate domains.
  3. Translate content with Translate & Adapt (free Shopify app) or another translation app.
  4. Shopify outputs hreflang for all published market/language combinations, as long as theme.liquid includes {{ content_for_header }} (standard themes do). Don’t add manual tags on top.

Webflow (Localization)

  1. In the Webflow dashboard › Site settings › Localization: add locales with subdirectories and set the primary locale (used for x-default).
  2. Publish all locales; Webflow adds hreflang automatically.

Wix (Multilingual)

  1. In the Wix dashboard › Settings › Language & Region (or Multilingual): add languages, set URL format to subdirectories, publish each language. Wix adds hreflang automatically.

Squarespace

  1. Squarespace has no built-in hreflang. Use Weglot (supports Squarespace), or run each language as its own site and add the tags per page in your Squarespace account › page settings › Advanced › Page Header Code Injection.

Verify the fix

  1. Ctrl+U on two versions of the same page: each lists all versions, itself included, with absolute URLs and a self-referencing canonical.
  2. Check the tags are in the HTML the server sends:
curl -s https://www.example.com/de/leistungen/ | grep -i hreflang
  1. Site crawl › Crawl again (with Include subdomains on if versions live on subdomains), then Compare.
  2. In Search Console, Performance filtered by Country shows whether the right version gets impressions in each market after a few weeks.

Automation

Assisted: tags can be generated from a translation map and validated automatically; enabling output needs WordPress admin via plugin (WPML/Polylang), Shopify Markets settings or the Webflow/Wix dashboards.

Document doesn’t have a valid hreflang

How we detect it

In ”+” audits (Run an audit), Lighthouse reports Document doesn’t have a valid hreflang when the page has hreflang tags but one uses an invalid language code or a relative URL. It appears in the Google Lighthouse section.

Why it matters

Invalid hreflang is ignored by Google, so the language versions are not linked at all.

Common causes

  • If the code is en-UK, english or es-LA → invalid language or region code.
  • If href starts with / → relative URL.
  • If the target redirects or is deleted → tag points to a non-200 page.

Fix: basic

  1. In Audits, open the ”+” audit’s Google Lighthouse section and look at the listed tags.
  2. Fix invalid codes: en-UK → en-GB, english → en, es-LA → es-419 or plain es.
  3. Make every href absolute (https://…).
  4. Remove tags that point to redirected or deleted pages.

Fix: expert

Correct form:

<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/services/">

Platform steps

WordPress / Shopify / Webflow / Wix

  1. Language codes come from the translation tool’s language settings (WPML › Languages, Polylang › Languages, Shopify › Languages). Correct the locale code there; the tags update automatically.

Verify the fix

  1. Click Run again on the ”+” audit in Audits. The Lighthouse hreflang item should pass.

Automation

Automatable: code and URL validation is automatic; fixes need access to the translation plugin settings or theme template.

Common questions

My site has only one language. Do I need hreflang?

No. hreflang is only for sites with versions in different languages or for different countries. Ignore the notice if the site has one version.

Does hreflang make Google rank a page higher?

No. It helps Google show the right language or country version to each searcher, for example the UK page in google.co.uk and the US page in google.com. It also stops the versions from being treated as duplicates of each other.

Should each language version have its own canonical?

Yes. Each version's canonical points to itself, never to the other language. A canonical to another language tells Google to drop the page, and then hreflang is ignored.

Is the HTML lang attribute enough?

No. Google doesn't use the lang attribute to pick language versions. Use hreflang tags, headers or sitemap entries.

Still need help?

Ask in the chat inside the app, or send us a message on the contact page. You can also browse all help topics.