---
title: "hreflang x-default: What It Is and How to Fix It"
description: "What hreflang x-default does, when a site needs it, how to add it in HTML, HTTP headers and XML sitemaps, and how to fix the missing x-default warning."
image: "https://www.blackseoanalyzer.com/static/images/black-seo-analyzer-og-image.png"
canonical: "https://www.blackseoanalyzer.com/en/blog/hreflang-x-default"
language: "en"
---

# hreflang x-default: What It Is, When It's Missing, and How to Fix It

By [Seth Black](https://www.blackseoanalyzer.com/en/about) · Published November 01, 2026

`hreflang="x-default"` names the page Google should show a searcher whose language or region matches none of your other hreflang versions. It’s optional, it goes in the same set as your other hreflang annotations, and it usually points at a language selector or at your main international page. A “missing x-default” warning means a page has a set of language alternates and no fallback in that set.

This post covers x-default only. For hreflang in general, including return links and the mistakes that make Google ignore the whole set, read [hreflang: why it breaks, how to audit it, and how to fix it](https://www.blackseoanalyzer.com/en/blog/hreflang-why-it-breaks-how-to-audit-it-and-how-to-fix-it).

## What does hreflang x-default do?

Google’s documentation on [localized versions](https://developers.google.com/search/docs/specialty/international/localized-versions) says the reserved `x-default` value “is used when no other language/region matches the user’s browser setting”, and that it “was designed for language selector pages”. It needs no language code.

Here is a complete set for a site with English, Spanish and German versions:

```html
<link rel="alternate" hreflang="en" href="https://example.com/en/pricing" />
<link rel="alternate" hreflang="es" href="https://example.com/es/precios" />
<link rel="alternate" hreflang="de" href="https://example.com/de/preise" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing" />
```

A searcher with French as their browser language matches none of `en`, `es` or `de`, so Google can show the x-default URL. Without x-default, Google picks one of the versions itself.

## When do you need x-default?

| Your setup | x-default |
| --- | --- |
| One language, no hreflang at all | Not needed. There’s nothing to fall back from. |
| Two or more language versions | Recommended. Point it at a selector page or your main version. |
| A language selector or geo-redirecting home page | Strongly recommended. This is the case it was designed for. |
| One version per country with no global page | Pick the version most visitors from elsewhere should see, usually English. |

It’s fine for x-default to point at the same URL as one of the languages. Plenty of sites mark the English page as both `en` and `x-default`, and that’s a valid set.

## How do you fix a missing x-default?

Add one line to the set, and add it to every page in the set. Each language version must list itself and all the others, and x-default is part of that list. If the English page carries x-default and the Spanish page doesn’t, the sets don’t match.

There are three equivalent ways to declare it. Google says the three methods “are equivalent from Google’s perspective”, so use whichever your stack can keep consistent.

### In the HTML head

Shown above. This is the most common and the easiest to check.

### In an HTTP Link header

Useful for PDFs and other files without a `<head>`:

```http
Link: <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="en",
      <https://example.com/es/guia.pdf>; rel="alternate"; hreflang="es",
      <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="x-default"
```

In nginx:

```nginx
location = /en/guide.pdf {
    add_header Link '<https://example.com/en/guide.pdf>; rel="alternate"; hreflang="en", <https://example.com/es/guia.pdf>; rel="alternate"; hreflang="es", <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="x-default"';
}
```

### In the XML sitemap

```xml
<url>
  <loc>https://example.com/en/pricing</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/pricing"/>
  <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/precios"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/pricing"/>
</url>
```

Repeat the full set under each `<url>` entry in the cluster, and declare `xmlns:xhtml="http://www.w3.org/1999/xhtml"` on the `<urlset>`.

Pick one method. Mixing them is allowed, but when the HTML says one thing and the sitemap another, you’ve built a debugging problem for yourself.

## What does the “missing x-default” warning mean in bseoa?

bseoa reports [missing x-default hreflang](https://www.blackseoanalyzer.com/en/technical-seo/internationalization-analyzer/missing-x-default-hreflang) when a page declares hreflang alternates for two or more languages and none of them is `x-default`. It treats it as a recommendation, not an error, because Google treats it the same way: the set still works without it, Google just picks the fallback for you.

A page with a single hreflang alternate, or none, isn’t reported. There’s no cluster to fall back from.

To check one page right now, our free [hreflang checker](https://www.blackseoanalyzer.com/en/tools/hreflang-checker) reads a page’s hreflang from both the HTML and the HTTP Link header, validates every language code, then fetches the alternates to confirm each one returns 200, links back, and carries the same set. Missing x-default shows there as a warning with a link to the fix.

## Common x-default mistakes

**Spelling it wrong.** `default`, `x_default` and `xdefault` aren’t valid. The value is exactly `x-default`.

**Putting it on some pages in the set.** Every page in the cluster needs the same annotations, x-default included. A template change that adds it to English pages only leaves the Spanish pages with a different set.

**Pointing it at a redirect.** If `https://example.com/` redirects visitors by IP or browser language, x-default should point at that URL only if Googlebot gets a real page there. Google [documents](https://developers.google.com/search/docs/specialty/international/locale-adaptive-pages) that Googlebot crawls from IP addresses that appear to be in the USA and sends no `Accept-Language` header, so a geo-redirect can send it to the English page every time. A selector page that doesn’t redirect is safer.

**Pointing it at a non-canonical URL.** If the x-default target canonicalizes elsewhere, or is noindexed, the annotation points at a page Google won’t show. Every hreflang URL, x-default included, should be the canonical, indexable, 200 version. That’s the same rule I go through in [how to find and fix every broken canonical tag](https://www.blackseoanalyzer.com/en/blog/how-to-find-and-fix-every-broken-canonical-tag-on-your-site).

**Using it as a language code.** `hreflang="x-default-en"` and `hreflang="en-x-default"` aren’t valid. x-default stands alone.

## Quick answers

**Is x-default required?** No. It’s recommended whenever you have two or more language versions.

**Can x-default point at a page that’s also one of the languages?** Yes. That’s common and valid.

**Does x-default affect ranking?** It affects which version Google shows to users who match none of your languages. It doesn’t make any version rank higher.

**Does it need to be in the sitemap if it’s in the HTML?** No. One method is enough.

-Sethers

About the author

[Seth Black](https://www.blackseoanalyzer.com/en/about)

Seth is a software engineer and engineering leader who builds bseoa, a Rust-based technical SEO crawler with a GUI and CLI. He writes about the crawling, rendering and indexing problems he runs into on real sites.

[LinkedIn](https://www.linkedin.com/in/seth-black-tx/) · [GitHub](https://github.com/sethblack) · [YouTube](https://www.youtube.com/@SethBlack)

[Back to Blog](https://www.blackseoanalyzer.com/en/blog)

## Discover hundreds of SEO Issues in Seconds

Without Monthly Subscriptions

Comprehensive technical SEO analysis powered by ML and 16 specialized modules. Optional AI-powered insights from Claude, GPT-4, or Gemini. Get actionable insights in seconds, and never pay monthly fees again.

[Download Free Trial](https://www.blackseoanalyzer.com/en/free-trial)

I use AI to generate images for my posts and for general editing, updates, and ironically SEO purposes. I used to draw all of the images for my personal blog (taleas) myself, but as the volume of content I produce has increased, I've turned to AI tools to help create visuals that complement my writing. I go out of my way to generate images that look strange, and don't represent real people. If you ever want to chat about my use of AI, please reach out.

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.blackseoanalyzer.com/#organization","name":"Fiscus Technology, LLC","url":"https://www.blackseoanalyzer.com/","logo":{"@type":"ImageObject","url":"https://www.blackseoanalyzer.com/static/images/black-seo-analyzer.png"},"sameAs":["https://sethserver.com/","https://github.com/sethblack"],"founder":{"@id":"https://www.blackseoanalyzer.com/#seth"}},{"@type":"WebSite","@id":"https://www.blackseoanalyzer.com/#website","name":"bseoa","url":"https://www.blackseoanalyzer.com/","publisher":{"@id":"https://www.blackseoanalyzer.com/#organization"}},{"@type":"Person","@id":"https://www.blackseoanalyzer.com/#seth","name":"Seth Black","url":"https://www.blackseoanalyzer.com/about","jobTitle":"Creator of bseoa","sameAs":["https://www.linkedin.com/in/seth-black-tx/","https://github.com/sethblack","https://www.youtube.com/@SethBlack","https://sethserver.com/"]},{"@type":"BlogPosting","@id":"https://www.blackseoanalyzer.com/en/blog/hreflang-x-default#article","headline":"hreflang x-default: What It Is, When It's Missing, and How to Fix It","name":"hreflang x-default: What It Is, When It's Missing, and How to Fix It","description":"What hreflang x-default does, when a site needs it, how to add it in HTML, HTTP headers and XML sitemaps, and how to fix the missing x-default warning.","url":"https://www.blackseoanalyzer.com/en/blog/hreflang-x-default","datePublished":"2026-11-01T05:21:24","dateModified":"2026-11-01T05:21:24","author":{"@id":"https://www.blackseoanalyzer.com/#seth"},"publisher":{"@id":"https://www.blackseoanalyzer.com/#organization"},"image":{"@type":"ImageObject","url":"https://www.blackseoanalyzer.com/static/images/black-seo-analyzer-og-image.png","width":1200,"height":630},"mainEntityOfPage":{"@type":"WebPage","@id":"https://www.blackseoanalyzer.com/en/blog/hreflang-x-default"},"isPartOf":{"@id":"https://www.blackseoanalyzer.com/#website"},"inLanguage":"en-US","isAccessibleForFree":true,"wordCount":946},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.blackseoanalyzer.com/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https://www.blackseoanalyzer.com/en/blog"},{"@type":"ListItem","position":3,"name":"hreflang x-default: What It Is, When It's Missing, and How to Fix It","item":"https://www.blackseoanalyzer.com/en/blog/hreflang-x-default"}]}]}
```
