No x-default hreflang on an international homepage
What Is This Issue
x-Default Hreflang Tag for International Site Root/Homepage
This issue checks whether your international website includes an hreflang="x-default" tag that tells Google which page to display when no language-specific match is found for the user’s browser language or region.
What This Issue Checks
The audit verifies that pages serving an international audience include an x-default hreflang tag that acts as a fallback for users whose language or region doesn’t match any explicitly declared hreflang locale.
What is Considered a Passing Implementation
Your website passes this check when:
- An
hreflang="x-default"tag is present on international pages - The x-default href points to a valid, accessible URL
- The x-default href is a fully qualified absolute URL (including scheme and host)
- Only one x-default tag is declared per page
- The x-default URL returns a successful HTTP status (200-299)
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="x-default" href="https://example.com/" />Failing Implementation:
<!-- No x-default tag present -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />Why Is This Important
Impact on SEO
Crawlability
The x-default hreflang tag helps search engines understand which page serves as the fallback for unmatched regions. Without it, search engines may not properly index your international homepage or language selector.
Indexability
Google uses the x-default tag to determine which page to index for users in regions not explicitly covered by your hreflang declarations. Missing x-default can lead to incorrect pages being indexed for certain regions.
Rankings
When users in unmatched regions (e.g., someone in Japan visiting an English/French site) search, Google needs to know which page to show them. The x-default tag ensures they see your intended fallback page, improving international ranking signals.
User Experience
Without x-default, international users from unmatched regions may see an arbitrary language version instead of your intended language selector or international homepage. This creates a poor first impression and increases bounce rates.
Duplicate Content
If Google arbitrarily picks a language version to show to unmatched regions, it may create duplicate indexing issues where multiple regions show the same language version instead of the appropriate fallback.
AI Search / AEO
As AI-powered search becomes more prevalent, properly structured x-default tags help AI understand your site’s international fallback strategy, ensuring accurate representation in AI-generated answers for users in unmatched regions.
How Resolving This Issue Improves SEO Health Score
Fixing x-default hreflang issues improves your overall SEO health score by:
- Ensuring proper fallback page designation for international users
- Preventing arbitrary language version selection by search engines
- Improving user experience for visitors from unmatched regions
- Strengthening your website’s international SEO signals
- Reducing bounce rates from incorrectly targeted international visitors
How XeoPix Detects This
XeoPix checks whether your international website includes an hreflang="x-default" tag to serve as a fallback for users whose language or region doesn’t match any explicitly declared hreflang locale.
Detection Process
XeoPix follows these logical steps to identify x-default hreflang issues:
1. Scan for x-default Hreflang Declaration
XeoPix scans the HTML <head> section of your page to detect if an hreflang="x-default" tag exists. It looks for:
<link rel="alternate" hreflang="x-default">tags in the HTML- x-default declarations in HTTP
Link:headers - x-default entries in XML sitemaps
2. Extract x-default Information
If an x-default tag is found, XeoPix extracts:
- The URL being referenced (href attribute)
- The source location (HTML head, HTTP header, or sitemap)
- The total number of x-default tags on the page
3. Validate x-default URL
XeoPix checks whether the URL in the x-default tag:
- Is present and not empty
- Is a valid URL format
- Is a fully qualified absolute URL (includes
https://and domain) - Returns a successful HTTP status code (200-299)
4. Check URL Scheme
XeoPix extracts the URL scheme (http or https) from the x-default href value to ensure it uses a proper scheme.
5. Count x-default Tags
XeoPix counts the total number of hreflang="x-default" entries on the page to ensure only one is present.
When the Issue is Flagged
The issue is flagged when any of these conditions are met:
- Missing x-default tag: No
hreflang="x-default"tag is detected on the page - x-default URL unresolvable: The URL referenced by x-default returns an error status (not 200-299)
- Multiple x-default tags: More than one
hreflang="x-default"tag is declared on the page - x-default href not absolute: The x-default href is not a fully qualified absolute URL (missing scheme or host)
When the Issue Passes
The issue passes when:
- An
hreflang="x-default"tag is present - The x-default href points to a valid, accessible URL
- The x-default href is a fully qualified absolute URL
- Only one x-default tag exists on the page
- The x-default URL returns a successful HTTP status (200-299)
How To Fix
Practical Recommendations
1. Add x-default Hreflang Tag to International Pages
Include an hreflang="x-default" tag in the <head> section of pages that serve as language selectors or international homepages.
Implementation:
<link rel="alternate" hreflang="x-default" href="https://example.com/" />2. Point x-default to the Correct Page
The x-default href should point to:
- Your main language selector page, OR
- Your international homepage that automatically detects user language, OR
- A page that lists all available language versions
Examples:
<!-- Option 1: Language selector page -->
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<!-- Option 2: Auto-detecting homepage -->
<link rel="alternate" hreflang="x-default" href="https://example.com/home" />3. Use Absolute URLs
Ensure the x-default href is a fully qualified absolute URL including scheme and host:
Correct:
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Incorrect:
<link rel="alternate" hreflang="x-default" href="/" />
<link rel="alternate" hreflang="x-default" href="//example.com/" />4. Include x-default on All Pages in the Hreflang Cluster
The x-default tag should be included on every page in your hreflang cluster, not just the homepage.
Example for all pages:
<!-- On ALL pages (en, fr, es, etc.) -->
<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/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />5. Ensure x-default URL Returns 200 Status
Verify that the URL referenced in the x-default tag:
- Returns HTTP 200 (OK) status
- Is not a redirect (301, 302)
- Is accessible to search engines
- Is not blocked by robots.txt
6. Use Only One x-default Tag Per Page
Declare only one hreflang="x-default" tag per page. Multiple x-default tags will cause search engines to ignore the fallback declaration.
Priority Order
- First: Add missing x-default hreflang tag to international pages
- Second: Ensure x-default href is a valid absolute URL
- Third: Verify x-default URL returns 200 status
- Fourth: Add x-default to all pages in the hreflang cluster
- Fifth: Remove any duplicate x-default tags
What We Store
Storage Level
Page Level — This issue is evaluated for each individual URL.
Database Table / Prisma Model
PageInternationalSeo
Stored Fields
| Field | Type | Description |
|---|---|---|
| hreflangTags | Json? | Array of hreflang tags found on the page |
| invalidLangCodes | String[] | List of invalid language codes detected |
Detection Dependencies
- The following data sources are required to evaluate this issue:
- HTML Document — The crawler extracts
<link rel="alternate" hreflang="...">tags from the HTML head - Language Code Validation — The crawler validates language codes against ISO 639-1 standards
Examples
Example 1: Missing x-Default Hreflang Tag
Scenario
A website serves English and French content with separate pages but has no x-default fallback for international users.
Problematic State (Fails)
<!-- On page: https://example.com/ -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<!-- No x-default tag present -->Result: A user in Japan (language: ja) searches and Google doesn’t know which page to show since there’s no ja or x-default hreflang.
Corrected State (Passes)
<!-- On page: https://example.com/ -->
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Result: Google uses https://example.com/ as the fallback page for users in unmatched regions.
Example 2: x-Default URL Returns Error
Scenario
x-default tag exists but points to a broken URL.
Problematic State (Fails)
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link
rel="alternate"
hreflang="x-default"
href="https://example.com/old-homepage/"
/>
<!-- The /old-homepage/ URL returns a 404 error -->Result: Search engines may ignore the entire hreflang cluster due to invalid x-default reference.
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="x-default" href="https://example.com/" />
<!-- The / URL returns 200 OK status -->Result: Search engines can successfully use the x-default fallback.
Example 3: Multiple x-Default Tags
Scenario
Page declares more than one x-default tag.
Problematic State (Fails)
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/home" />Result: Search engines ignore the x-default declaration because there are multiple conflicting entries.
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="x-default" href="https://example.com/" />
<!-- Only one x-default tag -->Result: Search engines correctly identify the fallback page.
Unit Test
Test File
__tests__/seo-audit-checks/internationalSeo/issue-135-x-default-hreflang.test.js
Purpose
This unit test validates that the X_DEFAULT_HREFLANG issue is correctly detected when an international homepage is missing the x-default hreflang fallback tag.
Tested Function
runInternationalSeo(ctx) from toggleGroups/internationalSeo.js
Issue Information
- Issue Number: 135
- Issue Code:
x_default_hreflang - Toggle Group: internationalSeo
Test Scenarios
Positive Test Cases
- Should not detect X_DEFAULT_HREFLANG when
x-defaulthreflang tag is present on the international homepage - Should not detect X_DEFAULT_HREFLANG on a non-homepage page even without
x-default - Should not detect X_DEFAULT_HREFLANG on a single-language site
- Should not detect issue when no hreflang tags exist at all
Negative Test Cases
- Should detect X_DEFAULT_HREFLANG when
x-defaultis missing on the international homepage with multiple language tags
Edge Cases
- Non-homepage: A non-root URL (
/about) with multiple languages but nox-default— should not trigger the issue - Single-language site: Only one language hreflang tag — should not require
x-default - Empty HTML: No hreflang tags — should not detect the issue
Expected Outcome
Pass
The issue should be reported when the homepage (root URL) contains multiple language hreflang tags but is missing the x-default hreflang tag.
Fail
The issue should not be reported when:
x-defaultis present alongside language tags- The page is a non-homepage URL
- The site is single-language
- No hreflang tags exist
Validation
The unit test verifies:
- Correct issue detection only on the homepage with missing
x-default - No false positives on non-homepage or single-language pages
- Correct issue code assignment
- Metadata (details) is included when the issue is detected
Related Production Files
toggleGroups/internationalSeo.js— containsrunInternationalSeo()issueCodes.js— definesX_DEFAULT_HREFLANGissue code constant
Coverage Summary
- Covers homepage with and without
x-default - Verifies non-homepage pages are excluded from this check
- Covers single-language and no-hreflang scenarios
- Validates metadata presence on detection
References
- Localized Versions - x-default Documentation — Google Search Central
- Managing Multi-Regional Sites — Google Search Central
- HTML Alternate Link Relations — MDN Web Docs