Hreflang for Growing Startups: When You Need It and How to Ship It

Hreflang tells Google which language or country version of a page to show each searcher. Here is when a startup needs it, the rules Google enforces and how to ship it without errors.

Pixel-art browser window showing a page of results, each searcher sent to the right language or country version.

Hreflang is an HTML attribute that tells Google which language or country version of a page to show each searcher. You need it when the same page exists in two or more languages, or in one language for different regions. Each version lists itself and every other version, with valid codes and full URLs. Get one pair wrong and Google may ignore the set.

Most startups add hreflang too early or too late. Too early means tags on a site with one version of every page. Too late means a UK pricing page that's been losing to the US page for a year because Google can't tell them apart.

This guide covers when you need it, the rules Google actually enforces and how to ship it on a modern stack. There's a worked example on how fast the tag count grows, and a checklist to run before launch.

Key takeaways

  • Only for real alternates. Use hreflang when two or more versions of the same page exist for different languages or regions.
  • Every version lists every version. Each page names itself and all others, or Google may ignore the annotations.
  • Language first. Codes are a language, then an optional region, like en-GB. A region alone is invalid.
  • Pick one method. HTML tags, HTTP headers and sitemaps work the same, so generate tags from one shared list.

What does hreflang actually do?

Hreflang tells Google that a group of pages are versions of each other. One for each language or region. Google then shows each searcher the version that fits them best.

It doesn't make a page rank higher. It helps Google swap in the right version. A searcher in London gets your en-GB page with pounds. A searcher in Madrid gets your es-ES page in Spanish.

One thing surprises people. Per Google's guide to localized versions, "Google doesn't use hreflang or the HTML lang attribute to detect the language of a page." Google reads the visible content to work that out. Hreflang only links the versions together.

Google also says localized pages "are only considered duplicates if the main content of the page remains untranslated." So a real Spanish page isn't duplicate content of your English page. But two English pages for the US and the UK with the same text can look like duplicates. That's where hreflang and a canonical tag work together.

When does a startup need hreflang?

Use this decision rule. You need hreflang when all three are true.

Flow for deciding on hreflang: two versions, a real difference, each self-canonical, then ship generated tags.Flow for deciding on hreflang: two versions, a real difference, each self-canonical, then ship generated tags.
If any step fails, you don't need hreflang yet. Fix the pages first, then add the tags.
  1. You have two or more versions of the same page.
  2. They differ by language, or by region in a way that matters: price, currency, shipping, legal terms or spelling.
  3. Each version is indexable and canonical to itself.

If any line fails, you don't need it yet. A single English site with a currency switcher in the header? No hreflang. A Spanish blog with posts that have no English twin? No hreflang either, because there's nothing to pair.

Here's how common setups map out.

Setup Need hreflang? Why
One English site for everyone No No alternates to link
English plus a full Spanish translation Yes Same pages, two languages
US and UK pages with different prices Yes Same language, region matters
Translated nav, English body text Yes, per Google Google lists this as a case to annotate
Spanish-only blog posts No No twin pages to pair
Currency switcher on one URL No One URL, nothing to point to

What rules does Google enforce?

These come straight from Google's localized versions guide. Break them and the set may be ignored.

Rule What Google says What it means in practice
Return links "Each language version must list itself as well as all other language versions." Every page carries the full set, itself included
Valid codes ISO 639-1 language, optional ISO 3166-1 Alpha 2 region en, en-GB, es-MX are fine
No region alone "You can't specify the country code by itself." GB on its own is invalid
Full URLs Alternates "must be fully-qualified" with https No relative paths
x-default Used "when no other language/region matches" Point it at a selector or main version
One method is enough Using all three methods gives "no benefit in Search" Pick HTML, headers or sitemap

Watch the reserved region codes. Google says codes reserved for something else get that part of the annotation ignored. Google's own example: using EU, UN or UK in hreflang "doesn't have an effect on Google Search." The correct code for the United Kingdom is GB.

How do you ship hreflang?

There are three methods. Google treats them the same, so pick the one that fits your stack.

HTML link tags. Put a link element in the head of every page. Easiest on a modern framework. In Next.js, the metadata API does this for you. The generateMetadata docs show an alternates field with a languages map. It outputs one link tag per language, plus the canonical.

export const metadata = {
  metadataBase: new URL('https://example.com'),
  alternates: {
    canonical: '/en-gb/pricing',
    languages: {
      'en-US': '/pricing',
      'en-GB': '/en-gb/pricing',
      'es-ES': '/es/precios',
      'x-default': '/pricing',
    },
  },
}

HTTP headers. Google says this is "useful for non-HTML files (like PDFs)." Use it for downloads that exist in several languages.

XML sitemap. Each url entry lists every version with xhtml:link elements, itself included. You need the xhtml namespace on the urlset. For big sites, this keeps the head small and puts every pair in one file you can check. See my XML sitemap guide and run the file through our XML sitemap validator.

