Issue #12 · important
Issue 12
What is this issue?
Hreflang Tags Present
This issue checks whether your multilingual website properly declares alternate language or regional versions using hreflang tags.
What This Issue Checks
The audit verifies that pages targeting different languages or regions include hreflang tags that tell search engines which localized version to show to users based on their language and location.
What is Considered a Passing Implementation
Your website passes this check when:
- Hreflang tags are present on pages that have alternate language/regional versions
- Language codes follow ISO 639-1 standards (e.g.,
en,fr,es) - Regional codes follow ISO 3166-1 standards when applicable (e.g.,
en-US,fr-CA) - Hreflang URLs are valid and accessible
- All language variants in the hreflang cluster are properly declared
Real-World Example
Passing Implementation:
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
Failing Implementation:
<!-- No hreflang tags present on a multilingual site -->
<!-- or -->
<link rel="alternate" hreflang="english" href="https://example.com/en/" />
<!-- Invalid language code: should be "en" not "english" -->
Why does it matter?
Impact on SEO
Crawlability
Without hreflang tags, search engines may not discover all language versions of your content, leading to incomplete indexing of your international pages.
Indexability
Hreflang tags help search engines understand which pages are alternate versions of each other. Without them, search engines may treat each language version as separate, unrelated pages.
Rankings
Proper hreflang implementation ensures that users in different regions see the correct language version in search results. This improves click-through rates and reduces bounce rates from users landing on incorrect language pages.
User Experience
When search engines serve the wrong language version to users, it creates a poor user experience. Users may leave immediately if they cannot understand the content, increasing bounce rates and reducing engagement signals.
Duplicate Content
Without hreflang tags, search engines may view similar content in different languages as duplicate content rather than recognizing them as alternate language versions. This can dilute your SEO efforts across languages.
AI Search / AEO
As AI-powered search becomes more prevalent, properly structured hreflang tags help AI understand your content's language targeting, ensuring accurate representation in AI-generated answers across different languages and regions.
How Resolving This Issue Improves SEO Health Score
Fixing hreflang tag issues improves your overall SEO health score by:
- Ensuring complete international coverage in search results
- Reducing incorrect language version serving
- Improving user engagement metrics from international visitors
- Strengthening your website's international SEO signals
- Preventing duplicate content issues across language versions
How to fix it
Practical Recommendations
1. Add Hreflang Tags to All Multilingual Pages
Include hreflang tags in the <head> section of every page that has alternate language or regional versions.
Implementation:
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
2. Use Correct Language and Regional Codes
Follow ISO 639-1 for language codes and ISO 3166-1 for regional codes:
Correct format:
en(English)fr(French)en-US(English, United States)fr-CA(French, Canada)
Incorrect format:
english(useen)france(usefr)en_US(useen-USwith hyphen, not underscore)
3. Include Self-Referencing Hreflang Tags
Every page must include a hreflang tag that points to itself. This tells search engines that the page is aware of its place in the hreflang cluster.
Example:
<!-- On the English page -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
4. Ensure All Hreflang URLs Are Valid
All URLs in hreflang tags must:
- Be complete absolute URLs (including
https://) - Return a 200 HTTP status code
- Not redirect to another URL
- Be accessible to search engines
5. Create Complete Hreflang Clusters
Every page in a language group should reference all other pages in that group, including itself. Don't omit any language variants.
Example for a 3-language site:
<!-- On ALL three pages (en, fr, es) -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
6. Add x-default Hreflang for Language Selectors
If you have a language selector or homepage that serves as a fallback, include an x-default hreflang tag:
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Priority Order
- First: Add missing hreflang tags to all multilingual pages
- Second: Fix invalid language/regional codes
- Third: Ensure all hreflang URLs are valid and accessible
- Fourth: Add self-referencing tags and complete the hreflang clusters
Examples
Example 1: Missing Hreflang Tags on a Multilingual Site
Scenario
A website serves content in English, French, and Spanish with separate pages for each language.
Problematic State (Fails)
<!-- On page: https://example.com/about/ -->
<!-- No hreflang tags present despite having multilingual content -->
Result: Search engines don't know the page has alternate language versions. Users may see the wrong language in search results.
Corrected State (Passes)
<!-- On page: https://example.com/about/ -->
<link rel="alternate" hreflang="en" href="https://example.com/en/about/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/about/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/about/" />
Result: Search engines understand the language relationships and serve the correct version to each user.
Example 2: Invalid Hreflang Language Codes
Scenario
A website uses incorrect formatting for hreflang language codes.
Problematic State (Fails)
<link rel="alternate" hreflang="english" href="https://example.com/en/" />
<link rel="alternate" hreflang="french" href="https://example.com/fr/" />
<link rel="alternate" hreflang="en_US" href="https://example.com/en/" />
Result: Search engines ignore these hreflang declarations because the language codes are invalid.
Corrected State (Passes)
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en/" />
Result: Search engines correctly interpret the language and regional targeting.
Example 3: Broken Hreflang URLs
Scenario
Hreflang tags reference URLs that return errors or redirect.
Problematic State (Fails)
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/french/" />
<!-- The /french/ URL returns a 404 error -->
Result: Search engines may ignore the entire hreflang cluster due to invalid references.
Corrected State (Passes)
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<!-- Both URLs return 200 OK status -->
Result: Search engines can successfully crawl and understand all language variants.
How PixyScan detects this
PixyScan checks whether your multilingual website properly declares hreflang tags to help search engines serve the correct language version to users.
Detection Process
PixyScan follows these logical steps to identify hreflang tag issues:
1. Check for Hreflang Tag Presence
PixyScan scans the HTML <head> section of your page to detect all hreflang declarations. It looks for:
<link rel="alternate" hreflang="...">tags in the HTML- Hreflang declarations in HTTP
Link:headers - Hreflang entries in XML sitemaps
2. Extract Hreflang Information
For each hreflang tag found, PixyScan extracts:
- The language/regional code (e.g.,
en,fr-CA) - The URL being referenced
- The source location (HTML head, HTTP header, or sitemap)
3. Validate Language and Regional Codes
PixyScan checks whether the hreflang values use proper formatting:
- Language codes must follow ISO 639-1 (e.g.,
en,fr,es) - Regional codes must follow ISO 3166-1 when used (e.g.,
en-US,fr-CA) - Common invalid values like
english,france, oren_USare flagged
4. Verify Hreflang URL Accessibility
PixyScan validates that each URL referenced in hreflang tags:
- Is a valid URL format
- Returns a successful HTTP status code (200-299)
- Does not redirect to another URL
- Is accessible to search engines
5. Count Hreflang Tags
PixyScan counts the total number of hreflang tags detected on the page to determine if any are missing.
When the Issue is Flagged
The issue is flagged when any of these conditions are met:
- No hreflang tags detected: The page appears to be multilingual but has no hreflang declarations
- Invalid language codes: Hreflang tags use incorrect formatting (e.g.,
englishinstead ofen) - Broken hreflang URLs: URLs in hreflang tags return errors or redirect
- Incomplete hreflang clusters: Not all language variants are properly declared
When the Issue Passes
The issue passes when:
- Hreflang tags are present on multilingual pages
- All language/regional codes follow proper ISO standards
- All hreflang URLs are valid and accessible
- The page includes a self-referencing hreflang tag
- All language variants in the cluster are properly declared