Hreflang Tags Explained

September 5, 2026

a black speaker and a white box

Photo by Angèle Kamp on Unsplash

If your website serves audiences in more than one language or country, a great page can still rank for the wrong people. Hreflang tags help search engines understand which version of a page is intended for each language and regional audience, reducing mismatched search results and helping users land on the most relevant URL.

Whether you manage English pages for the United States and the United Kingdom or Spanish content for Mexico and Spain, hreflang is a core component of international SEO. Used correctly, it clarifies the relationship between equivalent pages without replacing the need for strong localization, crawlable URLs, and sound canonicalization.

What Are Hreflang Tags?

Hreflang annotations are HTML attributes that identify alternate versions of a webpage by language, region, or both. They tell search engines that several URLs contain equivalent or closely comparable content designed for different audiences.

For example, a product page may have versions for English-speaking users in the United States, English-speaking users in the United Kingdom, and Spanish-speaking users in Mexico. Hreflang annotations connect these URLs as an international page set.

Google treats hreflang annotations as signals rather than guaranteed directives. That means the annotations should be accurate, reciprocal, indexable, and consistent with your site architecture. Search engines may still use other relevance signals, such as the searcher’s language, location, query, and browser settings, when choosing a result.

Language Targeting vs. Language-Region Targeting

The first decision is whether your content differs by language alone or by both language and country. Your targeting should reflect the actual audience and content—not simply where you hope to rank.

  • Language targeting uses a language code, such as en, es, or fr. Use it when one version serves speakers of that language regardless of country.
  • Language-region targeting combines a language and region code, such as en-US, en-GB, or es-MX. Use it when pages differ by market, currency, spelling, pricing, regulations, inventory, or local messaging.

For instance, an en-US page may use dollars, American spelling, and U.S. shipping information, while an en-GB page uses pounds, British spelling, and UK delivery terms. Even though both pages are in English, they address distinct search audiences.

Hreflang values should use valid ISO language codes and, where appropriate, valid ISO country or region codes. A common mistake is using country-only values such as US; hreflang needs a language code first, as in en-US.

Three Ways to Implement Hreflang

You can implement hreflang through HTML link elements, HTTP headers, or XML sitemaps. Choose one method that your team can maintain consistently. Large sites often prefer XML sitemaps, while standard HTML pages commonly use link elements in the <head>.

HTML Link Elements

Add alternate links to the <head> section of every page in an equivalent set:

<link rel="alternate" hreflang="en-US" href="https://example.com/us/page/">
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/page/">
<link rel="alternate" hreflang="es-MX" href="https://example.com/mx/page/">

This approach is straightforward for CMS-driven sites, but templates must reliably output the correct tags on every relevant page.

HTTP Headers

HTTP header annotations are useful for non-HTML files, such as PDFs, or when editing page markup is impractical. Your server returns a Link header containing the alternate URLs and hreflang values. Because headers can become difficult to manage at scale, validate them carefully with a crawler or header inspection tool.

XML Sitemaps

XML sitemaps can list each URL and its alternate language or regional versions. This is often efficient for ecommerce sites, publishing platforms, and websites with thousands of international URLs. Keep the sitemap current, include only canonical indexable URLs, and submit it through Google Search Console.

Required Hreflang Rules for a Valid Setup

Hreflang works best when every URL in a language cluster sends a clear and matching message. Follow these technical SEO rules:

  • Use self-referencing tags: Every page should include an hreflang annotation pointing to itself. The U.S. page references the U.S. page, the UK page references the UK page, and so on.
  • Include reciprocal return links: If Page A identifies Page B as an alternate, Page B should identify Page A in return. Every alternate URL should generally reference itself and all equivalent alternates reciprocally.
  • Align canonicals and hreflang: An hreflang URL should normally be the canonical version of that localized page. Do not point en-GB to a URL that canonicals to en-US; this creates conflicting signals.
  • Use fully qualified URLs: Include the full protocol and domain, such as https://example.com/uk/page/, not relative paths such as /uk/page/.
  • Reference indexable URLs: Alternate pages should return a successful HTTP status, be accessible to crawlers, and not be blocked by robots.txt, a noindex tag, or login requirements.