Whatever you pick, generate the tags from one list of routes and locales. Never type them by hand. Hand-written tags drift the first time someone adds a page. More on the Next.js side in my guide to SEO for Next.js on Vercel.

How should hreflang and canonical tags work together?

Each version should be canonical to itself. The en-GB page's canonical points at the en-GB URL. Not at the US page.

If you canonical every version to the US page, you're telling Google the others are copies. Google then drops them, and the hreflang has nothing to point at. My canonical tags guide covers the full set of rules.

Worked example: how fast the tags add up

Say a startup has 200 pages and launches in more locales over time. Every version needs one tag for each locale plus one for x-default. So the total grows fast.

Column chart of hreflang tags for 200 pages: 1,200 at 2 locales, 2,400 at 3, 4,000 at 4 and 8,400 at 6.Column chart of hreflang tags for 200 pages: 1,200 at 2 locales, 2,400 at 3, 4,000 at 4 and 8,400 at 6.
Worked example: each version lists every locale plus x-default, so tags grow far faster than pages. Worked example from this guide.
Locales Page versions Tags per page Total tags
2 400 3 1,200
3 600 4 2,400
4 800 5 4,000
6 1,200 7 8,400

Going from 2 locales to 6 takes you from 1,200 tags to 8,400. That's 7 times the tags for three times the pages. Nobody keeps that right by hand.

Which hreflang mistakes are most common?

These are the ones I find most in a technical SEO audit.

  • Missing return links. Page A lists B, but B doesn't list A. Google may ignore both.
  • Wrong codes. UK instead of GB. Or a region with no language.
  • Relative URLs. Google wants the full https address.
  • Canonical to one version. Every version should be canonical to itself.
  • Tags on pages that redirect or 404. Point only at live, indexable URLs. If you've moved pages, update the set along with your redirects. Our redirect map builder helps keep the two in step.
  • Auto-redirects by IP. Google's multi-regional sites guide says Googlebot usually crawls from the US and warns, "Don't use IP analysis to adapt your content." Let people switch, don't force them.

Extra versions also cost crawl. If Google has to crawl five copies of every page, your crawl budget guide becomes relevant sooner than you'd think.

How do you check hreflang is working?

Run these checks before and after launch.

  1. Crawl the site and export every hreflang pair. Confirm each pair has a return link.
  2. Check every code against the ISO lists.
  3. Confirm every URL returns 200, is indexable and is canonical to itself.
  4. Use URL Inspection in Search Console to see which canonical Google picked. My Google Search Console guide walks through it.
  5. Watch clicks by country in the Performance report for a month.

If Google keeps picking one version as canonical for all regions, the pages are too alike. Make the regional pages differ in what matters, or merge them. That's a technical SEO call worth making early, before indexing problems pile up. If you're just getting started, SEO for startups covers what to fix first.

What should you do this week?

If you run one version of every page, do nothing. If you run more, check the set.

If you're building an international site from scratch, plan the URL structure and the locale list first. Our website service and SEO and AEO service both start there. The XML sitemap and hreflang set should come out of the same build step.

FAQ

Do I need hreflang if my site is only in English?

Usually not. Hreflang only matters when you have two or more versions of the same page for different languages or regions. If you serve one English page to everyone, there's nothing to point between. You'd need it if you add a UK version with pounds and different shipping, or a Spanish version of the same page.

What is x-default in hreflang?

x-default is a reserved value that names the page to show when no other language or region matches the searcher's browser settings. Most sites point it at a language selector page or at the main English version. It's optional, but it's a good safety net when you serve many locales and can't cover every searcher.

Can I use hreflang with only a country code?

No. Google requires a language code, optionally followed by a region code, such as en or en-GB. A region code on its own, like GB, is not valid. Language codes come from ISO 639-1 and region codes from ISO 3166-1 Alpha 2. Use the UK code GB, not UK, because UK is reserved.

Should hreflang go in the HTML or the sitemap?

Either one. Google treats the HTML link tags, HTTP headers and sitemap methods the same and says using more than one gives no extra benefit. HTML tags are the easiest on a framework like Next.js. The sitemap is cleaner for large sites, because it keeps the head small and puts all the pairs in one file you can check.

Does hreflang help a page rank higher?

Not directly. Hreflang doesn't add ranking strength. It helps Google pick which version of a page to show a given searcher, so a UK visitor sees the UK page instead of the US one. That can raise clicks and conversions because the right price, spelling and currency show up, but it doesn't lift a weak page.

Do hreflang tags need to point back to each other?

Yes. Google says each language version must list itself and every other version. If page A lists page B, page B must list page A. Annotations without these return links may be ignored. This is the most common hreflang error, and it's why generating tags from one shared list is safer than writing them by hand.

More like this

Startup? Let's talk.

20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.