If you run a multilingual WordPress blog, you’ve probably faced this frustration: “My English content ranks well locally, but why doesn’t the Spanish version show up in Spain?” or “Why do French users see the English version instead of French?”
I experienced the same issue when I launched my IT blog in multiple languages. The English version ranked well, but international users kept seeing the wrong language versions. The solution? Proper hreflang tag implementation.
Today, I’ll show you how to configure hreflang settings for your multilingual WordPress blog so that users see content in their preferred language, based on real-world experience and lessons learned.
1. Why Your Multilingual Blog Isn’t Showing Up Properly
“I created Spanish and French versions, so why do international searches only show English?”
Many multilingual blog owners struggle with this. When I first built my dual-language IT blog, I had the same problem. English content ranked well, but when a colleague in Madrid checked, they only saw the English version.
The issue is that simply creating translated versions isn’t enough. Search engines like Google determine which page version to show based on user language and location, but they can’t figure it out unless you tell them explicitly.
That’s where hreflang tags come in. Let me walk you through how to implement this in WordPress, sharing the mistakes I made so you don’t have to.
2. How Does Google Determine Language and Region?
First, understand how Google identifies users.
Google primarily uses IP address as the first priority, then considers browser language settings as secondary.
Here are real-world scenarios:
Scenario 1: London user with English browser
- IP address: UK ✓
- Browser language: English ✓
- Result: English content (perfect!)
Scenario 2: New York user with Spanish browser (expat)
- IP address: USA
- Browser language: Spanish ✓
- Result: Depends on your settings
Scenario 3: Paris user with English browser
- IP address: France ✓
- Browser language: English
- Result: Google decides
These complex situations require clear signals from us.
3. What Are hreflang Tags?
Hreflang tags are HTML attributes that tell search engines which language and region a webpage targets.
Simply put, it’s like saying “This page is for Spanish speakers” or “This page is for English users in the United States” to Google.
What hreflang Tags Look Like
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="x-default">
This code goes in the <head>
section of your page.
Important: hreflang is a Signal, Not a Directive
Hreflang is a signal, not a directive. Other SEO factors can override hreflang attributes, causing search engines to rank different page versions higher.
This means that even with perfect hreflang implementation, low content quality or missing backlinks can prevent proper visibility.
4. Language Code vs. Region Code: Which Should You Choose?
This is where it gets confusing. Should you use es
or es-es
?
Using Language Code Only (es)
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
Targets:
- Users in Spain ✓
- Spanish speakers in the USA ✓
- Spanish speakers in Mexico ✓
- Spanish speakers in Argentina ✓
Targets all Spanish speakers worldwide, regardless of location.
Using Region Code (es-es)
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es-es">
Targets:
- Users in Spain ✓
- Spanish speakers in the USA ✗
- Spanish speakers in Mexico ✗
Targets only users with Spanish IP addresses.
Which Should You Choose?
In my experience, using language code only (es, en, fr) works best for most cases.
Why?
- Reaches all Spanish/French/German speakers globally
- Simpler configuration
- Matches what most bloggers want
If you specifically want to target “only users in Spain,” then use es-es
.
5. Three Ways to Set Up hreflang in WordPress
The easiest way to add hreflang tags in WordPress is using a multilingual plugin. These plugins handle the technical details automatically.
Method 1: Polylang Plugin (Recommended!)
Polylang is free yet powerful. Once you set up your multilingual site, it automatically generates hreflang tags.
Installation:
- WordPress admin → Plugins → Add New
- Search “Polylang” and install/activate
- Settings → Languages
- Add languages (English, Spanish, French, etc.)
With over 600,000 downloads, Polylang is one of the most popular multilingual plugins.
Pros:
- Completely free
- Automatic hreflang generation
- User-friendly interface
Cons:
- Free version lacks official support
Method 2: WPML Plugin
WPML is the most popular WordPress multilingual plugin. When you add languages and translate content, WPML automatically inserts and updates hreflang tags.
Features:
- All WPML plans include automatic hreflang management
- Premium support
- Custom language creation for regional targeting
For example, to target French-Canadian users, you can set hreflang="fr-ca"
.
Cons:
- Paid (annual subscription)
Method 3: Hreflang Manager Plugin (For Advanced Users)
Hreflang Manager provides an easy and reliable method to implement hreflang in WordPress.
Best for:
- Adding only hreflang without a multilingual plugin
- Hreflang setup across multiple domains
- Language script variation support
This specialized tool allows you to set hreflang with all possible language, script, and region codes.
6. Real Example: Dual-Language Blog Setup
Let me show you the actual setup using my blog as an example.
English Post hreflang Setup
<link rel="alternate" href="https://www.yoursite.com/es/fedora-linux-security/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/fedora-linux-security/" hreflang="en">
<link rel="alternate" href="https://www.yoursite.com/en/fedora-linux-security/" hreflang="x-default">
<link rel="canonical" href="https://www.yoursite.com/en/fedora-linux-security/">
Spanish Post hreflang Setup
<link rel="alternate" href="https://www.yoursite.com/es/fedora-linux-security/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/fedora-linux-security/" hreflang="en">
<link rel="alternate" href="https://www.yoursite.com/en/fedora-linux-security/" hreflang="x-default">
<link rel="canonical" href="https://www.yoursite.com/es/fedora-linux-security/">
What’s x-default?
The x-default tag specifies the default page to show when the user’s language isn’t supported.
For example, if a Japanese user visits but you don’t have a Japanese version, they’ll see the x-default page (usually English).
While x-default hreflang is optional, Google recommends it as a way to control which page to serve when no languages match.
7. Critical Rules to Follow
Hreflang tags come in pairs. If the original webpage has an hreflang tag pointing to another language version, that alternate page must also have an hreflang tag pointing back to the original. These are called return links or bidirectional links.
Rule 1: Bidirectional Links (Required!)
All pages must reference each other.
Wrong:
<!-- Spanish page -->
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
<!-- English page -->
<!-- No hreflang tags at all! ❌ -->
Correct:
<!-- Spanish page -->
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
<!-- English page -->
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
Rule 2: Include Self-Referencing Tags
Every page must include a self-referencing hreflang tag indicating its target language and region.
This means the English page must also include an hreflang="en"
tag pointing to itself.
Rule 3: Use with Canonical Tags
Always use canonical URLs in your hreflang tags. The canonical URL is the primary address designated as the authoritative version for search engines to index.
<!-- Correct -->
<link rel="canonical" href="https://www.yoursite.com/es/article/">
<link rel="alternate" href="https://www.yoursite.com/es/article/" hreflang="es">
Rule 4: Use Correct Language Codes
Language codes must use ISO 639-1 format, and region codes must use ISO 3166-1 Alpha 2 format.
Watch out for:
en_US
❌ →en-US
✓ (dash, not underscore)EN
❌ →en
✓ (lowercase)uk
(Ukraine) vsgb
(United Kingdom) – don’t confuse them!
8. How to Validate Your Setup
Once you’ve configured hreflang, you must verify it works correctly. Understanding what validation tools check helps you use them effectively.
Common Errors Validation Tools Detect
Validation tools automatically find these issues:
1. Non-200 HTTP Responses
- 404 errors: hreflang URL doesn’t exist
- 301/302 redirects: Using redirect URL instead of final URL
- 5xx server errors: Server issues preventing access
2. Missing Return Tags The most common error. Spanish page points to English page, but English page doesn’t point back to Spanish.
3. Missing Self-Reference Each page must include itself in the hreflang list.
4. Invalid Language/Region Codes
- Using
en_US
instead ofen-US
- Confusing
uk
(Ukraine) withgb
(United Kingdom) - Using non-existent ISO codes
5. Duplicate hreflang Entries Same language code appears twice on one page.
6. Missing x-default Not required, but recommended.
7. Canonical Conflicts Page with hreflang tags points to different page as canonical.
Method 1: TechnicalSEO.com hreflang Testing Tool (Free, Recommended!)
The easiest tool to use. Just enter a URL and get instant results.
How to use:
- Visit https://technicalseo.com/tools/hreflang/
- Enter the URL to check
- Select search engine (choose Googlebot)
- Click “Check” button
Interpreting results: The tool displays results in a table:
Column | Meaning |
---|---|
Status | HTTP status code (should be 200) |
hreflang | Language/region code |
Alternate URL | Alternate URL |
Return Tag | Bidirectional link check (shows “self-referencing” if correct) |
Indexable | Whether search engines can index it |
Error | Errors found (should be empty) |
Green checkmark means your setup is perfect!
Red warnings mean:
- Check which URL has the problem
- Look at Error column for specifics
- Go to that page and fix it
Method 2: Google Search Console (Free)
Google continues to support and use hreflang tags on your pages. However, the ability to target search results to specific countries using Search Console country targeting is no longer supported.
Note: As of 2025, the International Targeting report is deprecated.
What you can do instead:
- Google Search Console → URL Inspection tool
- Enter the URL to check
- Click “Test live URL”
- Check hreflang tags in page source
- Click “View crawled page” to see what Google actually sees
Method 3: Other Free Validation Tools
hreflang.org Validator
- Test multiple URLs at once
- Detailed error explanations
- Export results to Excel
SISTRIX hreflang Checker
- 25 free queries per day
- Simple interface
- Automatic bidirectional link verification
Weglot Hreflang Checker
- Multiple search engine options (Google, Bing, Yandex)
- Intuitive results display
- No signup required
Method 4: Screaming Frog SEO Spider (Paid/Free)
Best for checking your entire site at once.
Advantages:
- Crawl hundreds or thousands of pages at once
- Automatically categorize common errors
- Export detailed reports to Excel
- Check hreflang in XML Sitemaps too
Key checks:
- Non-200 Hreflang URLs: Find 404s or redirect URLs
- Unlinked Hreflang URLs: hreflang URLs without internal links
- Missing Return Links: Pages without bidirectional links
Usage tips:
- Configuration → Spider → Crawling → Enable “Check hreflang”
- Start crawling
- Check errors in Hreflang tab
- Use Filters to view specific errors
When and How Often to Validate?
After initial setup: Immediately Regular checkups: Once per month After adding new content: Within a week After site structure changes: Immediately
Practical Tip: Validation Checklist
Here’s the checklist I actually use:
□ Do all language version URLs return 200 responses?
□ Does the Spanish page point to the English page?
□ Does the English page point to the Spanish page?
□ Does each page reference itself?
□ Do language codes follow ISO standards? (es, en, en-US)
□ Is x-default configured?
□ Does the canonical tag point to itself?
□ Are all URLs in consistent format? (trailing slash or not)
Create this checklist in a spreadsheet and check it every time you publish a new post to avoid mistakes.
9. Common Mistakes and Solutions
A study of 374,756 domains found that 67% of hreflang implementations had issues.
Many sites get hreflang wrong. Here are mistakes I’ve made myself.
Mistake 1: Missing Return Tags
The most common error.
Problem:
<!-- Spanish page -->
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
<!-- English page -->
<!-- No hreflang tags at all! ❌ -->
Solution: Links must be bidirectional. The English page needs tags pointing to the Spanish page too.
Mistake 2: Incorrect Language Codes
<!-- Wrong -->
<link rel="alternate" href="..." hreflang="en_US"> ❌
<link rel="alternate" href="..." hreflang="EN"> ❌
<!-- Correct -->
<link rel="alternate" href="..." hreflang="en-US"> ✓
<link rel="alternate" href="..." hreflang="en"> ✓
Mistake 3: Canonical and hreflang Conflicts
<!-- Wrong -->
<link rel="canonical" href="https://www.yoursite.com/en/">
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
Don’t point all page canonicals to the English page! Each language version should set itself as canonical.
Mistake 4: Using Redirecting URLs
Automatic redirection based on IP geolocation or cookies can prevent bots from crawling and accessing all your pages.
Problem:
- Specified
/de/
URL in hreflang - Actually redirects to
/de-DE/
Solution: Use the final redirected URL directly in hreflang.
Mistake 5: Trailing Slash Inconsistency
http://www.example.com/de and http://www.example.com/de/ are technically two separate URLs. Google treats them as two separate pages.
Maintain consistency:
<!-- All URLs with slash -->
<link rel="alternate" href="https://www.yoursite.com/es/" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en/" hreflang="en">
Or
<!-- All URLs without slash -->
<link rel="alternate" href="https://www.yoursite.com/es" hreflang="es">
<link rel="alternate" href="https://www.yoursite.com/en" hreflang="en">
Choose one and use it consistently.
10. Is hreflang Enough? Additional Tips for International Rankings
Honestly, hreflang settings alone won’t get you high rankings internationally.
While hreflang attributes can help search engines display the most relevant version to users, Google may also consider other SEO factors when determining a webpage’s relevance for any given search query.
Additional Work Required
1. Improve Content Quality
- Simple translation ❌ → Rewrite for target audience ✓
- Avoid awkward expressions
- Get native speaker review
2. International Keyword Research
- Use Google Keyword Planner with target country settings
- Target keywords with actual search volume
- Popular keywords in UK ≠ Popular keywords in USA
3. Get Backlinks from Target Regions
- Participate in relevant subreddits
- Share content on StackOverflow, GitHub
- Guest post on international blogs
4. Be Patient
Changes may not appear until an algorithm update, then suddenly Google may recognize your efforts. Expect to wait 2-6 months minimum.
11. Frequently Asked Questions (FAQ)
Q1: Will hreflang take effect immediately?
No. Google needs time to re-crawl and re-index pages. Usually takes 2 weeks to a month.
Q2: Must I add hreflang to every page?
Apply hreflang attributes to every page on your site. Partial setup confuses search engines and weakens the relationship between alternate versions.
Yes, add it to all translated pages.
Q3: Can I add hreflang manually without a WordPress plugin?
You can add it manually by editing header.php, but changes disappear when you update your theme, so this approach isn’t generally recommended.
Possible, but strongly recommend using plugins.
Q4: Can I use hreflang and canonical tags together?
Yes, you must use them together. Each language version should set itself as canonical and connect other language versions via hreflang.
Q5: Can I use hreflang with auto-translated content?
Technically possible, but low-quality auto-translated content doesn’t help SEO. Google doesn’t favor poor translation quality.
Managing multilingual WordPress blogs so that users in different regions see content in their preferred language is more complex than it seems. However, with proper hreflang configuration as explained today, Google can accurately understand your intent and display the correct versions.
Key takeaways:
- Use language code only (es, en, fr) to target speakers worldwide
- Use plugins like Polylang or WPML for automatic hreflang generation
- Set bidirectional links and ensure each page references itself
- Always validate with checking tools
- hreflang alone isn’t enough – content quality and backlinks matter too
It looks complicated at first, but once properly configured, it continues working. I hope your blog reaches global readers in the right languages!