Hreflang Tags: Complete Guide to International SEO in 2026
If your website serves users in multiple languages or countries, hreflang tags are one of the most important — and most frequently misimplemented — technical SEO elements you need to get right. This guide covers everything from basic syntax to advanced implementation strategies, common pitfalls, and how language signals now affect AI search engines.
Is your international SEO set up correctly?
Foglift's free website scanner checks your hreflang implementation, meta tags, structured data, and 40+ other technical SEO factors across any URL — with specific recommendations to fix issues.
Scan Your Website FreeThe Basics
What Are Hreflang Tags?
Hreflang tags are HTML attributes that tell search engines which language and optional regional variant a page is written in, and which alternate versions exist for other languages or regions. They were introduced by Google in 2011 and are now supported by Google, Yandex, and increasingly referenced by AI search engines. Bing uses a different mechanism (the content-language meta tag), but also benefits from clear language signaling.
The basic syntax
An hreflang annotation is a <link> element placed in the <head> of your HTML. It specifies the relationship ("alternate"), the language/region code, and the URL of the alternate version:
<link rel="alternate" hreflang="en" href="https://example.com/page" />
<link rel="alternate" hreflang="es" href="https://example.com/es/page" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />The hreflang value uses ISO 639-1 language codes (e.g., en, es, fr) and optionally ISO 3166-1 Alpha-2 country codes (e.g., en-us, en-gb, pt-br).
Language-only vs. language-region codes
Use language-only codes (e.g., en) when your content targets all speakers of that language regardless of location. Use language-region codes (e.g., en-us) when you have region-specific content such as different pricing, currency, spelling conventions, or legal information. You cannot use a region code alone — hreflang always requires a language prefix.
Why It Matters
Why Hreflang Tags Matter for International SEO
Without hreflang tags, search engines are left guessing which version of your content to show which users. This causes three major problems that directly hurt your traffic, rankings, and user experience.
1. Wrong language version in search results
A French user searching on google.fr might see your English page instead of your French version. They bounce immediately, which signals to Google that your page doesn't satisfy the query. Over time, this erodes your rankings in both markets. Hreflang tells Google exactly which URL to serve to French users vs. English users.
2. Duplicate content penalties
If you have example.com/shoes in American English and example.com/en-gb/shoes in British English, search engines may treat these as duplicate pages competing against each other. Hreflang signals that these are intentional regional variants, not copies, preventing them from cannibalizing each other's rankings.
3. Wasted crawl budget
Without clear language signals, search engines may waste crawl budget indexing and re-indexing the wrong versions of your pages. For large multilingual sites with thousands of pages across multiple languages, this can mean significant portions of your site go unindexed. Proper hreflang implementation helps search engines crawl efficiently by understanding the relationship between page variants upfront.
The international SEO opportunity
Over 60% of internet users prefer to browse in a language other than English. Markets like Latin America, Southeast Asia, and Eastern Europe are growing rapidly but remain underserved by English-only content. Companies that properly implement multilingual SEO with correct hreflang tags consistently see 30–50% increases in organic traffic from international markets within 6 months of implementation.
Implementation
Three Ways to Implement Hreflang Tags
There are three methods to declare hreflang annotations. Each is equally valid — choose the one that fits your infrastructure best. Do not mix methods for the same set of pages.
Method 1: HTML link elements (recommended for most sites)
Place <link rel="alternate"> tags in the <head> of every page variant. This is the simplest approach and works well for sites with a moderate number of language versions (up to 20–30 variants per page).
<!-- On https://example.com/page (English version) -->
<head>
<link rel="alternate" hreflang="en" href="https://example.com/page" />
<link rel="alternate" hreflang="es" href="https://example.com/es/page" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" />
</head>Important: Every page must include a self-referencing hreflang tag (pointing to itself) plus links to all alternate versions. This is a bidirectional requirement — if page A links to page B, page B must link back to page A.
Method 2: HTTP headers (for non-HTML files)
For PDFs, documents, or other non-HTML resources that can't contain <link> tags, use the Link HTTP response header:
Link: <https://example.com/page>; rel="alternate"; hreflang="en",
<https://example.com/es/page>; rel="alternate"; hreflang="es",
<https://example.com/de/page>; rel="alternate"; hreflang="de",
<https://example.com/page>; rel="alternate"; hreflang="x-default"This method is configured at the server level (Apache, Nginx, CDN, or edge functions). It works identically to the HTML method but is the only option for non-HTML resources.
Method 3: XML sitemap (best for large sites)
For sites with hundreds or thousands of pages across many languages, declaring hreflang in the XML sitemap is often the most manageable approach. It keeps your HTML clean and centralizes all language annotations in one place:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/page</loc>
<xhtml:link rel="alternate" hreflang="en"
href="https://example.com/page" />
<xhtml:link rel="alternate" hreflang="es"
href="https://example.com/es/page" />
<xhtml:link rel="alternate" hreflang="de"
href="https://example.com/de/page" />
<xhtml:link rel="alternate" hreflang="x-default"
href="https://example.com/page" />
</url>
</urlset>The sitemap method is especially useful when you have many language variants, when your CMS makes it difficult to modify the <head> section, or when you want to manage hreflang separately from your template code.
Which method should you choose?
| Method | Best For | Pros | Cons |
|---|---|---|---|
| HTML link | Small–medium sites | Easy to implement, visible in source | Adds HTML bloat with many languages |
| HTTP header | Non-HTML files (PDFs, docs) | Works for any file type | Requires server config access |
| XML sitemap | Large multilingual sites | Centralized, scalable, clean HTML | Slower discovery by crawlers |
Fallback Handling
Hreflang x-default: The Catch-All Fallback
The x-default value is a special hreflang annotation that designates a fallback page for users whose language or region does not match any of your explicitly declared variants. Think of it as the “else” clause in an if-else statement.
When to use x-default
- Language selector pages: If you have a landing page where users choose their language/region, mark it as x-default.
- Global English version: If your default page serves as a general international version, use x-default to catch users from unspecified regions.
- Automatic redirect pages: If your homepage detects location and redirects to the appropriate version, mark the detection page as x-default.
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Best practice: Always include x-default in your hreflang annotations. Without it, users from unlisted regions may see a random language version. The x-default URL should be accessible, non-redirecting, and useful to users of any language (even if it defaults to English).
Pitfalls
7 Common Hreflang Mistakes (and How to Fix Them)
Hreflang is one of the most error-prone elements in technical SEO. Google's own John Mueller has called hreflang “one of the most complex aspects of SEO.” Here are the mistakes we see most often when auditing international sites.
1. Missing return links (the bidirectional requirement)
Every hreflang annotation must be confirmed by the target page. If your English page declares a Spanish alternate, the Spanish page must declare the English page back. Missing return links cause Google to ignore the entire hreflang cluster for those pages. This is the single most common hreflang error.
2. Wrong language or country codes
Using hreflang="uk" instead of hreflang="en-gb" is wrong — uk is the code for Ukrainian, not United Kingdom English. Similarly, jp is not a valid language code; the correct code for Japanese is ja. Always verify codes against the ISO 639-1 (language) and ISO 3166-1 Alpha-2 (country) standards.
3. Pointing to non-canonical URLs
Hreflang URLs must match your canonical URLs exactly. If your canonical URL is https://example.com/page but your hreflang points to http://example.com/page or https://www.example.com/page, Google will discard the annotation. Ensure consistent protocol (https), subdomain (www vs. non-www), and trailing slashes across all hreflang references.
4. Missing self-referencing hreflang
Each page must include a hreflang tag pointing to itself. This is not optional — it confirms to search engines that this page is the correct version for its declared language/region. A common error is to only list the “other” language versions and forget the current page.
5. Hreflang on noindex or blocked pages
If a page has a noindex directive or is blocked by robots.txt, search engines cannot process its hreflang annotations. This breaks the bidirectional requirement for every page that references the blocked page. Make sure all pages in your hreflang cluster are indexable and crawlable.
6. Mixing implementation methods
Google recommends using only one hreflang method per page set. Declaring hreflang in both HTML link elements and the XML sitemap for the same pages can create conflicting signals. Pick one method and use it consistently across all pages.
7. Incomplete language coverage
If you add a new language version of a page, you must update the hreflang annotations on every existing version to include the new language. Forgetting to update old pages is a common issue that grows worse as you add more languages. Automation through your CMS or a build process is essential for sites with more than a few languages.
Validation
How to Test Your Hreflang Implementation
Hreflang errors are silent — your pages still render normally, but search engines quietly ignore broken annotations. Regular testing is essential. Here's how to validate your implementation.
Google Search Console
Google Search Console's International Targeting report shows hreflang errors including missing return tags, unknown language codes, and unreachable URLs. Check this report at least monthly. The URL Inspection tool also shows which hreflang annotations Google has processed for a specific page.
Manual validation checklist
For each page in your hreflang cluster, verify these items:
- Self-reference exists: The page includes a hreflang pointing to itself.
- Return links confirmed: Every alternate page links back to this page with the correct language code.
- URLs are canonical: All hreflang URLs match their respective canonical tags exactly (protocol, domain, path, trailing slash).
- Language codes are valid: ISO 639-1 language codes and ISO 3166-1 Alpha-2 country codes only.
- Pages are indexable: No noindex, no robots.txt block, HTTP 200 status on all referenced URLs.
- x-default is included: A fallback URL is declared for users not matching any language variant.
- Content matches declared language: The actual page content is in the language declared by the hreflang tag.
Automated testing tools
- Foglift Website Scanner: Scans your site for meta tag issues, hreflang errors, broken links, and 40+ other technical SEO problems in one pass.
- Ahrefs Site Audit: Crawls your entire site and flags hreflang issues including missing return tags, invalid codes, and non-canonical targets.
- Screaming Frog SEO Spider: Desktop crawler with a dedicated hreflang report showing all annotations, missing returns, and inconsistencies.
- Merkle Hreflang Tag Testing Tool: Free online tool that validates hreflang annotations for any URL and checks for common implementation errors.
Pro tip: automate hreflang auditing
Schedule a monthly crawl of your multilingual pages using your site audit tool. As your site grows and languages are added or pages are removed, hreflang errors accumulate silently. A regular technical SEO audit catches issues before they impact rankings.
AI Search
Hreflang and AI Search: How Language Signals Affect GEO
The rise of AI search engines — ChatGPT, Perplexity, Google AI Overviews, and others — adds a new dimension to international SEO. These systems don't just index pages; they synthesize answers from multiple sources. Language signals play a critical role in which sources get selected.
How AI crawlers use language signals
AI search crawlers (GPTBot, PerplexityBot, Google-Extended) use the same language signals that traditional search engines rely on: hreflang annotations, the HTML lang attribute, content-language headers, and the actual language of the content itself. When an AI engine processes a query in Spanish, it prioritizes sources with clear Spanish-language signals. Pages with proper hreflang and lang attributes are more likely to be cited in responses to queries in that language.
Multilingual content as a GEO advantage
Generative Engine Optimization (GEO) is about making your content the preferred source for AI-generated answers. In multilingual contexts, most websites only produce English content. If you create authoritative, well-structured content in Spanish, German, Japanese, or Portuguese with proper hreflang targeting, you face significantly less competition for AI citations in those languages.
Key language signals for AI search
- Hreflang annotations: Tell crawlers which language versions exist and how they relate to each other.
- HTML lang attribute: The
<html lang="es">tag confirms the page's primary language at the document level. - Content-Language HTTP header: Server-level language declaration that reinforces the HTML lang attribute.
- Schema markup with inLanguage: Adding
"inLanguage": "es"to your Article or WebPage schema makes language explicit in structured data. - Consistent content language: The actual text on the page must match the declared language. Machine-translated content with grammar errors can reduce AI citation likelihood.
The AI search localization gap
Most AI search engines currently handle English queries well but provide less comprehensive answers for queries in other languages, simply because there is less structured, authoritative content available. This creates a significant opportunity: if you provide high-quality, AI-optimized content in underserved languages with proper hreflang targeting, your content is more likely to be cited in AI-generated answers for those language markets. See our guide on getting cited by Perplexity for more on this strategy.
Architecture
Hreflang for Different Site Structures
How you structure your multilingual site affects hreflang implementation. There are three common approaches, each with different trade-offs for SEO, maintenance, and user experience.
Subdirectories (example.com/es/, example.com/de/)
The most common and SEO-friendly approach. All language versions live under a single domain, sharing domain authority. Hreflang implementation is straightforward because all URLs share the same root domain. This is the recommended structure for most businesses.
Subdomains (es.example.com, de.example.com)
Subdomains can work but are treated as semi-separate sites by search engines. Domain authority is not fully shared between subdomains, meaning each language version starts with less SEO equity. Hreflang still works across subdomains, but you need to ensure consistent implementation since each subdomain may have its own hosting or CMS configuration.
Country-code top-level domains (example.es, example.de)
ccTLDs provide the strongest country-targeting signal but completely separate domain authority. Each ccTLD must build its own backlink profile and SEO equity from scratch. Hreflang is still necessary to connect the variants and prevent duplicate content issues. This approach is best for large enterprises with strong brand recognition in multiple markets.
URL structure recommendation
For most businesses, subdirectories (example.com/es/) are the best balance of SEO consolidation, implementation simplicity, and maintenance overhead. Combined with proper hreflang tags, this structure keeps all language versions under one domain authority while giving search engines clear language targeting signals. See our on-page SEO checklist for more URL structure best practices.
Step-by-Step
Hreflang Implementation Checklist
Follow this checklist when implementing hreflang tags on a new or existing multilingual site.
- Audit your existing content: Map every page to its language variants. Create a spreadsheet with columns for URL, language code, and canonical URL.
- Choose your implementation method: HTML link elements for small–medium sites, XML sitemap for large sites, HTTP headers for non-HTML resources.
- Verify language/country codes: Use ISO 639-1 for languages and ISO 3166-1 Alpha-2 for countries. Double-check ambiguous codes (ja not jp, zh-tw not tw, en-gb not uk).
- Add self-referencing tags: Every page must include a hreflang pointing to itself with its own language code.
- Add bidirectional links: If page A references page B, page B must reference page A. Verify every pair.
- Add x-default: Designate a fallback page for users whose language/region is not explicitly targeted.
- Align with canonical tags: Ensure every hreflang URL exactly matches the corresponding canonical URL including protocol, domain, path, and trailing slash.
- Set HTML lang attributes: Add
lang="xx"to the<html>element of every page to reinforce the language signal. - Test before launching: Validate with Screaming Frog, Merkle's hreflang tester, or a manual spot check. Fix all errors before going live.
- Monitor in Google Search Console: Check the International Targeting report weekly for the first month, then monthly thereafter.
Frequently Asked Questions
What are hreflang tags and why do I need them?
Hreflang tags are HTML attributes that tell search engines which language and regional version of a page to show to users in different locations. You need them if your website serves content in multiple languages or targets users in different countries with the same language (e.g., English for the US vs. English for the UK). Without hreflang tags, search engines may show the wrong language version or flag your translated pages as duplicate content.
What is hreflang x-default and when should I use it?
The x-default hreflang value designates a fallback URL for users whose language or region doesn’t match any of your specified hreflang annotations. Use it when you have a language selector page, a generic international version, or when you want to catch users from regions you don’t explicitly target. Typically, x-default points to your English-language or global homepage.
Can I use hreflang with a single-language website?
Hreflang tags are only necessary when you have multiple language or regional versions of the same content. If your website is in one language for one region, you don’t need hreflang. However, you can use hreflang with a single language if you target multiple regions (e.g., en-us and en-gb) with different content variations like pricing, currency, or spelling.
How do hreflang tags affect AI search engines like ChatGPT and Perplexity?
AI search engines use language signals including hreflang, HTML lang attributes, and content language to determine which version of your content is most relevant for a user’s query language. Proper hreflang helps AI crawlers understand your multilingual content structure, increasing the likelihood that the correct version is cited in AI-generated answers. This is especially valuable in non-English markets where less optimized content is available.
What are the most common hreflang mistakes?
The most common mistakes are: (1) Missing return links — every referenced page must link back. (2) Wrong language codes — using ‘uk’ instead of ‘en-gb’, or ‘jp’ instead of ‘ja’. (3) Pointing to non-canonical URLs with mismatched protocols or domains. (4) Forgetting self-referencing tags. (5) Adding hreflang to pages blocked by noindex or robots.txt.
Bottom Line
Hreflang tags are the foundation of international SEO. They tell search engines and AI systems which language version of your content to serve to which users, prevent duplicate content issues across regional variants, and ensure your crawl budget is spent indexing the right pages for the right markets.
The implementation is technically demanding — bidirectional requirements, strict code formats, and the need for perfect consistency across all page variants make hreflang one of the most error-prone elements in SEO. But the payoff is substantial: properly implemented hreflang consistently drives 30–50% increases in international organic traffic, and the growing importance of language signals in AI search makes correct implementation more valuable than ever.
Start with an audit of your current implementation. Fix missing return links, validate language codes, align with canonicals, and add x-default. Then test regularly — hreflang errors are silent and accumulate over time as pages are added, moved, or removed. A clean hreflang implementation is a competitive advantage that compounds across every market you serve.
Related guides: