TECHNICAL

International SEO: Hreflang, URL Structure, and Global Strategy

The complete international SEO guide: choosing between ccTLDs, subdomains, and subdirectories; implementing hreflang correctly (including x-default and bidirectional annotations); geotargeting in Google Search Console; and the most common hreflang errors.

International SEO is the practice of structuring and signalling your site so that Google serves the correct language and country version of your pages to users in each target region. Without it, a US-based site with English content may outrank your UK or Australian content in those markets, or your French content may appear in German search results.

URL structure: the most consequential international SEO decision

The first decision is how to structure URLs across countries and languages. There are three options:

1. Country-code top-level domains (ccTLDs)

example.co.uk, example.de, example.fr

ccTLDs send the strongest geotargeting signal to Google — a .co.uk domain is unambiguously targeted at the UK. They also provide a clear brand signal in the URL for users.

Downsides: Each ccTLD is a separate domain — link equity doesn't transfer between example.com and example.co.uk. You must build backlinks independently for each country domain. Domain registration and SSL management for each country adds operational overhead. For new sites, ccTLDs mean starting link building from scratch in each market rather than benefiting from existing domain authority.

2. Subdomains

uk.example.com, de.example.com, fr.example.com

Subdomains are treated mostly independently by Google — they're a strong country/language targeting signal but not quite as definitive as a ccTLD. They're slightly better than subdirectories for isolating crawl issues per country.

Downsides: Like ccTLDs, subdomains somewhat isolate link equity — links to de.example.com don't directly benefit example.com. Setting up and hosting multiple subdomains has some operational overhead.

3. Subdirectories (recommended for most sites)

example.com/uk/, example.com/de/, example.com/fr/

Google's recommended approach for most sites. All content lives under one domain — link equity from every country's content strengthens the overall domain authority, compounding over time. A backlink to example.com/de/produkt/ flows link equity to example.com. Subdirectories are also the simplest operationally: one domain, one SSL certificate, one GSC property.

Downsides: Country targeting signal is weaker than ccTLDs; must be supplemented with hreflang. Some technical teams find it harder to route subdirectory traffic to different servers or CDN edge nodes by country.

4. Query parameters (avoid)

example.com?lang=de, example.com?country=uk

Query parameter-based language switching is the worst option for international SEO: parameters don't reliably signal geotargeting to Google, can create canonicalisation issues, and may be stripped by caches or CDNs. Avoid.

Hreflang: the annotation mechanism

Hreflang is the HTML (or HTTP header) annotation that tells Google which URL serves which language and country combination, and how they relate to each other. Without hreflang, Google must infer the language from page content — which works for language detection but doesn't reliably surface the correct URL in the correct country's search results.

Hreflang syntax

<!-- In the <head> of every page in the international set -->
<link rel="alternate" hreflang="en-us" href="https://example.com/en/" />
<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="fr-fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

hreflang values use IETF language codes with optional region subtags: en (English, any region), en-us (English, United States), en-gb (English, United Kingdom), de (German), de-at (German, Austria), zh-hans (Simplified Chinese), zh-hant (Traditional Chinese).

x-default is the fallback URL shown to users whose language/region doesn't match any other hreflang annotation. Typically the homepage or a language selector page. Required — omitting x-default is a common error.

The bidirectional requirement

Every URL in an hreflang set must reference all the other URLs in the set — including itself. The US English page must have an hreflang tag pointing to itself (hreflang="en-us") and to every other language/country variant. The German page must do the same. This bidirectional confirmation is how Google validates the hreflang cluster.

The most common implementation error: only adding hreflang on the "main" language page but not on the alternate language pages. If example.com/en/ has hreflang pointing to example.com/de/, but example.com/de/ does not have hreflang pointing back to example.com/en/, Google ignores the entire hreflang cluster as invalid.

XML sitemap hreflang (alternative to <head> tags)

For large sites, managing hreflang in every page's <head> is impractical. The sitemap alternative embeds the hreflang annotations in sitemap.xml:

<url>
  <loc>https://example.com/en/page/</loc>
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/en/page/" />
  <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/seite/" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page/" />
</url>

Both methods are supported by Google — use the one that's easier to maintain and update.

Geotargeting in Google Search Console

For subdirectory and subdomain implementations (not ccTLDs — they're inherently geolocated), use Google Search Console's International Targeting settings to associate a subdirectory or subdomain with a country:

GSC → Settings → International Targeting → Country tab → select target country

This is an additional geotargeting signal, most useful for subdomains. For ccTLDs and subdirectory implementations that use hreflang correctly, GSC geotargeting is supplementary.

Common hreflang errors

Missing x-default. The fallback URL is required. Without it, users from countries not covered by any other hreflang tag see the default URL selected by Google rather than a designated landing page.

Non-bidirectional annotations. Only one side of the hreflang pair has the annotations. Google invalidates the cluster.

Canonical conflicts. An hreflang URL that has a canonical pointing to a different URL — Google treats the canonical as the authoritative version and may ignore the hreflang.

Incorrect language codes. en-UK is wrong (should be en-gb — country codes are uppercase in ISO 3166-1, but the standard convention in hreflang is lowercase: en-gb). Invalid language codes cause Google to ignore those specific hreflang annotations.

hreflang on paginated pages. Paginated versions of content (/de/page/2) can be included in hreflang but should canonicalise to the first page. Hreflang on paginated pages should reference the equivalent paginated page in each language, not the first page.

Missing pages in the set. If a page exists in English but hasn't been translated into German yet, don't add a German hreflang pointing to the English page — Google treats cross-language canonicals via hreflang as an error. Either create the German page or omit it from the hreflang set until it's ready.

Run the DeepSEOAnalysis free audit to check hreflang implementation across all crawled pages — bidirectional validation, x-default presence, canonical conflicts, invalid language codes, and missing pages in the hreflang cluster.


Frequently asked questions

What is the difference between hreflang and lang attribute?

The HTML lang attribute on the <html> element (<html lang="en">) tells browsers and screen readers the language of the page content — it's a user experience signal. The hreflang attribute in <link> tags in <head> tells Google which URL is intended for which language/country combination and how multiple URLs relate to each other in an international set. Both should be set: lang for accessibility, hreflang for international SEO.

Do I need hreflang if I only have one language?

If your site has content in only one language but targets multiple countries (e.g. English content for the US, UK, Australia, and Canada), hreflang can still help Google understand which URL to serve in which country. Use region-specific hreflang values (en-us, en-gb, en-au, en-ca) to distinguish between country-targeted versions of the same language. If there's no country-specific version — just one English site for all English speakers — hreflang is less critical, but geotargeting via GSC or ccTLD can still help in specific countries.

Can I use hreflang for a Shopify, WordPress, or Next.js site?

Yes, with platform-specific implementation. Shopify: available via Shopify Markets (multi-language, multi-currency) — hreflang is added automatically per market. WordPress: use a multilingual plugin (WPML, Polylang, TranslatePress) which adds hreflang tags automatically. Next.js: configure i18n in next.config.mjs — Next.js generates hreflang tags for all configured locales automatically when using the built-in i18n routing. Nuxt: use @nuxtjs/i18n module which handles hreflang injection. The DeepSEOAnalysis audit checks hreflang implementation regardless of how it was generated.

What should I do if hreflang is broken on my site?

Identify the specific error type first: (1) Use the DeepSEOAnalysis audit to detect bidirectional failures, missing x-default, and canonical conflicts. (2) Check Google Search Console International Targeting report for detected hreflang errors. (3) Inspect the page source to verify that hreflang tags are in the server-rendered HTML (not added by JavaScript after page load, which may be missed on first-wave crawl). Fix the most widespread errors first — missing bidirectional references are typically the most common and most impactful to fix.

Run DeepSEOAnalysis on your own site.

Free, no signup. Technical SEO, Core Web Vitals, structured data, and AI visibility in one report.

Run a free audit →