How to use the hreflang tags

Hreflang tells search engines which language or country version of a page to show which searcher. It only works when the set is complete and reciprocal: every version lists every other version, and itself. That is why the generator outputs one block that goes on all of them.

  • Language first, country second. Codes are a language (ISO 639-1, such as en) optionally followed by a country (ISO 3166-1, such as GB). The UK is GB, not UK.
  • Use full URLs. Each URL should be the canonical, indexable version that returns a 200, not a redirect.
  • Pick one method. Tags in the head, HTTP headers or the XML sitemap all work. Using the sitemap keeps large sites manageable; just do not run two conflicting sets.
  • x-default is optional. Use it for a language picker or a global page that catches everyone not covered by a specific version.

For the full explanation with examples, read what hreflang is and how it works. If your site has several markets and the wrong version keeps ranking, that is the core of my international SEO work.