01Three ways to declare it
Google accepts hreflang in HTML <link rel="alternate"> tags, in HTTP headers, or in the XML sitemap. Any one method is enough; they are equivalent [1].
02Codes must be valid
Language codes use ISO 639-1, with an optional region in ISO 3166-1 alpha-2, for example en-GB. A region on its own is not valid [1].
The special value x-default marks the page to show when no other language matches, typically a selector or the global version [1].
03Hreflang is a hint about audience
Google uses hreflang to serve the right version to the right user. It doesn’t move ranking signals between versions or fix duplicate content on its own [2].
Locale-adaptive pages that change content by IP can hide versions from Googlebot, which mostly crawls from the US. Separate URLs per locale are the recommended pattern [2].
04Keep canonicals consistent
Each version should self-canonicalise. A canonical pointing to another language tells Google the pages are duplicates, which conflicts with the hreflang cluster [3][1].
References
- [1]Tell Google about localized versions of your page · Google Search Centraldevelopers.google.com/search/docs/specialty/international/localized-versions
- [2]Managing multi-regional and multilingual sites · Google Search Centraldevelopers.google.com/search/docs/specialty/international/managing-multi-regional-sites
- [3]How to specify a canonical URL with rel="canonical" and other methods · Google Search Centraldevelopers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls