You've built a WordPress site with an English version and a Spanish version of the same pages. Then you notice Google keeps showing the English page to Spanish searchers, or indexing both versions as if they were duplicate content competing against each other. That's almost always a missing-hreflang problem, not a translation problem.
Hreflang is the tag that tells search engines "this page has a version in another language or for another region — here's where to find it." WordPress doesn't add this on its own, which is why sites with perfectly good translations still lose traffic to a mismatched search result.
To add hreflang on WordPress, use a multilingual plugin like WPML, Polylang, or
TranslatePress to generate the tags automatically, or add <link rel="alternate"
hreflang="..."> tags manually via functions.php for a small,
fixed set of language pages. Every language version must link to every other version,
including itself, or Google will disregard the whole set.
What is hreflang, and why WordPress needs help with it
Hreflang is an HTML attribute that tells search engines which language and, optionally, which region a page is meant for, and points to the equivalent page in every other language you've published. It doesn't translate anything and doesn't affect rankings directly — it just routes the right page to the right searcher.
- It's a set, not a single tag. Every translated version of a page needs its own tag pointing to every other version, plus a self-referencing tag pointing to itself.
- WordPress core has no concept of "this page in another language." Unless a plugin, theme, or manual code tells it otherwise, WordPress treats every post and page as an unrelated, standalone URL.
- It usually lives in the page's <head>. As a series of
<link rel="alternate" hreflang="x">elements, though it can also be served as an HTTP header or listed in an XML sitemap. - Language and region codes follow a standard. ISO 639-1 for language (
en,es,fr) optionally combined with an ISO 3166-1 region (en-GB,es-MX).
The practical takeaway: hreflang isn't a WordPress feature that's hidden in settings somewhere — it's a relationship between pages that something has to explicitly define, whether that's a plugin doing it for you or code you add yourself.
Why hreflang matters for a WordPress site
Skipping hreflang on a multilingual WordPress site has consequences that show up slowly, which is part of why it's so often missed:
- The right page reaches the right audience. A French visitor searching in French gets served the French page directly, instead of landing on the English version and bouncing.
- Translated pages stop competing with each other. Without hreflang, Google can treat near-identical structure across language versions as duplicate content instead of intentional localization.
- Regional variants get told apart. Hreflang is what distinguishes
en-USpricing fromen-GBpricing when the wording is otherwise nearly identical. - It compounds with everything else you're doing. Good translations and a solid multilingual URL structure only pay off in search if hreflang is correctly routing traffic to them.
Step-by-step: adding hreflang on WordPress
-
Decide your language/region structure first. Subdirectories (
/es/), subdomains (es.site.com), or separate ccTLDs all work with hreflang — pick one before generating any tags. - Confirm each page actually has a translated counterpart. Hreflang should only point to pages that genuinely exist and are genuinely equivalent in content, not a homepage substituting for a missing translation.
- If you're running a multilingual plugin (WPML, Polylang, TranslatePress), turn on its hreflang output. These plugins already track which posts are translations of each other, so the tags generate automatically once translation pairs are set up.
-
If you're not using a plugin, generate the tags manually. List every language version's URL, including the current page's own URL as a self-reference, and produce one
<link rel="alternate" hreflang="...">line per version. -
Add the manual tags via functions.php or a header/SEO plugin field. Hook into
wp_headso the tags are injected into every relevant page's<head>automatically rather than pasted in one page at a time. - Add an x-default tag if you have a language-neutral fallback. Point it at your default locale or a language-selector page so unmatched visitors have somewhere sensible to land.
- Validate the full set on a live page. Check that every version links to every other version, that codes are correctly formatted, and that there are no broken or redirecting URLs in the set.
Common hreflang mistakes on WordPress
1. Missing return tags
Page A points to Page B, but Page B was published without pointing back to Page A. Google treats this as an unconfirmed relationship and typically discards the entire hreflang set for both pages.
2. Forgetting the self-referencing tag
Every page in the set needs to include a hreflang tag pointing to itself, not just to the other versions — a plugin will usually handle this automatically, but manually written tags often skip it.
3. Using the wrong language or region code
en-UK instead of the correct en-GB is a common WordPress typo
that silently breaks a regional pair, since the code has to match the ISO standard exactly
to be recognized.
4. Pointing to redirecting or non-canonical URLs
If a hreflang tag points to a URL that redirects, has a different canonical tag, or returns a noindex, search engines may disregard that entry entirely instead of following the redirect.
5. Caching plugins serving stale hreflang tags
A page cache generated before a new translation was added can keep serving an outdated hreflang set — clearing the cache after translation changes is easy to forget.
Real-world examples
How different WordPress setups typically implement hreflang in practice:
In every case, the underlying rule stays the same: every version of a page has to know about, and correctly link to, every other version.
Hreflang methods for WordPress compared
A look at the main ways to implement hreflang on a WordPress site, and where each one makes sense.
| Method | Setup effort | Scales with content | Best for |
|---|---|---|---|
| Multilingual plugin (WPML, Polylang) | Moderate, one-time config | Automatic on every new post | Sites regularly publishing in multiple languages |
| Manual functions.php hook | Requires basic code editing | Needs updates as pages are added | A small, fixed number of language pages |
| Standalone hreflang generator | Low, form-based | Manual re-run per page group | One-off pages or sites without a plugin |
| XML sitemap hreflang | Higher, needs sitemap control | Centralized for the whole site | Large sites that prefer sitemap-based signals over head tags |
Generate your hreflang tags right now — free
The Rebrixe Hreflang Generator builds a clean, validated set of hreflang tags for as many language and region versions as you need, including the self-reference and an optional x-default. No account, no watermark — just fill in your URLs and copy the result.