Skip to main content

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:link entries

HTML Extraction Flow

When the XeoPix crawler downloads the HTML response, the parser:

  1. Issues an HTTP GET to the target URL.
  2. Reads raw response bytes without JavaScript execution.
  3. Parses the <head> block for all <link rel="alternate" hreflang="..."> entries.
  4. Filters for the entry where hreflang === "x-default".
  5. Extracts the associated href value.
  6. Issues a secondary HTTP GET to the x-default href URL.
  7. Checks whether that URL responds with HTTP 2xx and is the root or a language-selector path.
  8. Flags whether the x-default href 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-default href is a valid absolute URL.
  • Whether the x-default href resolves with HTTP 2xx.
  • Whether the x-default href 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-default pointing to a specific language page such as /en/.
  • x-default pointing to a 404 or redirected URL.
  • x-default pointing to a deep content page rather than the homepage or selector.

How to Get It

Crawler should:

  1. Parse raw HTML <head>.
  2. Find: link[rel="alternate"][hreflang="x-default"].
  3. Extract href.
  4. Fetch the href URL and verify HTTP status.
  5. Evaluate whether the path is the root (/) or a plausible language-selector pattern.
  6. Record findings in stored fields.
  7. Check whether the x-default href value is a fully qualified absolute URL. Set x_default_href_is_absolute = FALSE if the value does not include a scheme and host component.
  8. Extract and store the URL path component of the x-default href separately in x_default_href_path for independent path analysis.

What to store

FieldTypeComment
has_x_default_hreflangBOOLEANWhether the page declares an x-default hreflang tag
x_default_hrefTEXTURL value of the x-default hreflang href
x_default_href_statusINTHTTP status code returned when fetching the x-default href
x_default_is_root_or_selectorBOOLEANWhether the x-default href points to the site root or a language selector (NULL if no x-default tag exists)
x_default_sourceTEXTDetection source: html, header, or sitemap
x_default_href_is_absoluteBOOLEANWhether the x-default hreflang href is a fully qualified absolute URL
x_default_href_pathTEXTThe 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."
  • 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."

Note: Reachability of the x-default href (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

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-default must point to the root (/) or a language-picker page.
  • Do not point x-default at any locale-specific subdirectory.
  • Ensure the x-default URL returns HTTP 200.
  • Include the x-default tag on every page in the hreflang cluster.