Snoika
Glossary·Technical SEO

What is hreflang

Definition

Hreflang is an HTML attribute that tells search engines which language and region each version of a page is written for.

If you're asking what is hreflang, you mean the hreflang tag in a page's head. It lists every translated or regional copy of a page so Google can show each searcher the copy in their language.

TermHreflang3 min read · reviewed by the Snoika team

Hreflang defined for SEO leads

For a technical SEO lead, hreflang is a set of instructions for international sites, and you'll see it whenever one site serves more than one language or country. A US page and a UK page can share most of their text. Google treats them as alternates of the same page when they use hreflang; without it, Google treats them as rival pages and picks one.

What hreflang signals to Google

Hreflang tells Google that a group of URLs is one piece of content in different languages or regional variants, and it says which audience each URL serves. Google then swaps in the right URL for a searcher in Germany or Mexico. It's a signal and Google can ignore it. Hreflang doesn't raise rankings, and it doesn't stop a page from being indexed.

How hreflang works technically

Each page in a language group lists itself and every alternate, and each entry carries a language code with an optional region code. The language comes in ISO 639-1 format ("de"), and the region comes in ISO 3166-1 Alpha 2 format ("de-AT"). You can place these annotations in the HTML head or in the XML sitemap. HTTP headers are another option for files like PDFs. Google reads all three the same way. Choose one method per site, because mixing them makes errors hard to trace.

Hreflang implementation best practices

To implement hreflang tags, build the full set of URLs for each page first, then publish the annotations on every version.

  1. 011Map every page to its translated or regional equivalents.
  2. 022Use full URLs that include https.
  3. 033Add a self-reference, so each page lists itself among the alternates.
  4. 044Add an x-default entry for searchers who match none of your languages.
  5. 055Audit the site afterwards and confirm every pair links both ways.

Hreflang example in code

This head block belongs on the US English page. The same four lines also appear on the UK and German pages.

<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<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="x-default" href="https://example.com/" />

Hreflang in AI answers

Hreflang affects AI answers only indirectly, through the search index those answers draw on. AI assistants haven't published hreflang rules of their own. When an assistant pulls sources from a search index, clean language signals improve the chance that the site's right local page is cited. Check the cited URL when you test prompts in each market.

Common hreflang mistakes

The most common hreflang mistakes break the links between versions, so Google drops the whole group without telling you.

Missing return links

Google's documentation states, "If two pages don't both point to each other, the tags will be ignored." When page A names page B, page B has to name page A.

Wrong codes and dead URLs

"en-uk" looks right. It's invalid, because the country code for the United Kingdom is "gb". Hreflang pointing to redirected or 404 URLs fails as well.

Canonical conflicts

If a canonical tag points the German page to the English one, it tells Google the German page is a copy. Each version should carry a canonical that points to itself.

Related SEO terms

Once you know what is hreflang, you'll meet canonical tags next. A canonical picks one preferred URL among duplicates, while hreflang keeps every language version alive. The x-default value is part of hreflang and names the fallback page. Geotargeting is the wider practice of serving content by country, and hreflang is one way to do it.

Look up more AI search and SEO terms in our glossary.

Related terms

All terms
Reverse proxyA reverse proxy is a server that sits in front of a website and gets every request before the site's own server does. It decides where each request goes, then sends the answer back to the visitor. A reverse proxy is a gatekeeper on the website's side of the connection. Visitors and crawlers only eveStructured dataStructured data is information arranged in fixed, labeled fields, so a machine can read it without guessing what it means. On a website, the term means schema markup. That's code in a format such as JSON-LD that tells search engines and AI assistants exactly what a page describes, such as a product SubdomainA subdomain is a label added to the left of a registered domain name. It creates a separate address under that domain, such as blog.example.com under example.com. The domain owner can create subdomains at no extra cost and point each one to its own server. A subdomain is a named branch of a domain tOrphan pageAn orphan page is a live page on a website that no other page on the same site links to. Visitors and search engine crawlers can reach it through a direct URL or a sitemap entry. A link from another domain provides the only other route. In SEO, orphan content sits outside the site's internal link structure.Robots.txtRobots.txt is a plain text file at the root of a website. It tells crawlers which URLs they may request. Search engines and AI bots fetch it before they crawl anything else, and the file uses it to ask them to skip certain paths. It can't force a bot to obey, and it doesn't remove pages from search results. Robots.txt contains crawl requests that well-behaved bots choose to follow.

See how AI talks about your brand

Get free audit