FR, version française
Home / Blog / SEO / Hreflang tag: what is it for and how do you declare it?

Hreflang tag: what is it for and how do you declare it?

Hreflang is the attribute of a link rel=”alternate” tag that declares to Google the language or regional versions of the same page. This guide details the syntax, the accepted language and country codes, the role of x-default and the three declaration methods: HTML tag, XML sitemap, HTTP header. It explains how to combine hreflang and the canonical, then lists the errors that cause the tags to be ignored and how to test them. It draws on the real setup of the English version of elev8-lab.fr, whose 85 FR / EN page pairs were compliant on October 19, 2026.

Key points

Hreflang is the attribute of a <link rel="alternate"> tag that declares the language or regional versions of the same page. The hreflang tag helps Google show each user the version in their language or for their country: its documentation, updated on September 21, 2026, says this explicit declaration is “usually best”, rather than leaving Google to detect the versions itself. The documented role of hreflang in SEO is to point users to the right version.

  • Reciprocity: each version lists itself and all the others. If two pages do not list each other, Google ignores their tags.
  • Codes: an ISO 639-1 language (fr), followed if needed by an ISO 3166-1 alpha-2 country (fr-BE), and x-default for the fallback page.
  • Verifiable example: on elev8-lab.fr, 85 out of 85 FR / EN page pairs were compliant on October 19, 2026.

What is the hreflang tag?

Definition

The hreflang tag is a <link rel="alternate" hreflang="…" href="…"> element placed in the <head> of a page. It gives the address of one version of the page, the page itself included, and the language, or the language and country, of the intended audience.

Google recommends telling it about these versions so that it can send each user to the most appropriate one (Tell Google about localized versions of your page, Google Search Central, updated on September 21, 2026). Without a declaration, it can find some of them on its own. It is a technical setting of search engine optimization.

On December 5, 2011, Google extended rel="alternate" hreflang to translated and multi-regional content, to consolidate the signals of these pages and serve the appropriate URL.

Two common beliefs need correcting. Google uses neither hreflang nor the HTML lang attribute to find out the language of a page: its algorithms work it out from the visible content. And a translation is not duplicate content: localized versions only count as duplicates if their main content is not translated.

When do you need hreflang tags?

Hreflang tags are useful as soon as a page exists in several versions, for different languages or countries. Google names three situations.

SituationExampleIs hreflang useful?
Only the template is translated (navigation, footer)Forum whose posts stay in their original languageYes
Same language, several countriesFrench for Belgium, France and SwitzerlandYes
Fully translated contentFrench page and its English translationYes
One language for a single audienceFrench site with no other versionNo: no version to connect

A multilingual site offers several languages; a multi-regional site targets several countries. In both cases, Google recommends a separate URL for each version rather than content that changes based on a cookie or browser settings (Managing multi-regional and multilingual sites, updated on December 10, 2025). Googlebot generally crawls from the United States, without an Accept-Language header: a page that adapts to the browser language may not be crawled in full.

Google also advises against automatically redirecting users based on the language it assumes they speak. Links to the other versions let them choose. The name of a folder (/en/) or of a subdomain is not enough either: the link between a page and its audience has to be declared.

Choosing the structure (country domain, subdomain, subdirectory) falls under international SEO, a broader topic than hreflang.

How do you write a hreflang tag?

For hreflang in SEO, each version carries the same list of tags: one per version, the page itself included. Here are the three lines served on October 19, 2026 in the <head> of the French elev8-lab.fr article on the canonical URL:

  • <link rel="alternate" hreflang="fr" href="https://elev8-lab.fr/seo/url-canonique/">
  • <link rel="alternate" hreflang="en" href="https://elev8-lab.fr/en/seo/canonical-url/">
  • <link rel="alternate" hreflang="x-default" href="https://elev8-lab.fr/en/seo/canonical-url/">

