Hreflang is one of the most technically complex but critically important elements of international SEO. Without it, Google may show US English content to UK visitors, or rank your Spanish pages in France rather than Spain — undermining your entire international expansion.
Hreflang Tag Format
<link rel="alternate" hreflang="en-gb" href="https://domain.com/uk/" /> placed in the <head> of each page. Key components: hreflang attribute (language-country code like en-gb, es-es, fr-fr), the href (canonical URL of that specific version), and x-default (fallback for unmatched countries).
Hreflang Must Be Bidirectional
If Page A has hreflang pointing to Page B, then Page B must have hreflang pointing back to Page A. Broken hreflang chains (one-directional) are one of the most common implementation errors. Use a spreadsheet or tool to verify all hreflang relationships are correctly bidirectional.
Common Hreflang Mistakes
One-directional tags (not bidirectional), hreflang pointing to redirected URLs, using wrong language codes (zh instead of zh-hans/zh-hant for Mandarin), missing x-default tag, hreflang in page body rather than <head>, and canonical tag pointing to a different page than hreflang.
Hreflang via XML Sitemap
For large sites, add hreflang annotations in the XML sitemap rather than every page's <head>. This is easier to maintain and scales well for sites with thousands of pages across multiple languages. Use sitemap hreflang when managing more than 3 language/country combinations.