Hreflang

An HTML attribute that tells search engines which language and region a page targets.

Hreflang is an HTML attribute that tells search engines which language and geographic region a specific page is intended for. If your site has content in multiple languages or regional variations (like English for the US vs. English for the UK), hreflang ensures the right version appears in the right search results.

The tag looks like: <link rel="alternate" hreflang="en-us" href="https://example.com/en-us/page" />. You'd add one for each language/region version of the page. You should also include a self-referencing hreflang and an x-default for the fallback version.

Hreflang can be implemented in three ways: HTML link tags in the <head>, HTTP headers (useful for PDFs and non-HTML files), or in your XML sitemap. Pick one method and stick with it — don't mix them.

Getting hreflang wrong is common and can cause issues. Every page you reference must link back to the page that referenced it (bidirectional). Missing return tags are the #1 hreflang error.

Why It Matters for SEO

Without hreflang, search engines might show the wrong language version to users, or treat different language versions as duplicate content. Proper implementation ensures users in France see the French version and users in Germany see the German version.