Hreflang x-Default Set for Homepage/Fallback Page
Issue No: 169
Category: International SEO
Issue type: Issue
Priority: IMPORTANT
Description
The hreflang="x-default" tag must point to the homepage or a neutral language-selector page so that Google knows which page to display when the user's language or country cannot be matched to any explicitly declared hreflang locale.
How do we capture it
Where to Find
Inside HTML <head> on the homepage or language-selector page:
<link rel="alternate"
hreflang="x-default"
href="https://example.com/">
Can also exist in:
- HTTP
Link:headers - XML sitemaps via
xhtml:linkentries
HTML Extraction Flow
When the XeoPix crawler downloads the HTML response, the parser:
- Issues an HTTP GET to the target URL.
- Reads raw response bytes without JavaScript execution.
- Parses the
<head>block for all<link rel="alternate" hreflang="...">entries. - Filters for the entry where
hreflang === "x-default". - Extracts the associated
hrefvalue. - Issues a secondary HTTP GET to the
x-defaulthref URL. - Checks whether that URL responds with HTTP 2xx and is the root or a language-selector path.
- Flags whether the
x-defaulthref matches the site root (e.g.,/,https://site.com/) or a recognized language-selector pattern.
Validation Logic
The crawler validates:
- Whether
hreflang="x-default"is present at all. - Whether the
x-defaulthref is a valid absolute URL. - Whether the
x-defaulthref resolves with HTTP 2xx. - Whether the
x-defaulthref corresponds to the site root or a language fallback page (not a specific language subdirectory like/en/or/fr/).
Examples of incorrect x-default configuration:
x-defaultpointing to a specific language page such as/en/.x-defaultpointing to a 404 or redirected URL.x-defaultpointing to a deep content page rather than the homepage or selector.
How to Get It
Crawler should:
- Parse raw HTML
<head>. - Find:
link[rel="alternate"][hreflang="x-default"]. - Extract
href. - Fetch the
hrefURL and verify HTTP status. - Evaluate whether the path is the root (
/) or a plausible language-selector pattern. - Record findings in stored fields.
- Check whether the
x-defaulthrefvalue is a fully qualified absolute URL. Setx_default_href_is_absolute = FALSEif the value does not include a scheme and host component. - Extract and store the URL path component of the
x-defaulthref separately inx_default_href_pathfor independent path analysis.
What to store
| Field | Type | Comment |
|---|---|---|
has_x_default_hreflang | BOOLEAN | Whether the page declares an x-default hreflang tag |
x_default_href | TEXT | URL value of the x-default hreflang href |
x_default_href_status | INT | HTTP status code returned when fetching the x-default href |
x_default_is_root_or_selector | BOOLEAN | Whether the x-default href points to the site root or a language selector (NULL if no x-default tag exists) |
x_default_source | TEXT | Detection source: html, header, or sitemap |
x_default_href_is_absolute | BOOLEAN | Whether the x-default hreflang href is a fully qualified absolute URL |
x_default_href_path | TEXT | The URL path component of the x-default href for path-level analysis |
Condition for trigger
The following trigger rules evaluate correctness of the x-default hreflang fallback configuration. These rules only apply when has_x_default_hreflang = TRUE (i.e., x-default exists but is misconfigured). The absence of x-default entirely is covered by Issue 135.
-
Trigger Rule 1: x-Default Pointing to a Language-Specific Page
- Target Field:
x_default_is_root_or_selector - Evaluation Logic:
= FALSE - Severity: WARNING
- Diagnostic Message: "The
hreflang="x-default"tag points to a language-specific page rather than the homepage or a language-selector page. This may cause users from unmatched regions to be routed to the wrong locale."
- Target Field:
-
Trigger Rule 2: x-Default Href Is Not an Absolute URL
- Target Field:
x_default_href_is_absolute - Evaluation Logic:
= FALSE AND has_x_default_hreflang = TRUE - Severity: WARNING
- Diagnostic Message: "The
hreflang=\"x-default\"href is not a fully qualified absolute URL. Hreflang href values must include scheme and host to be considered valid by search engines."
- Target Field:
Note: Reachability of the
x-defaulthref (HTTP status check) is owned by Issue 135, Trigger Rule 2. This issue only evaluates whether the target URL is the correct type (root or language selector).
Sources
- Google hreflang x-default documentation: https://developers.google.com/search/docs/specialty/international/localized-versions#x-default
- Google managing multi-regional sites: https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites
- MDN rel=alternate: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
Long description
The hreflang="x-default" attribute is a Google-defined special hreflang value that designates the fallback page shown to users who do not match any of the explicitly declared language or region hreflang values.
Google specifically recommends that x-default points to:
- The site's homepage (
https://site.com/), or - A neutral language-selector page (
https://site.com/choose-language/).
Correct usage:
<link rel="alternate" hreflang="en" href="https://site.com/en/">
<link rel="alternate" hreflang="fr" href="https://site.com/fr/">
<link rel="alternate" hreflang="x-default" href="https://site.com/">
Incorrect usage — x-default points to a locale:
<!-- BAD: x-default should NOT point to a specific language page -->
<link rel="alternate" hreflang="x-default" href="https://site.com/en/">
When x-default points to /en/, users from regions like Japan or Brazil (not covered by any hreflang) are unnecessarily forced into the English version, potentially creating a poor experience and mismatched indexation.
Without correct x-default:
- Non-targeted regional users land on unintended locale pages.
- Google's hreflang cluster may be considered malformed.
- International organic traffic may serve incorrect language versions.
SEO Impact
Incorrect or missing x-default configuration may cause:
- Users from unmatched regions being routed to the wrong language version.
- Google incorrectly indexing language-specific pages as the canonical for neutral regions.
- Reduced international search relevance across non-targeted markets.
- Duplicate content signals from conflicting hreflang declarations.
Common Failure Scenarios
1. x-Default Missing Entirely
No fallback designation; Google picks arbitrarily.
2. x-Default Set to a Specific Locale
<!-- BAD -->
<link rel="alternate" hreflang="x-default" href="https://site.com/en/">
<!-- GOOD -->
<link rel="alternate" hreflang="x-default" href="https://site.com/">
3. x-Default Pointing to a 404 or Redirect
<!-- BAD: URL no longer exists -->
<link rel="alternate" hreflang="x-default" href="https://site.com/old-home">
Diagnostic Output Example
Incorrect x-default hreflang target detected.
Affected URL:
https://example.com/en/
x-default href:
https://example.com/en/ ← points to locale, not root
Recommendation:
Change x-default href to https://example.com/ (site root or language selector).
How to Fix
Set hreflang="x-default" to the site root or a neutral language-selector page:
<link rel="alternate" hreflang="en" href="https://site.com/en/">
<link rel="alternate" hreflang="fr" href="https://site.com/fr/">
<link rel="alternate" hreflang="x-default" href="https://site.com/">
Rules:
x-defaultmust point to the root (/) or a language-picker page.- Do not point
x-defaultat any locale-specific subdirectory. - Ensure the
x-defaultURL returns HTTP 200. - Include the
x-defaulttag on every page in the hreflang cluster.