RevealTheme logo
Back to Blog

WordPress For Multilingual Sites: The Hreflang Setup

WordPress For Multilingual Sites: The Hreflang Setup
The RevealTheme Team

By

··3 min read

Multilingual sites have different content for different languages. The hreflang HTML attribute tells search engines which version is for which language.

Without proper hreflang, search engines may show wrong-language versions to users. The implementation matters.

The basic markup

Each page includes link tags pointing to language versions:

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

Each language version of the page references all the alternates.

The x-default attribute

For users whose language isn't matched, x-default indicates the default version:

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

The x-default is the fallback when no language matches.

The regional variants

hreflang supports region-specific codes: en-US, en-GB, es-ES, es-MX. Different regions get different content.

The format is language-region. The hyphen is required.

The self-referencing

Each page references itself in its hreflang. The English page includes hreflang="en" pointing to itself, plus all other languages.

Missing self-reference can confuse search engines.

The plugin support

Multilingual plugins (WPML, Polylang, TranslatePress) handle hreflang automatically. Each language version gets the proper tags.

Manual implementation is possible but tedious for sites with many languages.

The verification

Use Google Search Console's International Targeting section. The section shows hreflang errors if any.

Common errors: missing self-reference, mismatched language pairs, broken URLs.

The honest framing

Hreflang is technical SEO that matters for multilingual sites. The setup is mechanical; the benefit is correct language targeting.

For multilingual sites, the discipline of correct hreflang prevents user experience issues and ranking confusion.