ServerField Server operations and website growth
Multilingual SEO Based on Google documentation Updated November 2026

What is hreflang?
Implementation, canonical and x-default

A practical guide to communicating the relationships between language and regional URLs to search engines, covering design, code, common errors and post-launch checks.

Published: January 8, 2025 Last updated: November 3, 2026 Written and verified by Hikaru Ono

We reviewed the current Google Search Central documentation on localized versions, canonicalization, locale-adaptive pages and Search Console on July 29, 2026, and revised outdated information and overstated SEO claims.

hreflang is not a magic tag that directly raises search rankings. It tells Google how language and regional URLs for equivalent content relate, helping it select an appropriate URL for search users. Consistency in translation quality, URL design, canonicalization, indexability and internal links matters too.

The answer in 30 seconds

A correct hreflang implementation shares a complete mapping on each page

For Japanese, English and Traditional Chinese versions, place links for all three on each page. Use fully qualified URLs, include the page itself and ensure reciprocal references.

Core principlesSelf-reference, reciprocal links, fully qualified URLs and consistent link sets
canonicalEach language page should generally point to a canonical URL in the same language
ImplementationChoose one manageable method: HTML, HTTP headers or XML sitemaps
PurposeTell search engines how language and regional URLs for equivalent content relate
Typical usesMultilingual sites, regional pages in one language, and pages with region-specific currency, shipping or products
Key requirementsSelf-reference, reciprocal links, fully qualified URLs and valid language and region codes
Implementation methodsHTML <link>, HTTP Link headers or XML sitemaps
canonicalEach language version generally points to a canonical URL in the same language
x-defaultA fallback URL for users not matched by another language or region annotation
ChecksInspect source, responses or sitemaps, URL Inspection, status 200, indexability, canonicals and return links
Last reviewedJuly 29, 2026

What is hreflang? A way to identify language and regional URL relationships

hreflang is an annotation that tells search engines how URLs for localized versions of the same content relate. For example, Japanese and English versions can be linked as localized versions of one page.

Google may discover other language versions without hreflang, but explicitly identifying the relationships helps it select URLs appropriate to language or region.

When to use it

URLs differ by language or region

  • /ja/ and /en/ have translated pages
  • en-US and en-GB have different prices or shipping terms
  • Equivalent pages span country domains or subdomains
When it is unnecessary

No alternate URL exists

  • Only a Japanese page is published
  • Text switches on the same URL without separate URLs
  • Content is entirely different and the pages are not equivalents

hreflang and the HTML lang attribute serve different purposes

<html lang="ja"> helps browsers and assistive technology identify a document's primary language. hreflang describes relationships between URLs. Google says it determines a page's language algorithmically from its content rather than directly relying on hreflang or HTML lang.

Use both. HTML lang supports accessibility and document semantics; hreflang maps localized URLs.

hreflang is not a direct ranking boost

Showing a suitable language URL can help users understand content and may reduce visits and exits from the wrong language. hreflang alone does not improve content quality or authority. Evaluate traffic and conversions alongside localization quality, search intent, speed, internal links and regional product fit.

Plan URLs first: provide crawlable URLs for each language

Before adding hreflang, make each localized version available at a distinct URL. When content changes only by IP address or Accept-Language, Googlebot may not be able to crawl every language or regional version.

Subdirectories

example.com/ja/
example.com/en/

Often easy to manage within one site.

Subdomains

ja.example.com
en.example.com

Can separate operations and infrastructure, but measurement and management may also be split.

Country-code domains

example.jp
example.co.uk

Clearly indicate regional focus, but each domain requires its own operation, evaluation and cost.

Do not rely solely on automatic redirects

You may suggest a language based on estimated location or browser preferences, but let users and crawlers access each URL directly. Forced redirects that block alternate languages can interfere with crawling, sharing, language switching and travel.

Recommended: Show a language suggestion banner and let users choose. Keep language-switching links available after selection and allow direct 200 responses for each URL.
Example URL cluster
Japanese/ja/product/Self-reference and links to all languages
English/en/product/Output the same complete set
Traditional Chinese/zh/product/Return links are required too
x-default/languages/A language selector or default page

Domains may differ. What matters is that equivalent pages recognize one another and form a consistent group.

Correct hreflang syntax: basic HTML implementation

For HTML pages, inside <head>, use rel="alternate" on <link> elements. The following example links Japanese, English, Traditional Chinese and a language selector.

In the Japanese page's head
<link rel="canonical"
      href="https://example.com/ja/product/" />

<link rel="alternate" hreflang="ja"
      href="https://example.com/ja/product/" />
<link rel="alternate" hreflang="en"
      href="https://example.com/en/product/" />
<link rel="alternate" hreflang="zh-Hant"
      href="https://example.com/zh/product/" />
<link rel="alternate" hreflang="x-default"
      href="https://example.com/languages/product/" />

Include the same four hreflang links on the English and Chinese pages. What changes is each page's own canonical: the English page points to the English canonical and the Chinese page to the Chinese canonical.

1

Include the page itself

On the Japanese page, use hreflang="ja" to reference that page. This is a self-reference.

2

Add return links on the other pages

If Japanese points to English, English should also point to Japanese. A one-way annotation may be ignored.

3

Use fully qualified URLs

/en/product/ is relative; use https://example.com/en/product/, including protocol and host.

4

Link only equivalent pages

Avoid mismatches such as a Japanese product page and an English product listing. Match URLs by search intent and main content.

Choosing language and region codes

Start with an ISO 639-1 language code and add an ISO 3166-1 alpha-2 region code after a hyphen only when needed. A country code cannot be used on its own as a region.

TargetRecommended exampleAvoidReason
Japanese generallyjajpThe first code is a language; a country code alone is invalid for regional targeting
Japanese for Japanja-JPja_JPUse a hyphen, not an underscore
English for the United Kingdomen-GBen-UKGoogle does not use UK as a region code
Traditional Chinesezh-Hantzh-traditionalUse an ISO 15924 script code
Simplified Chinesezh-Hanscncn is a country code, not a language code
General Englishenen-WORLDA language code alone is sufficient without a regional target

ja or ja-JP: which should you use?

For the same page for Japanese speakers worldwide, ja is sufficient. For Japanese prices, shipping, laws or store information specifically aimed at Japan, consider ja-JP. Adding more regional variants is not automatically better; do so when content or terms differ.

Case is generally normalized, but a consistent convention is easier to maintain: ja-JP、en-GB, with a lowercase language and uppercase region code.

Three implementation methods: HTML, HTTP headers and XML sitemaps

Google supports all three without a search advantage for any one method. Choose one that fits your site and operations. Combining methods offers no extra search benefit and can create inconsistencies.

MethodSuitable forAdvantagesConsiderations
HTMLSmall to medium HTML sitesEasy to inspect in source and understand per pageMany languages lengthen the head and require template management
HTTP headersNon-HTML files such as PDFsCan be configured without changing the documentRequires server or CDN configuration and is less visible in a browser
XML sitemapSites with many URLs and languagesMakes centralized mapping easierXML becomes verbose and requires generation and update controls
Is the target a non-HTML file such as a PDF?You cannot use the HTML method for a document without a head.
HTTP headers
Are tens of thousands of URLs and many languages generated centrally?An XML sitemap works well when a CMS or batch process manages the mapping.
XML sitemap
Can you manage templates for ordinary web pages?Prioritize ease of implementation and debugging.
HTML

HTTP header example

Link header in a PDF response
Link: <https://example.com/ja/guide.pdf>; rel="alternate"; hreflang="ja",
      <https://example.com/en/guide.pdf>; rel="alternate"; hreflang="en",
      <https://example.com/guide-selector/>; rel="alternate"; hreflang="x-default"

XML sitemap example

sitemap.xml
<?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/ja/product/</loc>
    <xhtml:link rel="alternate" hreflang="ja"
      href="https://example.com/ja/product/" />
    <xhtml:link rel="alternate" hreflang="en"
      href="https://example.com/en/product/" />
    <xhtml:link rel="alternate" hreflang="x-default"
      href="https://example.com/languages/product/" />
  </url>
  <url>
    <loc>https://example.com/en/product/</loc>
    <xhtml:link rel="alternate" hreflang="ja"
      href="https://example.com/ja/product/" />
    <xhtml:link rel="alternate" hreflang="en"
      href="https://example.com/en/product/" />
    <xhtml:link rel="alternate" hreflang="x-default"
      href="https://example.com/languages/product/" />
  </url>
</urlset>

With a sitemap, include the same alternate URL set inside each localized URL's <url> element. List canonical URLs that return 200 and can be indexed.

How hreflang and canonical work together

hreflang indicates language and regional alternatives; canonical indicates a preferred URL among duplicate or similar URLs. They serve different purposes and cannot replace one another.

Correct example

Each language points to its own language's canonical URL

Japanese page → Japanese canonical
English page → English canonical
Then add reciprocal hreflang references

Avoid

Canonicalizing every language to Japanese

Pointing English or Chinese pages to a Japanese canonical can conflict with the alternate relationships and make those other language URLs less likely to remain in search.

Canonical mapping by language
<!-- Japanese page /ja/product/ -->
<link rel="canonical" href="https://example.com/ja/product/" />

<!-- English page /en/product/ -->
<link rel="canonical" href="https://example.com/en/product/" />

<!-- Use the same hreflang set on both pages -->
<link rel="alternate" hreflang="ja" href="https://example.com/ja/product/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/product/" />

Duplicate URLs in the same language

If an English page is also available with parameters, canonicalize it to the English preferred URL and use that URL in hreflang too. Keep the sitemap, internal links, canonical and hreflang aligned.

Check that the canonical target is not a redirect, 404, noindex page or another language. It is also safer to point hreflang directly to the final canonical URL.

Using x-default for unmatched users

hreflang="x-default" identifies a fallback URL when none of the specified localized versions matches the user's language and region settings. It is a fallback rather than a specific language code.

Suitable URL

Language or country selector

A page where visitors choose language or shipping region is a common x-default use.

Decide carefully

Use English as the default

This is appropriate if the actual policy is to show English to unsupported users, but not merely because an English page exists.

Example with x-default
<link rel="alternate" hreflang="ja-JP"
      href="https://example.com/jp/" />
<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="x-default"
      href="https://example.com/country-selector/" />

x-default is optional. There is no need to add a token fallback when a clear fallback URL does not exist.

Implementing hreflang in WordPress and CMSs

Multilingual features such as WPML or Polylang can generate hreflang in WordPress, but installation alone does not guarantee correctness. Themes, SEO plugins, translation plugins and CDNs can produce duplicates or conflicts.

1

Register equivalent translations in the CMS

Use article identities or translation groups to identify equivalent pages, rather than guessing from URL patterns alone.

2

Choose one output source

Assign responsibility so the theme and multiple plugins do not duplicate hreflang annotations.

3

Do not force links to untranslated pages

Exclude a language URL when a corresponding translation is unavailable. Do not point every page to that language's homepage instead.

4

Synchronize publication state

When a translation is unpublished or its URL changes, update other languages' annotations, sitemaps and internal links too.

Model translation mappings as data in Go or static site generators

Simply substituting a path in a template can fail when slugs differ or translations are missing. It is safer to assign a translation-group ID and generate the set from published languages and canonical URLs.

Example data passed to a template
{
  "translationGroup": "product-123",
  "alternates": [
    {"lang": "ja", "url": "https://example.com/ja/shohin/"},
    {"lang": "en", "url": "https://example.com/en/product/"},
    {"lang": "zh-Hant", "url": "https://example.com/zh/product/"}
  ],
  "xDefault": "https://example.com/languages/product/"
}

Twelve common hreflang errors and fixes

Errors can involve syntax, URL responses, canonicals, indexability and translation relationships. Check them in this order to narrow down causes.

ErrorWhat happensFix
1. Missing return linkA one-way annotation may be ignoredOutput the same complete set on the other page
2. Missing self-referenceThe cluster is incompleteInclude each page's own language URL
3. Relative URLInterpretation can vary by environment or hostUse a fully qualified HTTPS URL
4. Country code aloneJP、US are region codes, not language codesja-JP、en-US: put the language first
5. Invalid region codeen-UK、en-EU may not be recognizedUse an official ISO 3166-1 alpha-2 code
6. 404 or 5xxThe alternate URL is unavailablePoint directly to a public URL that returns 200
7. Redirect URLExtra processing and conflicting signalsPoint directly to the final canonical URL
8. noindexThe alternate URL cannot appear in searchMake it indexable or remove it from the set
9. Canonical points to another languagehreflang and canonicalization conflictCanonicalize to a URL in the same language
10. Page content does not correspondA product detail and a category, for example, do not matchLink pages with corresponding primary content and search intent
11. Methods disagreeHTML and sitemap contain different URL setsUse one method or generate both from the same data source
12. Missed updatesOld references remain after URL changes or removalAdd automated checks and change review to the publishing workflow

Avoid linking every page to each language's homepage

An untranslated article and an English or Chinese homepage do not represent the same page. Omitting that language's hreflang is more accurate. Separately provide a site-wide language switcher or notice about planned translation for users.

Wording may vary, but the purpose should match

Prices, currencies, shipping, contacts, legal information and inventory can naturally differ by region. A product purchase page and an about page, however, are not equivalents. Ask whether each page serves the same purpose for its region.

How to check hreflang without relying only on Search Console

Google Search Console's former International Targeting report has been retired. Do not assume a dedicated hreflang error list exists; combine URL Inspection with checks of actual output.

1

Inspect where annotations are output

For HTML check the original head as well as the rendered DOM; for HTTP inspect response headers; for XML inspect the submitted sitemap.

2

Check responses for all URLs

Check for status 200, robots.txt blocks, noindex and unnecessary redirects.

3

Check set symmetry

Compare language codes and URLs on each page, including self-references, return links and x-default.

4

Check canonical consistency

Use URL Inspection to compare the declared and Google-selected canonical with URLs in hreflang.

5

Observe search results and traffic

Check clicks by country and landing page in Search Console, and review language-specific landing pages and conversions in analytics. Look for unexpected language URLs.

Prelaunch checklist

Equivalent purpose and main contentCheck search intent as well as translation availability
Every page includes itselfThe set contains a self-reference
The same complete set on each pageLanguage additions and removals appear everywhere
Fully qualified HTTPS URLsDo not mix relative or HTTP URLs
All return 200 and are indexableNo 404, 5xx, noindex or blocks
Canonical is in the same languageUse canonical URLs in hreflang too
Standards-compliant codesLanguage and, when needed, region or script
Clear role for x-defaultA selector or actual fallback
Usable language-switching linksUsers can escape forced redirects
Automated checks on updatesDetect broken sets after removal, migration or missing translations

Metrics for evaluation

Before and after implementing hreflang, examine not only ranking but whether visitors land on the intended language URL. Combine country, query and page in Search Console; in analytics review language-specific landing pages, subsequent actions and conversions such as inquiries or purchases.

Do not assert causation: If translations, titles, links or speed also changed, the difference cannot be attributed to hreflang alone. Record change dates and URLs and separate interventions where feasible.

Operational design for large sites

hreflang is often more fragile during later additions, removals and URL changes than at initial implementation. As languages and pages grow, manage it with data and tests instead of manual edits.

A

Use one authoritative mapping

Choose a CMS, database or translation system as the source of truth and generate HTML and sitemaps from it.

B

Track publication state per language

Manage draft, review, published and retired states; include only published canonical URLs in clusters.

C

Check mechanically in CI

Test code formats, self-references, return links, duplicates, HTTP status and canonical consistency.

D

Update changes together during migrations

Switch 301 redirects, canonicals, internal links, sitemaps and hreflang in the same release.

Minimum automated tests

Conditions to check in CI
for each localized page:
  assert canonical is absolute HTTPS URL
  assert canonical language == page language
  assert hreflang set contains self
  assert each language code maps to one canonical URL
  assert all alternate URLs return HTTP 200
  assert no alternate URL is noindex
  assert every alternate page links back
  assert all pages in the group expose the same set

Frequently asked questions about hreflang

Does hreflang improve search rankings?

It does not guarantee a direct ranking increase. It helps Google choose the URL appropriate to a user's language or region. Fewer wrong-language visits may benefit user experience or conversions, but results are not guaranteed.

ja or ja-JP: which is appropriate?

It depends on the target. For Japanese without a regional restriction use ja; for Japan-specific prices, shipping or legal conditions consider ja-JP.

Does each page need a self-referencing hreflang?

Yes. Google's guidance says to include the page itself as well as other language versions, with the same complete set on every page.

Do relative URLs work?

Specify alternate URLs as fully qualified URLs beginning with https://. Pages can be linked across domains.

Can different language pages share one canonical?

Generally avoid this. Point each language version to its canonical in the same language and express language relationships with hreflang.

Is x-default required?

No. Use it when there is a language selector or an actual fallback for users who do not match a specified locale.

Is using both HTML and sitemaps a stronger signal?

Google treats HTML, HTTP headers and XML sitemaps equivalently and says combining all three offers no additional search benefit. Usually choose one maintainable method.

Can Search Console show hreflang errors?

The former International Targeting report has been retired. Use URL Inspection for index status and Google's selected canonical, and verify source, responses, sitemaps and return links yourself.

Conclusion: organize URL mappings and operational rules before adding tags

Successful hreflang depends on accurately managing which pages correspond, not just adding a line of markup. Publish each localized version at a distinct URL, group equivalent pages and align self-references and reciprocal links.

  • Make language and regional URLs directly crawlable
  • Output the same complete set including each page itself
  • Use fully qualified URLs and valid language and region codes
  • Generally point canonical to a preferred URL in the same language
  • Use x-default only when an actual fallback exists
  • Choose a maintainable method from HTML, HTTP headers and XML sitemaps
  • Continuously check status, indexability, canonical and return links after launch

Multilingual SEO requires localization of search terms, wording, prices, trust information and contact paths, not mechanical literal translation. Use hreflang to communicate those well-formed page relationships to search engines.

Author Hikaru Ono

Written and verified by Hikaru Ono I work on website and WordPress development and improvements using Go, HTML/CSS, Flutter and Firebase. This article organizes canonical and return-link checks in the order implementers can use before launch.

Website Production

Discuss website development with Finite Field

Discuss integrated design and development for multilingual URL structures, hreflang and canonical implementation, WordPress sites, fast Go websites, and SEO or performance improvements to existing pages.

Free consultation Multilingual SEO support WordPress and Go support
  • Design URL structures, language switching and translation mappings
  • Develop and improve SEO, accessibility and performance together
  • Recommend CMSs, templates and checks that remain maintainable after launch
Contact

Tell us about your site's current challenges

We can help even if multilingual pages are not being found correctly or you want to coordinate a redesign with SEO.

We will review your current architecture and challenges and suggest an appropriate scope.