When and How to Use x-default

The x-default value identifies the fallback page for users who do not match one of your specified language or regional versions. It is especially useful for language selectors, country selectors, or a global landing page that lets visitors choose their preferred market.

For example, if your site has en-US, en-GB, and fr-FR versions, an x-default annotation can point to a country selection page for everyone outside those targets. It does not mean “English by default”; it means “the best fallback URL when no targeted version fits.”

Common Hreflang Errors to Avoid

International ranking problems frequently stem from configuration errors rather than content quality. Audit for these issues:

  • Invalid language or region codes: Use recognized ISO-based values and correct formatting, such as es-MX, not invented variants.
  • Missing return tags: One-way hreflang references can prevent search engines from confirming the relationship between pages.
  • Conflicting canonical tags: A page listed as an alternate but canonicalized elsewhere sends mixed indexing signals.
  • Non-indexable alternate URLs: Redirects, 404 errors, noindex directives, blocked pages, and soft 404s undermine implementation.
  • Incorrect regional targeting: Do not use country targeting merely because a URL has a country folder. Match the code to the intended language and market.
  • Incomplete page sets: Product, category, article, and pagination equivalents should be mapped consistently rather than all pointing to a homepage.

How to Test and Monitor Hreflang

Start with Google Search Console. Review page indexing reports for crawl, redirect, canonical, and noindex problems affecting alternate URLs. Submit your XML sitemap if that is your implementation method, then inspect representative localized pages to confirm Google can crawl and index their canonical versions.

Next, use an SEO crawling tool to review hreflang annotations at scale. Check for missing self-references, missing reciprocal links, invalid codes, URLs returning non-200 status codes, conflicting canonicals, and inconsistent alternate sets. Re-crawl after template releases, URL migrations, CMS changes, or regional site launches.

Monitor organic traffic, impressions, clicks, and landing-page performance by country and query language. A technically valid implementation is only one part of international visibility; each localized page should also provide meaningful market-specific content and a strong user experience.

Hreflang FAQ

What is the difference between hreflang and a canonical tag?

A canonical tag identifies the preferred URL among duplicate or near-duplicate pages. Hreflang identifies alternate URLs intended for different languages or regions. Canonicals consolidate duplicate signals; hreflang helps search engines select the right localized version. In most international setups, each localized page has a self-referencing canonical and participates in a reciprocal hreflang set.

Do I need hreflang tags if my pages are written in the same language for different countries?

Usually, yes, if each page is specifically designed for a different country or region. English pages for the U.S., UK, Canada, or Australia can benefit from en-US, en-GB, en-CA, and en-AU annotations when their content or commercial offering differs by market.

Where should hreflang tags be placed: HTML, XML sitemap, or HTTP header?

All three are valid methods. HTML is convenient for typical web pages, XML sitemaps are practical for large URL inventories, and HTTP headers suit files such as PDFs. Use the method your technical team can maintain accurately; avoid contradictory implementations across methods.

What does x-default mean in hreflang?

x-default marks a fallback URL for visitors whose language or region does not match another hreflang value. It commonly points to a language selector, country selector, or global version of a page.

How do I fix missing return tags or conflicting hreflang annotations?

Create a complete URL map for every equivalent page set. Add the same set of alternate URLs—including self-references—to each corresponding page, ensure every target is crawlable and indexable, and make each page’s canonical point to itself. Then validate the updated implementation with an SEO crawler and Google Search Console.

Ready to see how your site stacks up? Run a free SEO audit and get a clear picture of what's holding your rankings back.

Want to know how your site stacks up?

Get a free instant SEO audit...

Get Your Free Audit →
Share this article:X / TwitterLinkedInFacebook