SEO12 May 2026·10 min read

International SEO with Hreflang Tags

Hreflang syntax, common mistakes, x-default, implementation methods, multi-regional vs multi-language strategies, and Next.js i18n integration.

HreflangInternational SEOi18nLocalizationMulti-LanguageSEO

What Is International SEO?

International SEO is the practice of optimizing your website so that search engines can identify which countries and languages your content targets. Without proper signals, Google may show your English content to Hindi-speaking users in India, or your Indian pricing page to users in the United States.

The hreflang tag is the primary mechanism for telling search engines which language and regional version of a page to show to which users.

Hreflang Syntax

The hreflang attribute uses a specific format: a two-letter language code (ISO 639-1) optionally followed by a two-letter country code (ISO 3166-1 Alpha 2):

`en`: English (any region)
`en-US`: English for United States
`en-GB`: English for United Kingdom
`en-IN`: English for India
`hi`: Hindi (any region)
`hi-IN`: Hindi for India

The language code is required. The country code is optional and used when you have different content for the same language in different regions (e.g., different English content for US and UK audiences).

Multi-Regional vs Multi-Language

Multi-Language Sites

Your content is translated into multiple languages but targets the same market:

`example.com/en/pricing` → English pricing for India
`example.com/hi/pricing` → Hindi pricing for India

Use language-only hreflang codes: en and hi.

Multi-Regional Sites

Your content targets different countries with potentially different languages, currencies, and offerings:

`example.com/en-us/pricing` → USD pricing for US market
`example.com/en-in/pricing` → INR pricing for India market
`example.com/hi-in/pricing` → Hindi pricing for India market

Use language-country hreflang codes: en-US, en-IN, hi-IN.

The x-default Tag

The x-default hreflang value designates the default page for users whose language or region does not match any of your specified versions:

It typically points to your language selector page, your English version, or your most global version
Every set of hreflang tags should include an x-default
It serves as a catch-all for users in unspecified regions

Implementation Methods

HTML Link Tags

Place hreflang link tags in the of each page. Every language version must reference all other versions AND itself:

On your English page, include hreflang links for English, Hindi, and x-default
On your Hindi page, include the same set of hreflang links
The annotations must be reciprocal — if page A references page B, page B must reference page A

XML Sitemap

For sites with many language versions, managing HTML tags becomes unwieldy. Instead, declare hreflang in your XML sitemap using the xhtml:link element within each URL entry. This is the recommended approach for large sites with 50+ pages per language.

HTTP Headers

For non-HTML resources (PDFs, images), use HTTP headers to declare hreflang. Add a Link header with rel="alternate" and the hreflang attribute. This method is rarely needed but essential for documents that do not have an HTML head.

Common Mistakes

Missing Return Links

The most common error. If your English page declares a Hindi alternate but the Hindi page does not declare the English alternate, Google ignores both hreflang annotations. Every page must link to every other version, including itself.

Using Country Codes as Languages

hreflang="in" is wrong. "in" is a country code (India), not a language code. The correct codes are hi for Hindi, en-IN for English targeting India. This mistake is extremely common in Indian market implementations.

Inconsistent URLs

If your hreflang tag points to https://www.example.com/hi/pricing but the actual URL is https://example.com/hi/pricing (without www), Google treats them as different URLs and the annotation fails. Ensure hreflang URLs match canonical URLs exactly.

Mixing Canonical and Hreflang

Each language version should have a self-referencing canonical tag pointing to itself, not to the "main" language version. A common mistake is setting all language versions to canonicalize to the English version, which tells Google to ignore all other versions.

URL Structure Strategies

Three common approaches for international URLs:

Subdirectories: `example.com/en/`, `example.com/hi/` — easiest to implement, shares domain authority, works well for most sites
Subdomains: `en.example.com`, `hi.example.com` — more separation, Google may treat as separate sites, requires more SEO effort per subdomain
Country-code TLDs: `example.in`, `example.co.uk` — strongest geo-targeting signal, most expensive, hardest to manage, splits domain authority completely

For most businesses, subdirectories are the recommended approach. They inherit the main domain's authority and are simplest to manage with a single CMS installation.

Implementation in Next.js

Next.js has built-in internationalization support:

App Router i18n: Use middleware to detect the user's locale and redirect to the appropriate subdirectory. Define supported locales in your middleware configuration.
Static generation: Generate pages for each locale at build time using `generateStaticParams`.
Hreflang generation: Create a utility function that generates hreflang link tags for each page based on the available translations.
Sitemap generation: Include hreflang annotations in your programmatic sitemap using the `xhtml:link` format.

Measuring International SEO Performance

Track these metrics per language/region:

Impressions and clicks: Use Google Search Console's country and query filters
Hreflang validation: Check Google Search Console for hreflang errors in the International Targeting report
Indexing: Verify that each language version is indexed (use `site:example.com/hi/` in Google search)
Ranking position: Track target keywords per market using region-specific rank tracking tools

International SEO is complex but essential for businesses targeting multiple markets. Getting hreflang right is the foundation. Need help implementing international SEO? Contact us.

BH

The Beyond Horizon Team

We are a digital agency based in Ajmer, India, specializing in Next.js web applications, React Native mobile apps, and UI/UX design. 150+ projects delivered.

About Us →

Have a project in mind?

We build fast, SEO-ready web and mobile applications.

Get a Free Consultation