{"id":7511,"date":"2026-06-09T16:49:26","date_gmt":"2026-06-09T14:49:26","guid":{"rendered":"https:\/\/inspace.io\/blog\/hreflang-tags"},"modified":"2026-06-09T16:49:26","modified_gmt":"2026-06-09T14:49:26","slug":"hreflang-tags","status":"publish","type":"post","link":"https:\/\/inspace.io\/en-us\/blog\/hreflang-tags","title":{"rendered":"Hreflang Tags Explained: Syntax, Examples, Implementation and Common Errors"},"content":{"rendered":"<p>Hreflang tags help search engines understand which language or regional version of a page should be shown to the right user. If your site serves multiple countries, multiple languages, or both, correct hreflang implementation can improve relevance, reduce indexing confusion, and support stronger <a href=\"https:\/\/inspace.io\/seo-services\/international-seo\">International SEO<\/a>. This guide covers what hreflang is, how it works, how to implement it, and the mistakes that most often break it.<\/p>\n<h2>What hreflang tags are<\/h2>\n<p>Hreflang is an attribute used to signal alternate versions of a page for different languages or regions. It tells search engines that several URLs are closely related, but intended for different audiences.<\/p>\n<p>For example, you might have:<\/p>\n<ul>\n<li><strong>en-us<\/strong> for English speakers in the United States<\/li>\n<li><strong>en-gb<\/strong> for English speakers in the United Kingdom<\/li>\n<li><strong>de-de<\/strong> for German speakers in Germany<\/li>\n<\/ul>\n<p>Without hreflang, search engines may struggle to choose the best version for a user, especially when pages are very similar across markets. With it, you make those relationships explicit.<\/p>\n<h2>Why hreflang matters for SEO<\/h2>\n<p>Hreflang does not act like a direct ranking boost, but it plays an important role in SEO. Its main job is to improve matching between searchers and the correct local page.<\/p>\n<ul>\n<li><strong>Better audience targeting<\/strong> &#8211; Users are more likely to land on the version written for their language or market.<\/li>\n<li><strong>Cleaner handling of similar pages<\/strong> &#8211; Regional or translated pages can look highly similar, and hreflang helps search engines understand they are intentional alternatives.<\/li>\n<li><strong>Stronger user experience<\/strong> &#8211; Visitors avoid landing on the wrong currency, spelling, messaging, or regional offer.<\/li>\n<li><strong>Clearer international page relationships<\/strong> &#8211; Search engines can interpret your localized structure more accurately.<\/li>\n<\/ul>\n<p>This becomes especially important for businesses expanding into multiple markets, where localized content, internal linking, and indexing signals need to work together rather than compete.<\/p>\n<h2>What a hreflang tag looks like<\/h2>\n<p>The basic HTML format looks like this:<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;<\/code><\/pre>\n<p>Each part has a specific role:<\/p>\n<ul>\n<li><strong>rel=&#8221;alternate&#8221;<\/strong> identifies the page as an alternate version<\/li>\n<li><strong>hreflang=&#8221;en-us&#8221;<\/strong> specifies the language and optional region<\/li>\n<li><strong>href=&#8221;&#8230;&#8221;<\/strong> points to the correct URL for that version<\/li>\n<\/ul>\n<h2>How hreflang values work<\/h2>\n<p>Hreflang values can target language only or language plus region.<\/p>\n<h3>Language only<\/h3>\n<p>Use a language code when the same version serves all users of that language:<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/example.com\/en\/\" \/&gt;<\/code><\/pre>\n<h3>Language plus region<\/h3>\n<p>Use a language and country code when the page is tailored to a specific market:<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"en-gb\" href=\"https:\/\/example.com\/uk\/\" \/&gt;<\/code><\/pre>\n<p>This is useful when pages differ by currency, product availability, legal details, shipping terms, or local wording.<\/p>\n<h3>x-default<\/h3>\n<p>The <code>x-default<\/code> value is used for a fallback page when no language or regional version is the best match.<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\" \/&gt;<\/code><\/pre>\n<p>This is often used for a global homepage or language selector.<\/p>\n<h2>Correct hreflang implementation rules<\/h2>\n<p>Most hreflang problems come from a few core mistakes. If you get the following rules right, your setup is usually in much better shape.<\/p>\n<h3>Every version should reference all alternatives<\/h3>\n<p>If an English page and a German page are alternates, both pages should include the full set of hreflang references. Search engines use that reciprocity to confirm the relationship.<\/p>\n<h3>Include a self-referencing hreflang tag<\/h3>\n<p>Each page should usually include a hreflang entry for itself. This helps create a complete and consistent cluster.<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"en-gb\" href=\"https:\/\/example.com\/uk\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"de-de\" href=\"https:\/\/example.com\/de-de\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\" \/&gt;<\/code><\/pre>\n<h3>Use valid language and region codes<\/h3>\n<p>Language codes should follow ISO 639-1 and region codes should follow ISO 3166-1 Alpha 2. A common example is using <code>en-gb<\/code> rather than <code>en-uk<\/code>.<\/p>\n<h3>Point hreflang to canonical, indexable URLs<\/h3>\n<p>Your hreflang annotations should reference live canonical URLs, not redirected pages, broken pages, or URLs that declare another canonical target. When canonical and hreflang conflict, search engines may ignore the setup or interpret it unpredictably.<\/p>\n<h2>How to add hreflang tags<\/h2>\n<p>There are three standard implementation methods. You only need one per page type, and consistency matters more than complexity.<\/p>\n<h3>1. HTML head<\/h3>\n<p>This is the most direct option for normal web pages. Add the alternate links inside the <code>&lt;head&gt;<\/code> of each page.<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"en-gb\" href=\"https:\/\/example.com\/uk\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"de-de\" href=\"https:\/\/example.com\/de-de\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\" \/&gt;<\/code><\/pre>\n<p>This works well for smaller sites or where page templates can handle the markup cleanly. It becomes harder to manage as the number of languages and URLs grows. If you&#8217;re using WordPress, our <a href=\"https:\/\/inspace.io\/seo-services\/wordpress-seo\">WordPress SEO<\/a> guide covers implementation details and common pitfalls.<\/p>\n<h3>2. XML sitemap<\/h3>\n<p>For larger <a href=\"https:\/\/inspace.io\/seo-services\/multilingual-seo\">Multilingual SEO<\/a> sites, hreflang in XML sitemaps is often easier to maintain. Instead of placing alternate links in every page template, you manage the relationships centrally.<\/p>\n<pre><code>&lt;url&gt;\n  &lt;loc&gt;https:\/\/example.com\/us\/&lt;\/loc&gt;\n  &lt;xhtml:link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;\n  &lt;xhtml:link rel=\"alternate\" hreflang=\"en-gb\" href=\"https:\/\/example.com\/uk\/\" \/&gt;\n  &lt;xhtml:link rel=\"alternate\" hreflang=\"de-de\" href=\"https:\/\/example.com\/de-de\/\" \/&gt;\n  &lt;xhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\" \/&gt;\n&lt;\/url&gt;<\/code><\/pre>\n<p>This method is often preferred when scaling SEO across many pages, because updates are easier to control in one place.<\/p>\n<h3>3. HTTP headers<\/h3>\n<p>HTTP headers are mainly used for non-HTML files such as PDFs. Since those files do not have a page head, hreflang needs to be delivered in the response header instead.<\/p>\n<h2>Hreflang and canonical tags<\/h2>\n<p>Hreflang and canonical tags solve different problems, but they must work together.<\/p>\n<ul>\n<li><strong>Hreflang<\/strong> tells search engines which page version fits which audience.<\/li>\n<li><strong>Canonical<\/strong> tells search engines which URL is the preferred version when duplicates or near-duplicates exist.<\/li>\n<\/ul>\n<p>A common mistake is setting regional pages as alternates with hreflang, then canonically pointing them all to a single master URL. That sends mixed signals. If your US and UK pages are distinct regional versions, they should normally be self-canonical and connected through hreflang.<\/p>\n<h2>Common hreflang errors to avoid<\/h2>\n<p>You do not need a complex setup to get hreflang wrong. Most failures come from a short list of technical mistakes.<\/p>\n<h3>Missing return links<\/h3>\n<p>If page A references page B, but page B does not reference page A, the hreflang relationship is incomplete.<\/p>\n<h3>Missing self-referencing hreflang<\/h3>\n<p>When a page links to alternates but not to itself, the cluster is weaker and easier to break.<\/p>\n<h3>Invalid codes<\/h3>\n<p>Incorrect language or region values can cause search engines to ignore your annotations entirely.<\/p>\n<h3>Multiple URLs for the same language-market target<\/h3>\n<p>If two pages both claim the same hreflang value, search engines may not know which one to serve.<\/p>\n<h3>Hreflang pointing to non-canonical or broken pages<\/h3>\n<p>Alternate links should not point to redirected, noindexed, canonicalized-away, or 404 pages.<\/p>\n<h3>Using multiple implementation methods carelessly<\/h3>\n<p>HTML, sitemap, and header implementations can all work, but mixing methods without perfect alignment increases the chance of conflicting signals.<\/p>\n<h3>Language mismatch between page content and signals<\/h3>\n<p>If the page content, HTML language attribute, and hreflang point to different languages, search engines receive inconsistent information.<\/p>\n<h2>When hreflang is worth implementing<\/h2>\n<p>Hreflang is useful when you have materially equivalent pages for different languages or markets. Typical examples include:<\/p>\n<ul>\n<li><strong>Translated versions<\/strong> of the same page<\/li>\n<li><strong>Regional variants<\/strong> with different pricing, currency, legal copy, or local messaging<\/li>\n<li><strong>Multinational content hubs<\/strong> where several countries share the same core page with localized differences<\/li>\n<\/ul>\n<p>If you only have one language and one market, hreflang usually is not needed.<\/p>\n<h2>Practical maintenance tips<\/h2>\n<p>Hreflang is not a set-and-forget task. It needs maintenance whenever your site structure changes.<\/p>\n<ul>\n<li><strong>Update hreflang when URLs change<\/strong><\/li>\n<li><strong>Check clusters after migrations or template updates<\/strong><\/li>\n<li><strong>Audit for broken, redirected, or non-canonical targets<\/strong><\/li>\n<li><strong>Review international sections in Google Search Console and crawl reports<\/strong><\/li>\n<li><strong>Keep localized content and internal linking aligned with your market structure<\/strong><\/li>\n<\/ul>\n<p>That last point matters because hreflang works best when it supports a broader multilingual SEO setup, not when it is treated as an isolated tag fix.<\/p>\n<h2>FAQ<\/h2>\n<h3>What are hreflang tags?<\/h3>\n<p>Hreflang tags are signals that tell search engines which language or regional version of a page should be shown to different users.<\/p>\n<h3>What is an example of a hreflang tag?<\/h3>\n<p>A basic example is:<\/p>\n<pre><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/us\/\" \/&gt;<\/code><\/pre>\n<h3>How do I add hreflang tags?<\/h3>\n<p>You can add them in the HTML head of a page, in an XML sitemap, or in HTTP response headers for non-HTML files.<\/p>\n<h3>How do hreflang tags help international SEO?<\/h3>\n<p>They help search engines match the right localized page to the right audience, which improves relevance and reduces confusion between similar regional or language versions.<\/p>\n<p>For teams managing multilingual SEO at scale, hreflang usually performs best as part of broader <a href=\"https:\/\/inspace.io\/features\/technical-optimization\">technical optimization<\/a> that also covers canonical tags, indexing control, localized content structure, and internal linking.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hreflang tags help search engines understand which language or regional version of a page should be shown to the right user. If your site serves multiple countries, multiple languages, or both, correct hreflang implementation can improve relevance, reduce indexing confusion, and support stronger <a href=\"https:\/\/inspace.io\/seo-services\/international-seo\">International SEO<\/a>. This guide covers what hreflang is, how it works, how to implement it, and the mistakes that most often break it.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_title":"","_genesis_description":"","footnotes":""},"categories":[450],"tags":[],"class_list":["post-7511","post","type-post","status-publish","format-standard","hentry","category-seo"],"meta_all":{"rank_math_internal_links_processed":"1","rank_math_title":"Hreflang Tags: Syntax, Examples, Implementation, Errors","rank_math_description":"Learn what hreflang tags are, how they work for international SEO, how to implement them in HTML, XML sitemaps or HTTP headers, and how to avoid common hreflang errors.","meta_title":"Hreflang Tags: Syntax, Examples, Implementation, Errors","meta_description":"Learn what hreflang tags are, how they work for international SEO, how to implement them in HTML, XML sitemaps or HTTP headers, and how to avoid common hreflang errors."},"meta_all_flat":{"rank_math_internal_links_processed":"1","rank_math_title":"Hreflang Tags: Syntax, Examples, Implementation, Errors","rank_math_description":"Learn what hreflang tags are, how they work for international SEO, how to implement them in HTML, XML sitemaps or HTTP headers, and how to avoid common hreflang errors.","meta_title":"Hreflang Tags: Syntax, Examples, Implementation, Errors","meta_description":"Learn what hreflang tags are, how they work for international SEO, how to implement them in HTML, XML sitemaps or HTTP headers, and how to avoid common hreflang errors."},"acf":[],"_links":{"self":[{"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/posts\/7511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/comments?post=7511"}],"version-history":[{"count":0,"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/posts\/7511\/revisions"}],"wp:attachment":[{"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/media?parent=7511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/categories?post=7511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inspace.io\/en-us\/wp-json\/wp\/v2\/tags?post=7511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}