🚀 Not Getting Enough Leads or Sales? FREE Website Audit & Growth Strategy for Your Business.🚀 Not Getting Enough Leads or Sales? FREE Website Audit & Growth Strategy for Your Business.Email Us for a Website SEO, AI Growth & Digital Transformation Audit — info@webespire.com
Webespire Consulting
☰

International SEO for Next.js: Hreflang, Locales and Routing

How to implement international SEO in a Next.js site: URL structure, locale routing, hreflang through the Metadata API and sitemaps, canonicals and common mistakes.

Regional and language versions of a Next.js website, illustrated by a location pin beside a globe

International SEO in a Next.js site comes down to four technical decisions: a clear URL structure for each language or region, routing that serves the right content at each URL without relying on automatic redirects, hreflang annotations that link equivalent pages together, and canonical tags that point each version to itself. With the App Router, the Metadata API and sitemap files make hreflang straightforward to generate. The common failures are missing return links, canonicals that point every language to English, and redirects based on browser language that stop search engines seeing alternate versions.

Choose a URL Structure

StructureExampleNotes
Subdirectoriesexample.com/fr-ca/Easiest to run on one Next.js deployment; shares domain authority
Subdomainsfr.example.comMore separation; more configuration
Country domainsexample.ca, example.comStrong geographic signal; separate domains to build up

For most B2B sites using Next.js, subdirectories are the practical choice. A Canadian company might use / for English (Canada), /fr-ca/ for French (Canada) and /en-us/ only if US content genuinely differs, for example in pricing or regulations.

Do not create regional versions that are identical apart from a city or country name. Separate versions should serve different audiences with meaningfully different content.

Routing in the App Router

A common pattern is a dynamic segment at the top of the app directory, such as app/[lang]/..., with generateStaticParams listing supported locales so pages are pre-rendered for each. A proxy file (called middleware before Next.js 16) can detect a missing locale and route to a default, but follow this rule: do not automatically redirect users or crawlers away from a URL based on their browser language or IP address. Search engines typically crawl from a limited set of locations and languages, so forced redirects can hide your alternate versions. Show a dismissible language suggestion banner instead.

Implement hreflang

hreflang tells search engines which URLs are equivalent pages in other languages or regions. Each page must list all its alternates, including itself, and every alternate must link back.

In the App Router, use the Metadata API's alternates field in generateMetadata:

export async function generateMetadata({ params }) {
  const { lang } = await params;
  return {
    alternates: {
      canonical: `https://example.com/${lang}/services`,
      languages: {
        "en-CA": "https://example.com/en-ca/services",
        "fr-CA": "https://example.com/fr-ca/services",
        "en-US": "https://example.com/en-us/services",
        "x-default": "https://example.com/en-ca/services",
      },
    },
  };
}

Next.js renders these as link rel="alternate" hreflang tags in the page head. Use valid language codes (ISO 639-1) with optional region codes (ISO 3166-1 Alpha 2). x-default marks the version for users who match no listed locale.

Alternatively, or additionally, provide hreflang in the XML sitemap. Next.js sitemap.js files support an alternates.languages property for each URL. Choose one method as your source of truth to avoid conflicts.

Canonicals

Each language version should have a self-referencing canonical. Pointing the French page's canonical to the English page tells search engines to ignore the French page. Keep canonicals and hreflang consistent: the URLs listed in hreflang should be the canonical URLs.

Translate the Whole Page, Including Metadata

  • Titles, meta descriptions and Open Graph tags in the page language.
  • The lang attribute on the html element set per locale in the root layout.
  • Structured data with localised names and descriptions where relevant.
  • Translated slugs if your strategy uses them, mapped consistently in hreflang.
  • Localised dates, currencies and phone formats.

Machine translation without review often produces weak content; have native speakers review commercial pages, especially French for Canadian audiences.

Include every locale version in sitemaps, link between language versions with a visible language switcher, and keep internal links within the same locale so users and crawlers stay in one language.

Common Mistakes

  • hreflang on some pages but not their alternates (missing return links).
  • Using country codes without language codes, or invalid codes such as en-UK (the correct region code is GB).
  • Canonicals pointing all versions to one language.
  • Automatic geo-redirects that block crawlers.
  • Untranslated metadata on translated pages.
  • Mixing hreflang methods with conflicting values.

Testing

Check rendered HTML for the correct tags on each locale, crawl the site with a tool that validates hreflang reciprocity, and monitor search console reports for indexing of each version. Our technical SEO audit checklist for Next.js websites covers wider checks.

Recommendations

  1. Use subdirectories per locale unless you have strong reasons for separate domains.
  2. Create locale versions only where content genuinely differs.
  3. Generate hreflang and self-referencing canonicals from one locale configuration.
  4. Avoid automatic language or geo redirects; offer a banner.
  5. Translate metadata and structured data, and validate with a crawler.

How Webespire Consulting Can Help

Our technical SEO team implements and audits international setups on Next.js, and our web application development team builds the locale routing and content models behind them. For strategy, read international SEO strategy for global B2B companies.

Frequently Asked Questions

Does Google use hreflang to rank pages?

It uses hreflang to show the most appropriate language or regional version to users, not as a ranking boost.

Do we need separate English versions for Canada and the US?

Only if content differs meaningfully, such as pricing, spelling conventions, legal information or offers.

Can we use the built-in i18n config from the Pages Router?

That configuration belongs to the Pages Router. With the App Router, implement locale routing with a dynamic segment such as [lang] and a proxy (middleware in older versions) for locale detection.

Should translated pages have translated URLs?

It can help users, but it adds complexity. Either approach works if hreflang and canonicals are consistent.

Is Bing support different?

Bing has historically relied more on the content language meta tag and other signals. Setting the html lang attribute correctly helps.

Conclusion

International SEO on Next.js is mostly configuration discipline: clear locale URLs, no forced redirects, complete and reciprocal hreflang, self-referencing canonicals and fully translated metadata. Generate it all from one locale map and validate it with a crawler before launch.

Further Reading

Planning a multilingual Next.js site? Email info@webespire.com or visit webespire.com.