What is hreflang — multilingual SEO explained

hreflang is an HTML attribute (and sitemap element) that tells search engines which language version of a page to show to which users — essential for multilingual websites.

The multilingual indexing problem

If your website serves content in multiple languages — English for international visitors, German for German-speaking visitors, French for French-speaking visitors — you face a specific SEO challenge: search engines need to know which version of a page to show to which user.

Without explicit signals, Google may index only one language version, show the wrong language to visitors, or treat the multiple language versions as duplicate content (which can negatively affect rankings).

Hreflang is the standard solution.

What hreflang tells search engines

The hreflang attribute declares the relationship between language versions of the same page. It says: "this page at URL X is the English version; the German version is at URL Y; the French version is at URL Z."

Search engines use this to serve the appropriate language version to users based on their browser language, search language setting, and geographic location.

A German speaker searching in German gets the German version of your page. An English speaker searching in English gets the English version. Without hreflang, both might get the same version — likely whichever Google indexed first.

The two places hreflang lives

In the HTML <head>:

<link rel="alternate" hreflang="en" href="https://yoursite.com/en/about" />
<link rel="alternate" hreflang="de" href="https://yoursite.com/de/about" />
<link rel="alternate" hreflang="fr" href="https://yoursite.com/fr/about" />
<link rel="alternate" hreflang="x-default" href="https://yoursite.com/about" />

Every language version must include hreflang tags pointing to all versions, including itself. The x-default value marks the fallback version for users whose language is not explicitly listed.

In the XML Sitemap:

<url>
  <loc>https://yoursite.com/en/about</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://yoursite.com/en/about"/>
  <xhtml:link rel="alternate" hreflang="de" href="https://yoursite.com/de/about"/>
</url>

Using both the <head> tags and the sitemap entries is redundant but recommended — it gives Google two independent sources confirming the language structure, reducing the chance of misconfiguration going undetected.

Common hreflang mistakes

Missing reciprocal links. If the English page links to the German page but the German page does not link back to the English page, the signal is broken. All language versions must reference all other versions.

Wrong language codes. hreflang uses IETF language tags. en is correct for generic English. en-GB is British English. en-US is American English. de is German. de-CH is Swiss German. Using the wrong tag means the signal is ignored.

Forgetting x-default. The x-default tag tells Google what to show when no language match is found. Without it, Google has to guess.

Applying hreflang to non-translatable pages. Pages like privacy policies, cookie notices, and technical documents that are not actually translated do not need hreflang. Only apply it to pages with genuine language variants.

Hreflang and Joomla

Joomla supports multilingual sites natively through its content language system. The core installation supports installing multiple languages, and content can be associated with specific languages. Extensions like Falang provide additional field-level translation for structured data.

However, Joomla does not automatically generate hreflang tags. Without a plugin, your multilingual Joomla site gets zero hreflang signals to search engines.

How AI Boost for Joomla handles hreflang

AI Boost for Joomla automatically generates hreflang tags for all installed Joomla languages and injects them into the <head> of every page. It also adds the corresponding xhtml:link entries to the XML sitemap.

The plugin reads your Joomla language configuration, identifies which languages are installed and active, and generates the correct IETF language tags (including region-specific codes like en-GB, pt-BR, zh-CN) for every page. It also generates the x-default tag pointing to your default language version.

For Falang users, the plugin integrates with Falang's field translation system so that per-language structured data (organisation names, descriptions, addresses in local language) is correctly included in the JSON-LD output for each language version.