Most hreflang sets answer a tidy question: this page exists in English and French, so show each audience its own version. Real visitors are less tidy. Someone arrives with a browser set to a language you do not publish, from a region you do not target, and the set has nothing to say about them. The x-default value is the row that speaks for that visitor.
This guide explains what x-default does, when it earns its place in the set, and what it should point to, using Ovatly's free Hreflang Tag Generator, which builds the full tag set, fallback included, plus the equivalent sitemap version.
Contents
- Quick answer
- What x-default actually declares
- When you need one, and when you do not
- What the fallback page should be
- How to generate a set with x-default, step by step
- Worked example: English and French versions of one page
- Limitations
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
x-default is a special hreflang value that names the fallback page for users whose language or region matches none of your versions. It often points to a language selector page or your main English page. It is optional: in the Hreflang Tag Generator you add a row for every language or region version of the page, then optionally set an x-default URL, and the tool outputs the HTML link tags (fallback included) and the equivalent sitemap version. Use it when your site genuinely has a page that serves unmatched visitors well; skip it when there is no sensible fallback page to name.
What x-default actually declares
A normal hreflang row pairs a code with a URL: en with the English page, fr with the French page. The code says who the URL is for. x-default breaks that pattern on purpose. Its code is not a language at all; it is an instruction that means "when nothing else in this set matches the visitor, this is the page to fall back to".
That makes it different in kind from the other rows. The language rows divide your audience up. The x-default row catches whoever is left over. It does not compete with the language versions; it simply gives the set a defined answer for the unmatched case instead of leaving that case to chance.
Because it is part of the same tag set, x-default obeys the same structural rule as everything else in hreflang: reciprocity. Every version must list every other version, including itself, or search engines may ignore the set. The fallback row travels with the set; it is not a separate tag you add to one page only.
When you need one, and when you do not
The honest answer is that x-default is optional, and the generator treats it that way: the step is "optionally set an x-default URL for visitors whose language matches nothing". Optional does not mean pointless. It means the decision depends on your site.
It earns its place in two common situations. The first is a site with a language selector: a page whose whole job is to let visitors pick their language or region, and therefore the natural fallback for an unmatched visitor. The second is a site whose audience is international but whose versions cover only some languages. Naming the main English page as x-default decides the leftover case deliberately, rather than letting an arbitrary version surface.
You can reasonably leave it out when your versions cover your whole realistic audience and there is no page you would want an unmatched visitor to land on. A fallback that points somewhere unhelpful is worse than none.
What the fallback page should be
The entry-level guidance is short: the fallback is often a language selector page or your main English page. Both choices follow the same logic. The page should be the one that best serves someone whose language you do not publish.
A language selector does this best when you have one, because it hands the choice to the visitor instead of guessing. The main English page is the usual second choice on sites where English is the default edition. What the fallback should not be is a region version chosen at random. If no page passes that test, that is the signal to omit the row.
One more detail from the worked example below: the x-default URL can be the same URL as one of the language versions. In the generator's own example, x-default points at the plain English page, which is also the en row. That is legitimate. The row is a role, not a separate page.
How to generate a set with x-default, step by step
- Open the Hreflang Tag Generator and add a row for every language or region version of the page, including the original.
- Use codes like
en,en-GBores-419, and the full URL of each version. Language codes are validated against the ISO 639-1 list; region codes are format-checked (two letters, or three digits such as 419 for Latin America). - Set the optional x-default URL: the fallback page for visitors whose language matches nothing, such as your language selector or your main English page.
- Copy the link tags into every version's
<head>, or use the sitemap version in your sitemap file. The output includes the x-default tag alongside the language tags, and in the sitemap version each<url>lists all versions asxhtml:linkalternates.
Worked example: English and French versions of one page
Take the generator's own example. Rows: en = "https://example.com/page", fr = "https://example.com/fr/page", x-default = "https://example.com/page".
The output includes <link rel="alternate" hreflang="en" href="https://example.com/page">, the matching fr tag, and an x-default tag, plus a sitemap block where each <url> lists all versions as xhtml:link alternates.
Read what the set says. A French-matching visitor gets the French page. An English-matching visitor gets the English page. A visitor matching neither gets the English page too, because the x-default row named it as the fallback. Remove that row and the first two answers stay the same; only the leftover case goes back to being undecided.
Limitations
x-default does one narrow job: it names a fallback inside an hreflang set. It does not translate anything, and it does not create a version for a language you have not published; the unmatched visitor still lands on a page written for someone else, just a deliberately chosen one.
Hreflang as a whole has the same boundary. It targets language and region, not currency or content differences within the same language and region, so neither the language rows nor the fallback can separate two audiences who share a code. And the fallback cannot rescue a broken set: if the versions do not list each other reciprocally, search engines may ignore the set, x-default row included.
Common mistakes
- Pointing x-default at a random version. The fallback should be a language selector or your main default page, not whichever URL was nearest to hand.
- Treating x-default as a language row. It is a fallback for the unmatched case, not a version in a language called "default". Each real version still needs its own row.
- Adding the fallback tag to one page only. The set is reciprocal: the tags, fallback included, go into every version's
<head>(or into the sitemap version as one block). - Setting a fallback when no page deserves the job. The row is optional in the generator because it is optional in fact. No fallback beats a bad fallback.
- Forgetting the fallback exists when versions change. If the selector page moves or the default edition changes, the x-default URL has to be updated like any other row.
FAQs
What is x-default for? It names the fallback page for users whose language or region matches none of your versions, often a language selector page or your main English page.
Is x-default required? No. In the generator it is an optional row: you set an x-default URL only if you have one. The language and region versions are the required part of the set.
What should the x-default URL point to? A page that makes sense for a visitor whose language matched nothing: typically a language selector page, or your main English page if that is your default audience's page.
Does x-default replace one of the language versions? No. It sits alongside them as an extra row. Each real language or region version still needs its own row, its own tag and a place in every other version's set.
Tags or sitemap: which implementation is better? Both are equivalent to search engines. Tags are easier for a few pages; the sitemap version scales better and avoids editing every template, which is why this tool generates both.
Conclusion
x-default is the row that answers the visitor your language versions forgot. Name a language selector if you have one, your main English page if that is your default edition, and nothing at all if no page genuinely serves the unmatched case. Build the set with the Hreflang Tag Generator, keep it reciprocal, and the fallback will do its quiet work. For the rest of the set's rules, see the sibling guide Hreflang vs Separate Domains, and browse the full SEO Tools guides for related topics.
References
- Google Search Central, on telling Google about localised versions of a page with hreflang: https://developers.google.com/search/docs/specialty/international/localized-versions
- Google Search Central, on managing multi-regional and multilingual sites: https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites