Cogo Site
Back to blog
GOOGLE HREFLANG GUIDE

Google Hreflang Guide: Syntax, Return Tags, and Testing

Hreflang helps Google choose the right localized URL for a searcher. It is easy to misconfigure: unsupported locale codes, missing reciprocal links, canonical conflicts, or a broken x-default can cause Google to ignore annotations. This guide covers the syntax, common failure modes, and a repeatable Search Console validation workflow for 2026.

How Google uses hreflang and why it matters

Hreflang (the rel=alternate hreflang annotation) tells Google which URLs are localized variants of the same page. Google can then choose a URL whose language and region better match the searcher. Hreflang is a signal, not a directive: it does not replace canonical URLs, indexability, or genuinely localized content.

Each localized URL should declare itself and its reciprocal alternates. If an English page points to a Spanish alternate, the Spanish page should point back to the English page. Invalid locale codes, missing return links, canonical conflicts, or alternate URLs that are not crawlable can cause Google to ignore the affected annotations.

Hreflang matters most for multilingual service businesses, cross-border companies, international ecommerce, and any site publishing equivalent pages for different languages or regions. A single-locale site does not need hreflang.

Hreflang syntax: the spec

Hreflang uses the link rel=alternate attribute with an hreflang value. The value combines an ISO 639-1 language code with an optional ISO 3166-1 alpha-2 region code. Examples: en (English, any region), en-US (English United States), zh-CN (Chinese Simplified, Mainland China), zh-TW (Chinese Traditional, Taiwan), es-MX (Spanish Mexico), fil-PH (Filipino Philippines).

The hreflang value is case-insensitive to Google: zh-CN, zh-cn and zh-cN are treated the same. Writing region codes in uppercase follows the ISO convention and improves consistency. The actual requirement is to use valid language and region codes.

For each localized page, include a self-referential hreflang annotation and reciprocal annotations for the available language variants. The x-default annotation is optional and recommended when a fallback or language selector page is useful for visitors with unmatched languages; omitting it does not break hreflang.

Every alternate must be bi-directional. If page A (English) declares page B (Chinese) as its alternate, page B must declare page A as its alternate. Missing return tags is the most common hreflang mistake — Google ignores both directions when one is missing.

The 7 most common hreflang mistakes (and how to fix them)

Mistake 1 — Invalid language or region codes, such as a region without a language or an unsupported region code. Google handles hreflang codes case-insensitively; uppercase region codes are an ISO formatting convention, not an indexing requirement. Fix unsupported codes, not harmless capitalization.

Mistake 2 — Missing return tags. Page A declares page B as alternate, but page B doesn't declare page A. Fix: every alternate must be bi-directional; if you add a new locale, update all existing pages to declare it back.

Mistake 3 — Choosing an unhelpful x-default fallback. x-default is optional; if you provide one, point it to a page that genuinely helps visitors whose languages are not listed, such as a language selector or appropriate default page. Missing x-default alone is not a hreflang error.

Mistake 4 — Hreflang URLs that don't match canonical URLs. If /pricing has canonical /pricing, but its hreflang points to /pricing?utm_source=internal, Google ignores the alternate. Fix: hreflang URLs must match canonical URLs character-for-character.

Mistake 5 — Hreflang on noindex or canonicalized-away pages. Pages blocked from indexing should not declare hreflang. Fix: omit hreflang tags on noindex routes, redirected routes, and pages canonicalized to other URLs.

Mistake 6 — Hreflang to soft-404 or 'locale not available' pages. Don't declare an alternate URL that returns a 'sorry, this page isn't available in your language' message — that's a soft 404 and Google penalizes both directions. Fix: only declare alternates that contain real content; if a page doesn't exist in a locale, don't declare that locale as alternate.

Mistake 7 — Inconsistent locale variants across pages. Page A declares locales en, zh-CN, es, but page B declares only en and zh-CN. Inconsistency confuses Google. Fix: every page that exists in multiple locales should declare all locales where it exists — and no locales where it doesn't.

How to test your hreflang implementation

Step 1 — Inspect the rendered HTML or sitemap annotations. Check valid language codes, the self-reference and reciprocal alternate URLs, and their crawlable destinations. Check x-default only if you chose to provide an optional fallback. Region-code capitalization is a readability convention, not a Google matching requirement.

Step 2 — Google Search Console. The former International Targeting report was deprecated in 2022. Use URL Inspection for individual indexing and canonical checks, and use the Performance report to review search results. Validate hreflang with a crawler or site audit, including return links, locale codes, and alternate URLs. Google still supports hreflang, but this old report is not available.

Step 3 — Ahrefs or Sitebulb crawl. These tools detect hreflang issues at scale — bi-directional tag mismatches across thousands of pages, broken alternates, incorrect locale codes. Run a full-site crawl quarterly.

Step 4 — Manual SERP test. Search for your brand name from different locale-specific devices (use a VPN or Google's country-specific domains like google.com.hk for Hong Kong) and verify the right locale version shows. If you see locale cannibalization (wrong version ranking in wrong region), hreflang is likely the cause.

Step 5 — Check indexing in Search Console. Use URL Inspection on each locale version of a page to confirm Google has indexed all alternates. If a locale version isn't indexed, hreflang isn't passing the signal correctly.

Hreflang best practices for 2026

Best practice 1 — Use language-only codes (en, zh, es) when you don't have region-specific content. Use region codes (en-US, en-GB, zh-CN, zh-TW) only when content genuinely differs by region (currency, legal references, vocabulary). Over-specifying region codes when content is identical creates unnecessary alternates.

Best practice 2 — Consider an optional x-default for unmatched languages, especially for a language selector page. Choose the destination based on the experience you want users to have, not automatically the company's home-country language. A missing x-default does not invalidate valid hreflang alternates.

Best practice 3 — Generate hreflang from a single source of truth (your CMS or website builder). Hand-maintaining hreflang across thousands of pages guarantees drift. WordPress + WPML and Shopify's multilingual features both auto-generate hreflang; choose a builder that does.

Best practice 4 — Keep hreflang URLs clean and stable. Don't include query parameters, session IDs, or tracking parameters in hreflang URLs. Once an alternate URL is published, don't change it without a redirect — Google's hreflang cache takes weeks to rebuild.

Best practice 5 — Audit hreflang after every locale launch, locale removal, or major content migration. Drift happens; hreflang is the canary in the coal mine for multilingual site health.

Where Cogo Site stands on hreflang today

Today, Cogo Site gives you multilingual content editing, AI translation drafts that you review, and a language switcher for your visitors.

Cogo Site does not yet generate hreflang tags or sitemap alternates for the sites you publish, and switching language does not change the page URL.

If your SEO plan depends on separate language URLs with hreflang, Cogo Site is not the right fit yet.

Hreflang quick-reference checklist

  • Each localized version has a self-reference and reciprocal alternates; x-default is optional.
  • Use supported language and region codes; uppercase region codes follow ISO style but Google is case-insensitive.
  • All alternates are bi-directional (page A declares page B and vice versa)
  • Hreflang URLs match canonical URLs character-for-character
  • If x-default is used, direct unmatched-language visitors to a useful fallback or selector.
  • No hreflang on noindex, redirected, or canonicalized-away pages
  • No hreflang to soft-404 or 'locale not available' pages
  • Locale variants are consistent across all pages (no missing locales)

Frequently asked questions

What is hreflang and what does it do?

Hreflang is an HTML link attribute (rel=alternate hreflang) that tells search engines which language and region version of a page to show in which searchers' results. Without hreflang, Google may show the wrong locale version to the wrong searcher — e.g., your Spanish page to an English-speaking searcher — causing bounces and lost rankings. With correct hreflang, each locale version ranks for its target audience. Hreflang is essential for any multilingual site publishing the same content in multiple languages.

How do I write hreflang tags correctly?

For each language variant, include an absolute URL in the hreflang annotations, including the page itself, and make the language links reciprocal. Use supported language codes with optional region codes. Google treats hreflang values case-insensitively, although uppercase region codes follow ISO style. You may add x-default for a suitable fallback page; it is recommended in some cases, not required.

What are the most common hreflang mistakes?

Check for unsupported language or region codes, missing return links, broken alternate URLs, mismatches with canonical/indexable pages, and alternates pointing at unavailable content. Google accepts lowercase and uppercase hreflang values. x-default is optional; use it when a fallback is appropriate. Problems with one pair need not invalidate all other valid reciprocal language pairs.

How do I test if my hreflang is correct?

Five steps: (1) inspect rendered HTML for self-referential, alternate, and x-default tags, (2) use URL Inspection to check individual URLs and canonicals, (3) run a full-site crawl to find missing return links and broken alternates, (4) review locale-specific search results, and (5) verify indexing in Search Console. The old International Targeting report was deprecated in 2022. If the wrong locale appears, investigate hreflang alongside canonicals, crawlability, content, and other signals.

Does hreflang help with Baidu and Bing, or just Google?

Hreflang is honored by Google, Bing, and Yandex. Baidu has historically been less consistent with hreflang — it reads the tags but may take longer to act on them, and Baidu's crawler is slower to discover new alternates. For Baidu specifically, also submit a Chinese sitemap via Baidu Webmaster Tools and ensure correct locale-prefixed URL routing.

See what Cogo Site offers for multilingual sites

Today, Cogo Site gives you multilingual content editing, AI translation drafts that you review, and a language switcher for your visitors. Free to start — no card required.

Related multilingual resources

We use cookies

We use cookies to enhance your browsing experience and analyze site traffic. By clicking 'Accept', you consent to our use of cookies. Learn more about our cookie policy