Website translation

When and How to Use Hreflang X-Default on Multilingual Pages

When and How to Use Hreflang X-Default on Multilingual Pages
Updated on
March 26, 2026

Hreflang x-default tells search engines which page to show when a user’s language or region doesn’t match any of a website’s specified versions. It’s the safety net that covers gaps in a site’s hreflang setup and directs mismatched visits to a sensible fallback instead of leaving the choice to chance.

The tricky part is knowing when you actually need it. Many sites don’t, and in these cases, adding one simply creates unnecessary work and the possibility of site errors.

This guide breaks down what x-default does, when it genuinely helps, and when you can skip it with confidence. We’ll also explain how our AI translation tool handles standard hreflang for you, removing the possibility of manual mistakes, and keeping your multilingual URLs and sitemaps consistent.

Key Takeaways

  • X-default is a strategic choice based on need – many multilingual sites can function without it.
  • The tag shines when you have a genuine neutral experience, like a selector or global homepage, to catch uncategorized visitors.
  • Poor x-default targeting can confuse search engines, so it’s often safer to omit it than to point it at the wrong page.
  • Thinking in terms of clusters – all variants of one page – makes it easier to decide where x-default fits, if at all.
  • Using a website translation tool like Weglot means standard hreflang is handled for you, leaving you to decide when x-default adds value.

What is the Hreflang X-Default Attribute?

As we’ve seen, the hreflang x-default attribute tells search engines which URL to show when a user’s language or region doesn’t match any of your localized versions. Instead of guessing, Google can fall back to the page you’ve nominated as the neutral option, like a global homepage, language selector, or international version.

Hreflang tag SERP comparison
Standard hreflang tag SERP comparison for US and French users

It works alongside your standard hreflang tags, which map specific URLs to language–region pairs, such as hreflang="en−us" or hreflang="fr−fr". When none of those pairs align with the user’s settings, Google uses the x-default URL as the fallback.

You implement it using the same rel="alternate" link pattern, but with hreflang="x−default", either in the HTML head, HTTP headers, or XML sitemaps. Importantly, x-default doesn’t auto-redirect users; it just tells search engines which version to show in search results when there’s no direct match.

How Does Hreflang X-Default Impact a Website’s SEO and Ranking?

Hreflang x-default helps search engines understand which version of a page to show when there’s no direct language or region match, which keeps your international signals clear. By nominating a neutral fallback, you reduce the chances of Google surfacing a less relevant URL, like a country-specific page that doesn’t fit the user.

This clarity supports your overall hreflang setup, which already prevents duplicate content issues by telling search engines that similar URLs are language variants rather than separate competing pages. A basic hreflang tag looks like this:

<link rel="alternate" hreflang="es" href="https://example.com/es/"/>

Whereas an x-default tag will look like this:

<link rel="alternate" hreflang="x-default" href="https://example.com/" />
When you add x-default in the right scenarios, you tighten that system for edge cases rather than boosting rankings on its own. The payoff is steadier visibility for the right URLs in the right markets, fewer mixed-language results, and a cleaner international SEO footprint for complex setups.”

– Elizabeth Pokorny, Head of Brand and Content at Weglot

What are Common Use Cases and When to Use it?

You use hreflang x-default when you have a clear fallback experience that should catch everyone who doesn’t match a specific language–region pair. Common use cases include:

  • Country or language selectors, where you want users to choose their market from a neutral gateway page.
  • Global catch-all pages, such as an international version of your homepage that works reasonably well for anyone.
  • Dynamic redirects, where the x-default URL is the entry point that then geo or language-redirects based on user signals.
  • Standard pages in a cluster where you have several localized URLs plus one neutral version that’s genuinely suitable as a fallback.

You usually don’t need x-default when:

  • You only have one language version, even if you’re targeting multiple countries.

  • All your traffic comes from regions already covered by your existing hreflang tags.
This is why Weglot does not add x-default automatically, despite handling your hreflang tags for you. Many sites simply don’t need it, and you should only introduce it when one of the above scenarios clearly applies.”

– Eugène Ernoult, CMO at Weglot

Note: Suggest adding Weglot CTA block here

How to Implement Hreflang X-Default

💡 If you use a translation plugin like WPML, Polylang, or TranslatePress, these tags are usually generated automatically. Check your plugin settings for "x-default" before adding code manually.

Here’s a concrete example of a correctly implemented x-default tag in HTML for a homepage with 3 English variants and 1 global fallback:

<link rel="alternate" href="https://example.com/en-gb/" hreflang="en-gb" />
<link rel="alternate" href="https://example.com/en-us/" hreflang="en-us" />
<link rel="alternate" href="https://example.com/en-au/" hreflang="en-au" />
<link rel="alternate" href="https://example.com/" hreflang="x-default" />

⚠️ The current page must always include a link to itself in the list of alternates. If you’re on the US version of the page, the en-us tag must still be present in the code alongside the x-default.

To implement hreflang x-default, you have 3 main options:

Option 1: HTML Tags (Most Common)

In WordPress, you shouldn’t add hreflang tags by editing your header.php directly. Theme files are often overwritten during updates, which can remove your changes.

Instead, output the tags using the wp_head hook. This hook runs inside the <head> of every page and is the standard way to inject metadata in WordPress. Adding your hreflang code through functions.php or a snippets plugin keeps the implementation update-safe and easier to maintain.

Here’s a snippet you can drop in:

add_action('wp_head', 'add_custom_hreflang_tags');
function add_custom_hreflang_tags() {
    echo '<link rel="alternate" href="https://example.com/en-gb/" hreflang="en-gb" />' . PHP_EOL;
    echo '<link rel="alternate" href="https://example.com/en-us/" hreflang="en-us" />' . PHP_EOL;
    echo '<link rel="alternate" href="https://example.com/" hreflang="x-default" />' . PHP_EOL;
}

Option 2: XML Sitemap

  1. Open the XML sitemap that already lists your alternate language URLs.
  2. Locate the <url> block for the page cluster you want to update.
  3. Ensure each localized URL is declared with xhtml:link entries.
  4. Add an extra xhtml:link entry for the fallback URL with hreflang="x-default", for example:
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />

5. Repeat this for each relevant <url> block that has alternates.

Option 3: HTTP Headers

  1. Decide which URL will be your x-default fallback for the cluster.
  2. In your server or CDN config, locate where you define Link headers for hreflang.
  3. Add a new Link header entry for the fallback URL alongside your existing hreflang headers, for example:
Link: <https://example.com/>; rel="alternate"; hreflang="x-default"

4. Apply this configuration to every URL in the hreflang cluster.

5. Test a sample page with a header inspection tool to confirm the Link header is present and correctly formatted.

A typical HTML cluster in your page head will look like a short list of <link rel="alternate"...> rows, one per language plus the single x-default fallback.

{{ebook-banner}}

Best Practices When Implementing Hreflang X-Default

For most setups, the safest x-default target is a neutral page that works for everyone, such as a global language/country selector or an international homepage that isn’t tied to a single market. This keeps Google’s fallback experience aligned with what you’d want a totally unknown visitor to see.

A few best practices help keep things clean:

  • Be consistent: For each hreflang cluster, designate one URL as the x-default and use it across all variants.
  • Use fully qualified URLs: Always include the full protocol and domain (for example, https://example.com/selector/), not relative paths.
  • Include self-referencing tags: Each localized URL should reference itself with its own hreflang value so search engines see a complete, closed cluster.
  • Use precise language–region codes: Stick to valid combinations like en-us or fr-FR, and only add regions when they matter for content differences.

Together, these practices reduce ambiguity, avoid conflicting fallbacks, and make your x-default work as intended. And remember, you can check whether your standard hreflang tags work as intended by popping them through our Hreflang Checker tool.

Weglot’s Hreflang Checker tool homepage

Implement Hreflang X-Default with Confidence Today

The hreflang x-default conundrum is a simple call – either you have a real fallback page for unmatched visitors, or you leave it out and keep your hreflang setup tidy. When you do use it, you’re simply telling Google, ‘If nothing matches, send users here’, which keeps international traffic on the right path.

The hard part isn’t x-default itself, but in maintaining clean, consistent hreflang tagging across every language version and URL. Doing that manually means editing templates, checking every cluster, and hoping nothing breaks when content changes.

Our AI website translation tool handles standard hreflang, translated URLs, and multilingual sitemaps for you, so you’re not wiring that logic by hand. All you’re left to do is decide whether a selector page or global fallback deserves x-default.

If you’re ready to clean up your hreflang setup, start your free 14-day Weglot trial today.

direction icon
Discover Weglot

Join 110,000+ brands already translating their sites with Weglot

Translate your website instantly with AI, refine with human edits, and go live in minutes.

In this article, we're going to look into:
Rocket icon

Ready to get started?

The best way to understand the power of Weglot is to see it for yourself. Test it for free and without any engagement.

The best way to understand the power of Weglot is to see it for yourself. Test it for free and without any engagement.

A demo website is available in your dashboard if you’re not ready to connect your website yet.

Read articles you may also like

FAQ icon

Common questions

No items found.

Blue arrow

Blue arrow

Blue arrow