The English version carries the same three tags, in a different order (en, fr, x-default): the list is identical from one version to the other. Four Google rules apply:

  • Self-reference: the page appears in its own list.
  • Reciprocity: if page A lists page B, page B must list page A. Otherwise, Google ignores the tags of both pages, which stops a third-party site from declaring itself a variant of yours.
  • Full URLs: with the protocol (https://example.com/fr/), never //example.com/fr/ or /fr/. The versions can be on different domains.
  • Plain tag: <link> elements in a well-formed <head>, with no media attribute in the same tag.

Which language and region codes should you use?

The hreflang value is an ISO 639-1 language code, followed if needed by an ISO 3166-1 alpha-2 country code: fr, fr-BE, en-GB. Google only accepts these two standards, plus the ISO 15924 script codes (zh-Hant, zh-Hans), and ignores case.

CodeWhat it meansHow Google reads it
frFrench, all countriesValid
fr-BEFrench for BelgiumValid
beBelarusian, not BelgiumValid, but a trap
en-UKUK is a reserved code (the United Kingdom is GB)UK part ignored
BECountry alone, with no languageNot valid
es-419Three-digit region from the BCP 47 standardRejected

For several variants of the same language, Google advises a generic page for the language alone (en), which can be one of the regional pages. The WHATWG HTML standard, for its part, accepts any BCP 47 tag, es-419 included: a code that is valid in HTML can therefore be rejected by Google.

What is x-default for?

x-default designates the page to show when no declared language or country matches the browser settings. Google introduced it on April 10, 2013 (Google Search Central blog post), with support also announced by Yandex, for country selectors and home pages that adapt their content.

Tip

Google recommends x-default and accepts it on any page, but specifies that it was designed for language selector pages, where it will “work best”. Without a selector, choose the version to show by default and declare it on every version.

HTML tag, sitemap or HTTP header: which method should you choose?

Google accepts three methods, which it treats as equivalent. Combining them is possible but adds nothing and makes maintenance harder: one is enough.

MethodWhere to declareFor which files
HTML tag<link rel="alternate" hreflang> in the <head>HTML pages
XML sitemap<xhtml:link> elements in each <url>HTML pages, without touching the template
HTTP headerLink header of the responseNon-HTML files, such as PDFs

In an XML sitemap, the <urlset> root declares the xmlns:xhtml="http://www.w3.org/1999/xhtml" namespace. Each <url> then lists all the versions, its own included, in the order you want. For the French version:

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

These child elements do not count toward a sitemap’s URL limit. For a PDF, the header takes this form: Link: <https://example.com/fr/guide.pdf>; rel="alternate"; hreflang="fr", <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="en". The IETF’s RFC 8288 (October 2017) makes hreflang, in this header, a language hint that does not replace the Content-Language header.

How do you combine hreflang and the canonical tag?

Each version keeps its own canonical URL, in its own language. Google requires it: with hreflang, the canonical page must be in the same language, or in the best possible substitute language if none exists (How to specify a canonical URL, updated on July 10, 2026).

Warning

Pointing the canonical of the English page to the French page breaks this rule: the English page then declares itself a copy of a page in another language. Each version keeps a canonical to itself.

The same page adds two points. A rel="canonical" tag that carries an hreflang, lang, media or type attribute is not used to choose the canonical. And among its canonicalization signals, Google favors URLs that are part of an hreflang cluster. For very similar pages in the same language, intended for several countries, Google advises choosing one version and combining rel="canonical" with hreflang.

Example: the hreflang setup of elev8-lab.fr

Since September 26, 2026, elev8-lab.fr has published an English version under /en/. French stays at the root, English sits in a subdirectory, and each piece of content is translated page by page. The tags come from the site’s theme code, with no multilingual plugin.

Two choices were made that day. The codes have no region (fr, en), because the site is aimed at French and English speakers in all countries. And x-default designates the English version.

The public HTML recorded on October 19, 2026 confirms it: lang="fr-FR" on the French page, lang="en-US" on the English one, and on each a canonical to itself and the three tags shown above. The home page, the SEO pillar page, the blog, the About page and the legal notice follow the same pattern.

The code follows four principles:

  • A single method: the <link> tags in the <head>. The Yoast SEO sitemaps contain no xhtml:link.
  • A link entered on one side only: in the editor, the English content states which French content it translates. The code checks this link in both directions before outputting the tags: reciprocity does not depend on entering it twice.
  • One translation per piece of content: an English piece targets only one French piece. A second link to the same content produces no hreflang, and the WordPress editor flags it.
  • No redirect based on the browser language: an FR / EN button leads to the equivalent page. This button is an <a hreflang="en" lang="en"> link, whose hreflang attribute remains purely advisory under the HTML standard.

85 of 85

On October 19, 2026, an automated check of the 85 FR / EN page pairs of elev8-lab.fr in production found no discrepancy: 200 status code, lang attribute, self-referencing canonical, identical and reciprocal fr, en and x-default tags, button to the equivalent page.

Elev8 Lab read-only check, October 19, 2026

This figure describes the setup, not its effect: no Search Console data on the English pages is published here.

Which pages have no hreflang?

Some pages of the site deliberately have no hreflang tag. The code does not output any in these cases, and the checks of October 19, 2026 confirm it for the first three.

PageHreflang tagsFinding or rule
Page 2 onward of a list (/blog/page/2/)NoneIndexable page, canonical to itself
Internal search results (/?s=seo)NonePage set to noindex, follow
404 pageNoneAddress does not exist
Content set to noindex in Yoast SEO, password protected or unpublishedNoneAs soon as one of the two versions is in this case
Content with no translationNoneNo version to connect

Is an x-default pointing to English compliant?

Yes. Google accepts x-default on any page, and elev8-lab.fr pointed it to the English version. For a user whose language matches neither fr nor en, the declared fallback page is therefore the English page.

Key takeaway

This choice has a limit: Google designed x-default first of all for language selector pages. The site has not yet chosen a specific English-speaking market; if it targets one, regional codes such as en-GB or en-US may be added. The .fr domain, which Google treats as a strong signal of targeting France, could also limit the visibility of /en/ outside France: this is a hypothesis, not tested.

Which errors cause hreflang tags to be ignored?

Hreflang tags that break a Google rule are ignored or have no effect. Here are the errors to look out for.

ErrorEffectFix
Missing return tagGoogle ignores the tags of both pagesAdd the tag on the page listed
Page missing from its own listNon-compliant clusterAdd the self-reference
Wrong code (en-UK, be for Belgium, es-419)Part ignored, wrong language or code rejecteden-GB, fr-BE, ISO code
Relative URL or URL without protocolNon-compliant annotationFull URL in https://
Version redirected, in 404 or in noindexThe tag points to a URL that is not an indexable pageFinal URL, returning 200 and indexable
Canonical to another languageGoes against Google’s rule on canonicalsCanonical in the same language
hreflang on an <a> link mistaken for a declarationPurely advisory attribute under the HTML standard<link> tags in the <head>
Country targeting set in Search ConsoleSetting removed by GoogleHreflang and URL structure

In every tag, replace a URL that is the subject of a 301 redirect with its destination, and remove any URL that returns a 404 error. After a site migration, check the hreflang tags along with the redirects: every URL change affects all the versions in the cluster.

The Search Console “International Targeting” report is deprecated and targeting a country through this setting is no longer supported, but Google continues to use hreflang tags (Search Console Help).

How do you test your hreflang tags?

Testing hreflang tags means checking, page by page and then across the whole site, that each version lists all the others and lists itself. Since the Search Console international report is deprecated, this check is done by hand or with tools.

  1. Read the served <head>: view the source code, or run curl -s https://example.com/fr/ | grep hreflang, then check the URLs and codes.
  2. Open each version listed: the same list must appear there, with the return tag.
  3. Run the page through a testing tool: Google lists the Merkle hreflang tag testing tool and Aleyda Solis’s hreflang tags generator, two third-party tools that it does not maintain or check.
  4. Crawl the site: Screaming Frog SEO Spider sorts errors in a Hreflang tab with 13 filters, including “Missing Return Links”. Its hreflang audit tutorial, modified on January 10, 2025, states that this feature requires a paid licence.
  5. Compare canonicals: URL Inspection in Google Search Console shows the declared canonical and the one Google selected. A mismatch on a language version needs fixing.
  6. Check every pair: on elev8-lab.fr, a read-only script checks each of the 85 FR / EN pairs in production, rather than a sample.

Elev8 Lab has no commercial relationship with the vendors mentioned. An hreflang cluster needs maintenance: every new translation, every changed URL and every page switched to noindex changes the tags of all the versions in the cluster.

Frequently asked questions

Is hreflang a ranking factor?

No Google page consulted presents hreflang as a ranking factor. Its documented role is to help Google show the version suited to the user’s language or country. When it extended the markup to translated content, on December 5, 2011, Google added that it was used to consolidate the signals of a page’s versions.

Do you need hreflang on a single-language site?

No. Hreflang connects the versions of the same page: with no second version, it has nothing to declare. As for the language itself, Google reads neither hreflang nor the lang attribute; it works it out from the visible content. Google does, however, advise using a single language per page, navigation included, and avoiding side-by-side translations.

Should you write fr or fr-FR?

fr is enough if the page is aimed at French speakers in all countries: that is the choice made by elev8-lab.fr. The country code is only useful if several versions target different countries in the same language, for example fr-FR, fr-BE and fr-CH. Google then advises a generic page in fr, which can be one of the regional pages. Case does not matter.

How do you add hreflang on WordPress?

On elev8-lab.fr, the tags come from the theme code, with no multilingual plugin, and the Yoast SEO sitemaps contain none. The other route is a multilingual plugin. In both cases, check the source code served: return tag, self-reference, full URLs and ISO codes.

Why does Google ignore my hreflang tags?

Because a Google rule is not met. The page listed does not list the original page in return. The code is not an ISO 639-1 code, optionally followed by an ISO 3166-1 country. The URL is relative. The declared version redirects, returns a 404 or has a canonical in another language. Or the tags sit outside a well-formed <head>.

Does hreflang help you get cited by AI engines?

Nothing shows that it does. Google’s page on AI features (AI Overviews, AI Mode), updated on December 10, 2025, refers to basic SEO best practices, with no additional requirement, and does not mention hreflang. No documentation from OpenAI, Perplexity, Anthropic or Microsoft that we consulted covers its use. A separate URL per language remains Google’s recommendation.

Sources

  1. Google Search Central, Tell Google about localized versions of your page, updated on September 21, 2026. Accessed on October 19, 2026.
  2. Google Search Central, Managing multi-regional and multilingual sites, updated on December 10, 2025. Accessed on October 19, 2026.
  3. Google Search Central, How Google crawls locale-adaptive pages, updated on December 10, 2025. Accessed on October 19, 2026.
  4. Google Search Central, How to specify a canonical URL with rel=”canonical” and other methods, updated on July 10, 2026. Accessed on October 19, 2026.
  5. Search Console Help, The International Targeting report is deprecated, undated. Accessed on October 19, 2026.
  6. Google Search Central Blog, New markup for multilingual content, December 5, 2011. Accessed on October 19, 2026.
  7. Google Search Central Blog, Introducing “x-default hreflang” for international landing pages, April 10, 2013. Accessed on October 19, 2026.
  8. WHATWG, HTML Living Standard, Links, updated on October 19, 2026. Accessed on October 19, 2026.
  9. IETF (M. Nottingham), RFC 8288, Web Linking, October 2017. Accessed on October 19, 2026.
  10. Screaming Frog, How To Audit Hreflang, modified on January 10, 2025. Accessed on October 19, 2026.
  11. Google Search Central, AI features and your website, updated on December 10, 2025. Accessed on October 19, 2026.
Baptiste Clair Avatar

Digital marketing, SEO and GEO consultant

More about the author

Article checked and updated by the author. Sources consulted on the date shown.

Cite this article

Clair, B. (2026, October 28). Hreflang tag: what is it for and how do you declare it?. Elev8 Lab. https://elev8-lab.fr/en/seo/hreflang/