How to Fix Hreflang in WordPress (Multilingual & Geo Sites)
Multilingual or geo-targeted WordPress sites need hreflang to tell Google which language/region each URL targets. Done right, hreflang prevents duplicate-content issues across language variants. Done wrong, it leaks rankings between regions or fails entirely. This guide covers WordPress-specific hreflang patterns for WPML, Polylang and TranslatePress. Pair with hreflang guide.
Step 1: Decide on URL structure
Three options: subdirectory (example.com/fr/), subdomain (fr.example.com), or ccTLD (example.fr). Subdirectory is easiest in WordPress; subdomain requires separate WP installs or multisite; ccTLD requires separate domains.
Step 2: Install and configure a translation plugin
WPML ($39+/year, most powerful, complex), Polylang (free + Pro from €99, simpler, faster), or TranslatePress (free + Pro from €89, visual editor). All three handle hreflang automatically once configured.
Step 3: Configure language URLs
WPML/Polylang → Languages → URL structure. Match your decided pattern (subdirectory etc.). Confirm permalinks update — visit a post in each language.
Step 4: Verify hreflang output
View source on a translated page. Look for tags. Should include: every language variant, x-default pointing to a generic version (often the English/main version).
Step 5: Set x-default correctly
x-default is for users whose locale doesn't match any of your languages. Usually points to your main-language URL. Configure in plugin: WPML → Languages → SEO options; Polylang → Settings → Languages → set default URL.
Step 6: Validate hreflang implementation
Use hreflang.xyz, Ahrefs hreflang validator, or Aleyda Solis's tool. Common errors: missing return tags (page A says alternate is B, B doesn't list A back), missing self-reference, mismatched language codes (use ISO 639-1 like 'en' not 'eng').
Step 7: Monitor in Search Console
Search Console → International Targeting → Language. Reports hreflang errors. Watch the 'No return tags' count; should be zero for a healthy implementation.
Frequently Asked Questions
WPML vs Polylang vs TranslatePress for WordPress hreflang?
WPML: most features, best for complex e-commerce, steepest learning curve. Polylang: cleaner code, faster, simpler — best for content sites. TranslatePress: visual translation editor, easiest for non-technical users. All three handle hreflang correctly once configured. Choose based on translation workflow needs, not hreflang capabilities.
Should I use country codes or language codes?
Use language codes if content is identical across regions of the same language (en for all English speakers). Use language-country codes if content varies (en-GB vs en-US for British vs American spellings/products/pricing). Don't mix — pick one approach per language and stick to it.
Why do I have 'no return tag' errors in Search Console?
The most common hreflang error. Page A's hreflang lists Page B as the French alternate, but Page B's hreflang doesn't list Page A as the English alternate. Translation plugins handle this automatically if every post is properly linked as a translation; manual hreflang implementations often miss this. Audit which pages don't have translations linked in the plugin.
Does hreflang help with AI search visibility?
Yes, indirectly. AI agents use hreflang to determine which version of a multilingual page to surface. Without hreflang, an English-speaking user might see the French version of your page cited. Hreflang gates this correctly.
Can I use hreflang without translating the page?
Not really. Hreflang tells search engines 'this URL targets X language/region'. If both URLs serve identical content with hreflang variants, Google may treat it as duplicate. Hreflang requires actual content differentiation per language/region.
🌐 Validate your hreflang
Find missing return tags, mismatched codes and broken links.