{"id":28044,"date":"2019-06-06T16:12:50","date_gmt":"2019-06-07T00:12:50","guid":{"rendered":"https:\/\/ahrefs.com\/blog\/?p=28044"},"modified":"2025-12-18T08:44:06","modified_gmt":"2025-12-18T13:44:06","slug":"hreflang-tags","status":"publish","type":"post","link":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/","title":{"rendered":"Hreflang: The Easy Guide for Beginners"},"content":{"rendered":"<div class=\"intro-txt\">If your website has content in multiple languages, then you must understand and use the hreflang attribute.&nbsp;In this post, we\u2019ll cover everything from the basic concept, to implementation, to troubleshooting common issues.&nbsp;<\/div>\n<p>Hreflang is a simple HTML attribute, but it can be challenging to get to grips&nbsp;with.<\/p>\n<p>Google\u2019s John Mueller described hreflang as \u201cone of the most complex aspects of SEO\u201d because it gets \u201creally hard quickly.\u201d<\/p>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"en\">\n<p dir=\"ltr\" lang=\"en\">TBH hreflang is one of the most complex aspects of SEO (if not the most complex one). Feels as easy as a meta-tag, but it gets really hard quickly.\u2014 John (@JohnMu) <a href=\"https:\/\/twitter.com\/JohnMu\/status\/965507331369984002?ref_src=twsrc%5Etfw\">February 19,&nbsp;2018<\/a><\/p>\n<\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>When we ran a <a href=\"https:\/\/ahrefs.com\/blog\/hreflang-study\/\">study on hreflang<\/a> across 374,756 domains, we found that 67% of the hreflang implementations had issues. Here are the most common issues:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/08\/hreflang-study-1.png\" alt=\"Most common hreflang issues\">But don\u2019t let that put you off. Hreflang isn\u2019t that complicated to understand, and you can <strong>automate<\/strong>&nbsp;it to a large extent. (We\u2019ll talk about that later&nbsp;on.)<\/p>\n<p>Here\u2019s everything you\u2019ll learn in this&nbsp;guide:<\/p>\n<ul>\n<li><a href=\"#what-is-hreflang\">What the hreflang attribute is<\/a><\/li>\n<li><a href=\"#why-hreflang-matters\">Why hreflang matters for&nbsp;SEO<\/a><\/li>\n<li><a href=\"#hreflang-syntax\">What hreflang looks&nbsp;like<\/a><\/li>\n<li><a href=\"#how-to-construct-hreflang\">How to construct a hreflang tag<\/a><\/li>\n<li><a href=\"#how-to-implement-hreflang\">How to implement hreflang<\/a><\/li>\n<li><a href=\"#how-to-automate-hreflang\">How to semi-automate hreflang implementation<\/a><\/li>\n<li><a href=\"#how-to-find-and-fix-hreflang-issues\">How to find and fix hreflang issues<\/a><\/li>\n<li><a href=\"#hreflang-issues-google-ignores\">Problems Google may ignore<\/a><\/li>\n<li><a href=\"#redirecting-users-issues\">Why you should be careful redirecting users<\/a><\/li>\n<\/ul>\n<div class=\"hub-link\"><img decoding=\"async\" alt=\"Beginner's guide to technical SEO\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/svg\/4.svg\"><div class=\"hl-title\">New to technical SEO? Check out&nbsp;our<\/div><div class=\"hl-content\"><a href=\"https:\/\/ahrefs.com\/blog\/technical-seo\/\" target=\"_blank\">Beginner\u2019s guide to technical SEO<\/a><\/div><\/div>\n<h2 id=\"what-is-hreflang\">What is hreflang?<\/h2>\n<p>Hreflang is an HTML attribute used to specify the language and geographical targeting of a webpage. If you have multiple versions of the same page in different languages, you can use the hreflang tag to tell search engines like Google about these variations. This helps them to serve the correct version to their&nbsp;users.<\/p>\n<p>For example, if we Google \u201capple official website\u201d in the US, this is the first result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"138\" class=\"wp-image-32020\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/apple-us.png\" alt=\"apple us\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/apple-us.png 900w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/apple-us-680x104.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/apple-us-768x118.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\"><\/p>\n<p>If we do the same in Spain, we see this version of the&nbsp;page:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"119\" class=\"wp-image-32023\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/apple-spain.png\" alt=\"apple spain\"><\/p>\n<p>Hreflang makes this possible.<\/p>\n<h2 id=\"why-hreflang-matters\">Why does hreflang matter for&nbsp;SEO?<\/h2>\n<p>If you\u2019ve spent time translating your content into multiple languages, then you\u2019ll want search engines to show the most appropriate version to their&nbsp;users.<\/p>\n<p>Both Google and <a href=\"https:\/\/yandex.com\/support\/webmaster\/yandex-indexing\/locale-pages.html\" target=\"_blank\" rel=\"noopener noreferrer\">Yandex<\/a>&nbsp;look at hreflang tags to help do&nbsp;this.<\/p>\n<p>Bing <a href=\"https:\/\/twitter.com\/facan\/status\/1304120691172601856\">says<\/a> hreflang is a weak signal for them and that they mostly rely on the <a href=\"https:\/\/www.w3.org\/International\/questions\/qa-html-language-declarations\" target=\"_blank\" rel=\"noopener noreferrer\">content-language HTML attribute<\/a>, links, and who\u2019s visiting your site to discern language. However, they still recommend that you use it in their <a href=\"https:\/\/www.bing.com\/webmasters\/help\/webmaster-guidelines-30fba23a\">official documentation<\/a>.<\/p>\n<div class=\"sidenote\"><div class=\"sidenote-title\">Sidenote.<\/div>&nbsp;Baidu doesn\u2019t look at hreflang tags. They rely on the content-language HTML attribute.<\/div>\n<p>Catering to the native tongue of search engine users also improves their experience. That often results in fewer people clicking away from your page and back to the search results (i.e., higher <a href=\"https:\/\/ahrefs.com\/seo\/glossary\/dwell-time\" data-ahr=\"https:\/\/ahrefs.com\/blog\/dwell-time\/\">dwell time<\/a>), a lower <a href=\"https:\/\/ahrefs.com\/blog\/bounce-rate\/\" target=\"_blank\" rel=\"noopener\">bounce rate<\/a>, a higher time on page, etc.\u2014all that other good stuff that we believe has a positive impact on SEO and rankings.<\/p>\n<p>But as Google\u2019s Gary Illyes alludes to in <a href=\"https:\/\/youtu.be\/6ewntnqltI4?t=335\" target=\"_blank\" rel=\"noopener noreferrer\">this video<\/a>, hreflang tags can also have a direct effect on rankings because pages in a hreflang cluster share each other\u2019s ranking signals in certain scenarios. For example, duplicate pages may consolidate signals. Hreflang is one of <a href=\"https:\/\/ahrefs.com\/blog\/canonicalization\/\">~40 canonicalization signals<\/a>. This leads to an interesting trade-off where having the same content may create a stronger page because of the duplicate consolidation, but then the wrong page might show in the SERPs. It\u2019s why I mostly push for a single page for each language with dynamic personalization based on the country.<\/p>\n<p>The page that is the best match will determine the ranking position, but search engines will try to swap and show the most relevant page for a user in the SERPs. That doesn\u2019t mean that all the pages in the cluster share signals, but for ones like a brand term or a term used in multiple languages, then the ranking will be based on the top page, but swapped to show the most relevant page. i.e. a search for \u201cAhrefs\u201d in Japan would probably have the English version of the page as the one with the highest ranking which would determine the position, but in the re-ranking process would swap to show the Japanese page. \u201cLink building\u201d is also a term used in multiple languages, so our English page on the topic is probably the strongest and the one that would determine the ranking position for a user searching in Spanish, but then the page shown in the SERPs would likely be swapped to show our Spanish page for&nbsp;them.<\/p>\n<div data-mode=\"normal\" data-oembed=\"1\" data-provider=\"youtube\" id=\"arve-youtube-6ewntnqlti4\" style=\"max-width:900px;\" class=\"arve\">\n<div class=\"arve-inner\">\n<div style=\"aspect-ratio:500\/281\" class=\"arve-embed arve-embed--has-aspect-ratio\">\n<div class=\"arve-ar\" style=\"padding-top:56.200000%\"><\/div>\n<p>\t\t\t<iframe allow=\"accelerometer 'none';autoplay 'none';bluetooth 'none';browsing-topics 'none';camera 'none';clipboard-read 'none';clipboard-write;display-capture 'none';encrypted-media 'none';gamepad 'none';geolocation 'none';gyroscope 'none';hid 'none';identity-credentials-get 'none';idle-detection 'none';keyboard-map 'none';local-fonts;magnetometer 'none';microphone 'none';midi 'none';otp-credentials 'none';payment 'none';picture-in-picture;publickey-credentials-create 'none';publickey-credentials-get 'none';screen-wake-lock 'none';serial 'none';summarizer 'none';sync-xhr;usb 'none';web-share;window-management 'none';xr-spatial-tracking 'none';\" allowfullscreen class=\"arve-iframe fitvidsignore\" credentialless data-arve=\"arve-youtube-6ewntnqlti4\" data-lenis-prevent data-src-no-ap=\"https:\/\/www.youtube-nocookie.com\/embed\/6ewntnqltI4?start=335&amp;feature=oembed&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;autohide=1&amp;playsinline=0&amp;autoplay=0\" frameborder=\"0\" height=\"505.8\" loading=\"lazy\" name referrerpolicy=\"strict-origin-when-cross-origin\" sandbox=\"allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox\" scrolling=\"no\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/6ewntnqltI4?start=335&amp;feature=oembed&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;autohide=1&amp;playsinline=0&amp;autoplay=0\" title width=\"900\"><\/iframe><\/p><\/div>\n<\/div>\n<\/div>\n<p>That in itself should be a compelling enough reason to implement hreflang where appropriate.<\/p>\n<p>Still, there\u2019s one other reason why hreflang attributes are important: <strong>duplicate content<\/strong>.<\/p>\n<p>Say that you have two versions of your page: one targeting UK readers with British English spellings, and one targeting US readers with American English spellings. These two pages are almost identical, and thus, Google may see them as duplicate content and choose one version to&nbsp;index.<\/p>\n<p>Hreflang tags help Google to understand the relationship between these pages. They will try to show the correct version shown in search results, but it is not guaranteed. Hreflang tags are a signal, not a directive.&nbsp;It\u2019s still best practice to localize the content of pages that use the same language within an hreflang cluster. You can do this by localizing pricing (e.g., USD vs. GBP), language variants (e.g., trashcan vs. bin for US vs. the UK), and so forth. This is not a concern for translated pages since they are not considered duplicates by Google.<\/p>\n<h2 id=\"hreflang-syntax\">What does a hreflang tag look&nbsp;like?<\/h2>\n<p>Hreflang tags use simple and consistent syntax:<\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"<em>x<\/em>\" href=\"https:\/\/example.com\/alternate-page\" \/&gt;<\/code><\/p>\n<p>Here\u2019s what each part of that code means in plain English:<\/p>\n<ol>\n<li>link rel=\u201calternate\u201d:&nbsp;The link in this tag is an alternate version of this&nbsp;page.<\/li>\n<li>hreflang=\u201cx\u201d: It\u2019s alternate because it\u2019s in a different language, and that language is <em>x<\/em>.<\/li>\n<li>href=\u201chttps:\/\/example.com\/alternate-page\u201d: The alternate page can be found at this&nbsp;URL.<\/li>\n<\/ol>\n<h2 id=\"how-to-construct-hreflang\">How to construct a hreflang tag<\/h2>\n<p>Constructing a hreflang tag is as simple as looking up the code for your chosen language and filling in the tag. Hreflang supports any two-letter ISO 639-1 language code. (See a full list of them <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.)<\/p>\n<p><strong>Example: <\/strong><\/p>\n<p>Say that we wanted to add a hreflang tag from <a href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\">the English version of our blog post about free keyword tools<\/a>&nbsp;to <a href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\">the German version<\/a>. This is the hreflang tag we\u2019d end up&nbsp;with:<\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"de\" href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\" \/&gt;<\/code><\/p>\n<p>All we did was fill in the language code (de for Germany) and&nbsp;URL.<\/p>\n<h3>Targeting a locale (optional)<\/h3>\n<p>While it\u2019s fine to specify a language and leave it there, hreflang tags also support the addition of a region or country. This&nbsp;is also a two-letter code, but this time it\u2019s in the ISO 3166-1 alpha-2 format (<a href=\"https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1_alpha-2\" target=\"_blank\" rel=\"noopener noreferrer\">full list<\/a>). You only need to add this when you wish to target speakers of a particular language in a particular locale. For example:<\/p>\n<p><strong>English speakers in the&nbsp;UK:&nbsp;<\/strong><\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"en-gb\" href=\"https:\/\/example.com\/<strong>uk<\/strong>\/hello\" \/&gt;<\/code><\/p>\n<p><strong>English speakers in the&nbsp;US:&nbsp;<\/strong><\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/<strong>us<\/strong>\/hello\" \/&gt;<\/code><\/p>\n<p>You can see that the syntax here is: hreflang=\u201clanguage-country.\u201d<\/p>\n<div class=\"recommendation\"><div class=\"recommendation-title\">Why you might need to specify both<\/div><div class=\"recommendation-content\">\n<p>Imagine that you run an ecommerce store selling a single product. Your store ships to both the US and the UK, both of which are predominantly English-speaking countries. However, customers in the US want to buy in dollars, whereas customers in the UK want to buy in pounds.<\/p>\n<p>To solve this problem, you create two versions of your product page. One displays the price in dollars, the other in pounds.<\/p>\n<p>Pricing aside, these two pages are identical, so you need to use hreflang tags to signal to search engines why the two versions exist.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"630\" class=\"wp-image-32021\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-image.png\" alt=\"hreflang image\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-image.png 900w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-image-607x425.png 607w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-image-768x538.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\"><\/p>\n<p>There may also be times when you need to do things the other way around: i.e., target speakers of multiple languages in the same country.<\/p>\n<p>For example, imagine that you have a blog post about budget road trips in Canada. Canada has two official languages: English and French. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Languages_of_Canada\" target=\"_blank\" rel=\"noopener noreferrer\">56.9% and 21.3%<\/a>&nbsp;of Canadians speak English and French respectively, so it\u2019s probable that you\u2019ll benefit from having two variants of this&nbsp;post.<\/p>\n<\/div><\/div>\n<h2 id=\"how-to-implement-hreflang\">The basics of&nbsp;hreflang implementation<\/h2>\n<p>Hreflang tags are reasonably simple to implement, and we\u2019ll discuss three methods for doing that in a moment. But no matter which method you opt for, there are three golden rules that you must remember at all&nbsp;times.<\/p>\n<h3>Rule #1: Hreflang tags are bidirectional<\/h3>\n<p>It\u2019s critical to understand that hreflang tags work in pairs. In other words, if you add a hreflang tag to an English page pointing to the Italian variant, then the Italian variant <strong>must<\/strong>&nbsp;return the favor with a hreflang tag pointing to the English page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"833\" class=\"wp-image-32026\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-to-implement-hreflang-tags-correctly.png\" alt=\"how to implement hreflang tags correctly\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-to-implement-hreflang-tags-correctly.png 900w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-to-implement-hreflang-tags-correctly-459x425.png 459w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-to-implement-hreflang-tags-correctly-768x711.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\"><\/p>\n<p>This proves to search engines that you have control over both pages, and that they\u2019re each in agreement about their relationship to one another. These pairs form a cluster of pages, referred to as an hreflang cluster.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/08\/hreflang-study-6.png\" alt=\"What an hreflang cluster looks like\"><\/p>\n<p>It\u2019s similar to setting a relationship status on Facebook. You could easily declare yourself as in a relationship with Jennifer Aniston or Brad Pitt, but unless they do the same, nobody is going to believe you.<\/p>\n<p>As such, when the tags are broken, or the relationship hasn\u2019t been fully established yet, you may see the wrong page, multiple pages, or the wrong title for the right URL shown in the search results.<\/p>\n<h3>Rule #2: Self-referential hreflang attributes are good practice<\/h3>\n<p>Google <a href=\"https:\/\/support.google.com\/webmasters\/answer\/189077?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">states<\/a>&nbsp;that \u201ceach language version must list itself as well as all other language versions.\u201d In plain English, that means that every page should have a self-referential hreflang tag\u2014i.e., one that points back to itself.<\/p>\n<p>So, if we want to add a hreflang tags between an English page (https:\/\/example.com\/hello) and an Italian page (https:\/\/example.com\/ciao), each should have the following hreflang tags:<\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"it\" href=\"https:\/\/example.com\/ciao\" \/&gt;<\/code><br>\n<code>&lt;link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/example.com\/hello\" \/&gt;<\/code><\/p>\n<p>The first&nbsp;specifies the URL of the alternate Italian version of the page, and the second is a self-referencing tag that points back to the page itself.<\/p>\n<p>The Italian page would also need both of these hreflang tags.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"824\" class=\"wp-image-32011\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-self-referential-hreflangs-work.png\" alt=\"how self referential hreflangs work\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-self-referential-hreflangs-work.png 900w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-self-referential-hreflangs-work-464x425.png 464w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/how-self-referential-hreflangs-work-768x703.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\"><\/p>\n<div class=\"sidenote\"><div class=\"sidenote-title\">Sidenote.<\/div>&nbsp;Google\u2019s John Mueller did <a href=\"https:\/\/twitter.com\/JohnMu\/status\/1012702315474632704\" target=\"_blank\" rel=\"noopener noreferrer\">recently<\/a> say that \u201cself referential hreflang is optional - but good practice.\u201d It\u2019s mostly a holdover from a time when you would copy all of the tags between pages. I wouldn\u2019t worry too much if you don\u2019t have the self-referencing tags, but best practices say to have&nbsp;them.<\/div>\n<h3>Rule #3: X-default tags are recommended, but not mandatory<\/h3>\n<p>The hreflang x-default tag specifies the default or fallback page that gets shown to users when no other language variant is appropriate. You don\u2019t have to use them, but Google <a href=\"https:\/\/support.google.com\/webmasters\/answer\/189077?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">recommends<\/a>&nbsp;that you do. This is what one looks&nbsp;like:<\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\" \/&gt;<\/code><\/p>\n<p>There\u2019s no validation on Google\u2019s end for x-default. Many SEOs believe that each cluster has only 1 x-default tag, but in reality each page could technically have its own x-default.<\/p>\n<div class=\"recommendation\"><div class=\"recommendation-title\">PRO TIP<\/div><div class=\"recommendation-content\">\n<p>Hreflang tags work on a best-match basis. In other words, Google returns the version of content that it deems to be the best match based on various signals like the user\u2019s country and language settings.<\/p>\n<p>To illustrate how this works, imagine that Google is returning a result for an English-speaking user located in&nbsp;Spain.<\/p>\n<p>Google first looks for a language-country match (e.g., en-es) and returns that page if it exists.<\/p>\n<p>If not, it looks for a language code match (e.g., en).<\/p>\n<p>If that doesn\u2019t exist, Google will fallback to the x-default version.<\/p>\n<\/div><\/div>\n<h2>How to implement hreflang tags<\/h2>\n<p>There are three ways to implement the hreflang attribute:<\/p>\n<ol>\n<li>HTML tags<\/li>\n<li>HTTP headers<\/li>\n<li>Sitemaps<\/li>\n<\/ol>\n<h3>1. Implementing hreflang tags using&nbsp;HTML<\/h3>\n<p>If you\u2019re new to hreflang, then using basic HTML tags is probably the easiest and quickest way to implement. All you need to do is add any appropriate hreflang tags (as discussed above) in the &lt;head&gt; tag of your web&nbsp;page.<\/p>\n<h4>Example:<\/h4>\n<p>We recently launched the Ahrefs blog in several different languages, including <a href=\"https:\/\/ahrefs.com\/de\/\">German<\/a>, <a href=\"https:\/\/ahrefs.com\/ru\/\">Russian<\/a>, <a href=\"https:\/\/ahrefs.com\/zh\/\">Chinese<\/a>, and <a href=\"https:\/\/ahrefs.com\/es\/\">Spanish<\/a>. We\u2019re now slowly translating English versions of the posts on our main blog into these languages. One of the posts we\u2019ve already translated into both Chinese and German is <a href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\">our list of the best free keyword research tools<\/a>.<\/p>\n<p>Here are the URLs for all three variants:<\/p>\n<p><strong>English: <\/strong><code>https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/<\/code><br>\n<strong>German<\/strong>: <code>https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/<\/code><br>\n<strong>Chinese:<\/strong>&nbsp;<code>https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/<\/code><\/p>\n<p>To implement hreflang tags correctly for this setup, we\u2019d add this code to the &lt;head&gt; section of each of our&nbsp;pages:<\/p>\n<pre>&lt;link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"de\" href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"zh\" href=\"https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/\" \/&gt;\n&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt;\n<\/pre>\n<p>The issue with this method is that it gets pretty time-consuming and messy very easily.<\/p>\n<p>Case in point, if we were to also translate our list of free keyword research tools into Spanish, then we\u2019d have to go back and add another hreflang tag to <strong>all other variations<\/strong>&nbsp;of that&nbsp;page.<\/p>\n<p>There are <a href=\"https:\/\/twitter.com\/Modestos_\/status\/915514391537356800\" target=\"_blank\" rel=\"noopener noreferrer\">no limits to the number of hreflang tags<\/a>&nbsp;you can have on a&nbsp;page.<\/p>\n<h3>2. Implementing hreflang HTTP headers<\/h3>\n<p>For non-HTML pages such as PDFs, it\u2019s not possible to implement hreflang by placing tags in the &lt;head&gt; of the HTML. Reason being, there is no HTML. In such cases, you can use HTTP headers to specify the relative language of document variants. This method also works fine with normal webpages but is more commonly used with other content types.<\/p>\n<h4>Example<\/h4>\n<p>Imagine that we convert each version (English, Spanish, German) of our free keyword research tools post to&nbsp;PDF.<\/p>\n<p>Here\u2019s what the HTTP header should look like for each of those&nbsp;files:<\/p>\n<pre>HTTP\/1.1 200 OK\nContent-Type: application\/pdf\nLink: &lt;https:\/\/ahrefs.com\/blog\/free-keyword-research-tools.pdf&gt;; rel=\"alternate\";hreflang=\"x-default\",\n&lt;https:\/\/ahrefs.com\/blog\/free-keyword-research-tools.pdf&gt;; rel=\"alternate\";hreflang=\"en\",\n&lt;https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools.pdf&gt;; rel=\"alternate\";hreflang=\"de\",\n&lt;https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools.pdf&gt;; rel=\"alternate\";hreflang=\"zh\"\n<\/pre>\n<h3>3. Implementing hreflang in your XML sitemap<\/h3>\n<p>Sitemaps can include relevant markup to specify the hreflang of a page and its variants. For this, you can use the xhtml:link attribute.<\/p>\n<h4>Example<\/h4>\n<p>If we run with our original example (the three HTML variants of our list of free keyword tools), then this is the full markup for our sitemap:<\/p>\n<pre>&lt;url&gt;\n&lt;loc&gt;https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/&lt;\/loc&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt;\n&lt;xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"zh\" href=\"https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/\" \/&gt; \n&lt;\/url&gt;\n&lt;url&gt;\n&lt;loc&gt;https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/&lt;\/loc&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"x-default\" \nhref=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt;\n&lt;xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"zh\" href=\"https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/\" \/&gt; \n&lt;\/url&gt;\n&lt;url&gt;\n&lt;loc&gt;https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/&lt;\/loc&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"x-default\" \nhref=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt;\n&lt;xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https:\/\/ahrefs.com\/blog\/free-keyword-research-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https:\/\/ahrefs.com\/blog\/de\/kostenlose-keyword-recherche-tools\/\" \/&gt; \n&lt;xhtml:link rel=\"alternate\" hreflang=\"zh\" href=\"https:\/\/ahrefs.com\/blog\/zh\/free-keyword-research-tools\/\" \/&gt; \n&lt;\/url&gt;\n<\/pre>\n<p>This may look like the least efficient and most nightmarish way to implement hreflang attributes, but often the opposite is true. Reason being, everything is defined in a single file. There\u2019s no need to edit multiple HTML documents each time you make a slight change or delete a&nbsp;page.<\/p>\n<p>What\u2019s more, the additional overhead in headers and the added code in HTML means that a large number of hreflang tags can have an impact on your site speed whereas implementing through your sitemap does not cause the same slowdown.<\/p>\n<h2 id=\"how-to-automate-hreflang\">How to semi-automate hreflang implementation<\/h2>\n<p>Earlier in this guide, I showed a tweet from Google\u2019s John Mueller where he stated that the hreflang attribute is the most complex part of SEO. Here it is again for good measure:<\/p>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"en\">\n<p dir=\"ltr\" lang=\"en\">TBH hreflang is one of the most complex aspects of SEO (if not the most complex one). Feels as easy as a meta-tag, but it gets really hard quickly.\u2014 John (@JohnMu) <a href=\"https:\/\/twitter.com\/JohnMu\/status\/965507331369984002?ref_src=twsrc%5Etfw\">February 19,&nbsp;2018<\/a><\/p>\n<\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>His reason for this is that it \u201cgets really hard really quickly.\u201d<\/p>\n<p>This is definitely true for large multilingual sites. However, given that you\u2019re here reading what is effectively a beginner\u2019s guide to hreflang tags, my guess is that your website isn\u2019t one of a multinational brand with tens of thousands of customers, but rather a small-to-medium-sized site with some multilingual content.<\/p>\n<p>If that\u2019s the case, then I have good&nbsp;news:<\/p>\n<p><strong>Generating and implementing your hreflang tags can be automated to a large extent.<\/strong><\/p>\n<p>To do it, make a copy of <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1Ve8xOhq2Og-J6PdKiLuJ3ySeR3Gvdhw9dCzJLKNzdkg\/copy\" target=\"_blank\" rel=\"noopener noreferrer\">this Google Sheets template<\/a>, then follow the instructions below.<\/p>\n<h3>1. Choose your languages and localities<\/h3>\n<p>Head over to the \u201cSetup\u201d tab in the Google Sheet. Select the default language (or language-locale) for your website, along with up to four other variations.<\/p>\n<p>For example, if we were setting up this sheet for the Ahrefs blog, we would specify English as our default, then Spanish, German, Russian, and Chinese as the four alternative variations.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"132\" class=\"wp-image-32016\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-sheet-setup.png\" alt=\"hreflang sheet setup\"><\/p>\n<h3>2. Paste in your&nbsp;URLs<\/h3>\n<p>Head to the \u201cURLs\u201d tab. You should see up to five columns, each of which will have a header cell corresponding to the languages chosen in the previous step. There is also a column for \u201cx-default\u201d values.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"56\" class=\"wp-image-32012\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-columns.png\" alt=\"hreflang columns\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-columns.png 838w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-columns-680x45.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-columns-768x51.png 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\"><\/p>\n<p>Paste URLs into the sheet as appropriate.<\/p>\n<p>For example, if we were doing this for the Ahrefs blog, we would paste any English posts (our primary\/default language) in the first column. Then, we would paste the URLs of the relevant translated versions into the other columns.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"279\" class=\"wp-image-32013\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-urls.png\" alt=\"hreflang urls\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-urls.png 899w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-urls-680x211.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/hreflang-urls-768x238.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\"><\/p>\n<p>Do this for all relevant international pages on your website.<\/p>\n<h3>3. Download the hreflang XML sitemap<\/h3>\n<p>Head to the \u201cResults\u201d tab where you will find auto-generated code for an XML sitemap.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"353\" class=\"wp-image-32015\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/generated-sitemap.png\" alt=\"generated sitemap\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/generated-sitemap.png 727w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/generated-sitemap-680x330.png 680w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\"><\/p>\n<p>Copy everything in column A. Paste it into an XML document.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"486\" class=\"wp-image-32010\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/xml-sitemap.png\" alt=\"xml sitemap\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/xml-sitemap.png 797w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/xml-sitemap-680x415.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/xml-sitemap-768x468.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\"><\/p>\n<p>Upload this to your website, then submit to Google via Search Console.<\/p>\n<h3>4. Log changes in the&nbsp;sheet<\/h3>\n<p>Whenever you add or remove a translated page from your website, log that change in this Google sheet. If you remove a page, delete that URL. If you add a new translated version of a page to your website, add that to the appropriate column.<\/p>\n<p>The sheet will regenerate the sitemap code on the fly. You just need to copy\/paste it into your sitemap in place of the old&nbsp;code.<\/p>\n<h2 id=\"how-to-find-and-fix-hreflang-issues\">How to audit your site for hreflang issues<\/h2>\n<p>No matter how much you try to stay on top of hreflang attributes, some mistakes will almost always slip through the net. For that reason, it\u2019s crucial to regularly audit your website for <a href=\"https:\/\/ahrefs.com\/blog\/hreflang-study\/\">hreflang issues<\/a> and nip them in the bud as soon as possible.<\/p>\n<p>The easiest way to do that is to crawl your website using <a href=\"https:\/\/ahrefs.com\/site-audit\">Ahrefs\u2019 Site Audit tool<\/a>&nbsp;regularly.<\/p>\n<div data-mode=\"normal\" data-oembed=\"1\" data-provider=\"youtube\" id=\"arve-youtube-ljinwqfgyve\" style=\"max-width:900px;\" class=\"arve\">\n<div class=\"arve-inner\">\n<div style=\"aspect-ratio:500\/281\" class=\"arve-embed arve-embed--has-aspect-ratio\">\n<div class=\"arve-ar\" style=\"padding-top:56.200000%\"><\/div>\n<p>\t\t\t<iframe allow=\"accelerometer 'none';autoplay 'none';bluetooth 'none';browsing-topics 'none';camera 'none';clipboard-read 'none';clipboard-write;display-capture 'none';encrypted-media 'none';gamepad 'none';geolocation 'none';gyroscope 'none';hid 'none';identity-credentials-get 'none';idle-detection 'none';keyboard-map 'none';local-fonts;magnetometer 'none';microphone 'none';midi 'none';otp-credentials 'none';payment 'none';picture-in-picture;publickey-credentials-create 'none';publickey-credentials-get 'none';screen-wake-lock 'none';serial 'none';summarizer 'none';sync-xhr;usb 'none';web-share;window-management 'none';xr-spatial-tracking 'none';\" allowfullscreen class=\"arve-iframe fitvidsignore\" credentialless data-arve=\"arve-youtube-ljinwqfgyve\" data-lenis-prevent data-src-no-ap=\"https:\/\/www.youtube-nocookie.com\/embed\/LjinWqfGyVE?feature=oembed&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;autohide=1&amp;playsinline=0&amp;autoplay=0\" frameborder=\"0\" height=\"505.8\" loading=\"lazy\" name referrerpolicy=\"strict-origin-when-cross-origin\" sandbox=\"allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox\" scrolling=\"no\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/LjinWqfGyVE?feature=oembed&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;autohide=1&amp;playsinline=0&amp;autoplay=0\" title width=\"900\"><\/iframe><\/p><\/div>\n<\/div>\n<\/div>\n<p>To make it easy to understand and showcase hreflang issues, we added a visualization for the hreflang clusters, as well as more data about all the tags we saw and the location. This helps you easily see and explain errors, rather than having complex spreadsheets that you need to explain.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-186277\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/image-8.png\" alt=\"hreflang cluster visualization in Ahrefs Site Audit\" width=\"1574\" height=\"1225\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/image-8.png 1574w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/image-8-546x425.png 546w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/image-8-768x598.png 768w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/image-8-1536x1195.png 1536w\" sizes=\"auto, (max-width: 1574px) 100vw, 1574px\"><\/p>\n<p>Site Audit is a cloud-based crawler that checks your site for hundreds of SEO-related issues, including those related to hreflang.<\/p>\n<p>Here are the nine hreflang related issues Site Audit may find, and how to fix&nbsp;them:<\/p>\n<h3>1. Self-reference hreflang annotation missing<\/h3>\n<p>This warning triggers when a self-referencing hreflang tag is absent from one or more&nbsp;pages.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>To reiterate our point from earlier, Google <a href=\"https:\/\/support.google.com\/webmasters\/answer\/189077?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">states<\/a>&nbsp;that \u201ceach language version must list itself as well as all other language versions,\u201d so it\u2019s important to use a self-referencing hreflang tag whenever you add a hreflang tag to a web&nbsp;page.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages, then add a self-referencing hreflang tag to each of them using your chosen method.<\/p>\n<h3>2. Hreflang annotation invalid<\/h3>\n<p>This warning triggers when one or more URLs have hreflang tags with invalid language or locale codes.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Search engines ignore any invalid hreflang tags, meaning that they may overlook alternate versions of your page. This is bad for SEO because it means search engines may not be able to show the most appropriate version of your page to&nbsp;users.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected page. Check the \u201cIs valid hreflang\u201d column to see the invalid hreflang tags for each page. Remove these in favor of hreflang tags that use valid language or language-location code formats.<\/p>\n<h3>3. Page referenced for more than one language in hreflang<\/h3>\n<p>This warning triggers when one or more URLs are referenced for more than one language in hreflang annotations. For example:<\/p>\n<p><code>&lt;link rel=\"alternate\" hreflang=\"<strong>en<\/strong>\" href=\"http:\/\/example.com\/page.html\" \/&gt;<\/code><br>\n<code>&lt;link rel=\"alternate\" hreflang=\"<strong>de<\/strong>\" href=\"http:\/\/example.com\/page.html\" \/&gt;<\/code><\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Each piece of content should only serve one language or language-location. Having two or more contradicting references will confuse search engines, and they may end up ignoring both hreflang attributes.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages, then inspect the URLs that reference the page in their hreflang attributes for errors. Remove the incorrect hreflang attribute to leave only one correct attribute per language.<\/p>\n<h3>4. Missing reciprocal hreflang (no return-tag)<\/h3>\n<p>This issue triggers when confirmation (return) links are missing for the pages declared in hreflang annotations.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Hreflang tags are bidirectional (i.e., if page A links to page B in hreflang annotations, page B must link to page A in return).<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Add bidirectional hreflang tags where necessary.<\/p>\n<div class=\"recommendation\"><div class=\"recommendation-title\">Here\u2019s another way to check for this&nbsp;issue\u2026<\/div><div class=\"recommendation-content\">\n<p>Head to the International targeting report in <a href=\"https:\/\/ahrefs.com\/blog\/google-search-console\/\">Google Search Console<\/a>&nbsp;and select the \u201cLanguage\u201d tab. Any issues relating to missing return tags are flagged.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"769\" class=\"wp-image-32022\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-4.png\" alt=\"pasted image 0 4\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-4.png 1600w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-4-680x327.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-4-768x369.png 768w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-4-1536x738.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\"><\/p>\n<p>This report also flags issues where nonexistent language or language+country codes are&nbsp;used.<\/p>\n<\/div><\/div>\n<h3>5. Hreflang to non-canonical<\/h3>\n<p>This issue triggers when one or more page\u2019s reference a non-canonical URL in their hreflang tags.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Rel=\u201calternate\u201d hreflang=\u201cx\u201d will instruct search engines to show the translated (localized) version of a page while rel=canonical attribute will flag that this is not the authoritative (canonical) version. These two attributes contradict each other and confuse search engines.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Modify their hreflang annotations so that they point to canonical URLs only. Or, if you find a page with a rogue canonical tag, remove that from the page to ensure that the hreflang attribute is properly understood and followed by search engines.<\/p>\n<div class=\"recommendation\"><div class=\"recommendation-title\">Got multiple versions of pages in the same language?<\/div><div class=\"recommendation-content\">\n<p>Google may see them as duplicates and choose only one URL as the canonical.<\/p>\n<p>For example, let\u2019s say that you have two product pages, one for the US (\u201cen-us\u201d) and one for the UK (\u201cen-gb\u201d). The content on both pages is almost identical, with the only difference being that prices are in US dollars on one page and British pounds on the&nbsp;other.<\/p>\n<p>If Google chooses one of these as the canonical, it\u2019ll exclude all except for one from the&nbsp;index.<\/p>\n<p>If you suspect this might be happening for a particular page, use the <a href=\"https:\/\/support.google.com\/webmasters\/answer\/9012289?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">URL inspection tool<\/a>&nbsp;in Search Console to see how Google views that&nbsp;page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1582\" height=\"202\" class=\"wp-image-32018\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-2.png\" alt=\"pasted image 0 2\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-2.png 1582w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-2-680x87.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-2-768x98.png 768w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-2-1536x196.png 1536w\" sizes=\"auto, (max-width: 1582px) 100vw, 1582px\"><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"306\" class=\"wp-image-32024\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-5.png\" alt=\"pasted image 0 5\"><\/p>\n<\/div><\/div>\n<h3>6. Hreflang and HTML lang mismatch<\/h3>\n<p>This issue triggers when there is an inconsistency between the declared hreflang and HTML language attribute for one or more&nbsp;URLs.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Google doesn\u2019t use the HTML language attribute, but other search engines and browsers do. It\u2019s important to keep these two attributes consistent with one another.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Change the HTML language attribute to ensure consistency with the declared hreflang attribute.<\/p>\n<h3>7. Hreflang to broken page<\/h3>\n<p>This issue triggers when one or more page\u2019s reference broken URLs in their hreflang annotations.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Google and other search engines cannot show its users content that doesn\u2019t exist. For that reason, hreflang attributes pointing to dead pages will most likely be overlooked by Google and other search engines.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Change the hreflang annotations to ensure that they link to working pages.<\/p>\n<h3>8. More than one page for the same language in hreflang<\/h3>\n<p>This issue is triggered when one or more URLs reference two or more page\u2019s for the same language (or language-location) in their hreflang annotations.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Referencing multiple pages for the same language (or language-location) in hreflang annotations only serves to confuse search engines. They will often ignore or misinterpret such directives.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Remove one of the hreflang annotations so that only one page is referenced for each language.<\/p>\n<h3>9. X-default hreflang annotation missing<\/h3>\n<p>This issue is triggered when there is no x-default hreflang annotation on the&nbsp;page.<\/p>\n<h4>Why it\u2019s an&nbsp;issue<\/h4>\n<p>Although x-default hreflang attributes are optional, Google <a href=\"https:\/\/support.google.com\/webmasters\/answer\/189077?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">recommends<\/a>&nbsp;them as a way for you to \u201ccontrol the page when no languages match.\u201d SEO best practice is to use x-default tags for all hreflang annotations.<\/p>\n<h4>How to&nbsp;fix<\/h4>\n<p>Review the affected pages. Make sure each of them has an \u201cx-default\u201d hreflang attribute set. Ensure that this points to a page not specific to one language or region.<\/p>\n<p>\u2026\u2026.<\/p>\n<p>To keep on top of hreflang issues that may arise over time, consider scheduling a daily, weekly or, monthly crawl in <a href=\"https:\/\/ahrefs.com\/site-audit\">Ahrefs\u2019 Site Audit tool<\/a>. You can do that in your project settings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"493\" height=\"212\" class=\"wp-image-32025\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/crawl-scheduling.png\" alt=\"crawl scheduling\"><\/p>\n<p>New issues will show in the <em>Localization<\/em>&nbsp;report for the associated project after each scheduled crawl, so make sure to check this periodically.<\/p>\n<h3>Using Ahrefs\u2019 Site Explorer to check for incorrect rankings<\/h3>\n<p>Paste a domain, subdomain, subfolder path for the language you want to check into <a href=\"https:\/\/ahrefs.com\/site-explorer\">Ahrefs\u2019 Site Explorer<\/a>, then go to the \u201cOrganic search\u201d tab on the \u201cOverview\u201d report.<\/p>\n<p>Look at the list of countries by search traffic. Are they what you would expect to&nbsp;see?<\/p>\n<p>Here, the German version of our website (<em>ahrefs.com\/de)<\/em>&nbsp;ranks in Germany and other German-speaking countries like Austria and Switzerland, which is to be expected. But it\u2019s also getting traffic from the United States and India, which seems&nbsp;odd.<br>\n<img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"769\" class=\"wp-image-32019\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-3.png\" alt=\"pasted image 0 3\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-3.png 1600w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-3-680x327.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-3-768x369.png 768w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-3-1536x738.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\"><\/p>\n<p>Checking different versions of your site like this is a good starting point when looking for potential issues with hreflang tags.<\/p>\n<h2 id=\"hreflang-issues-google-ignores\">Problems with hreflang that Google may ignore<\/h2>\n<p>While it\u2019s still wise to follow best practices, there are times when search engines may ignore certain issues. Usually, this happens when a search engine sees the same issue over and over again and believes they can account for it on their&nbsp;end.<\/p>\n<p>Here are a few confirmed hreflang tag issues that Google \u201cfixes\u201d for&nbsp;you:<\/p>\n<h3>1. Underscore instead of a&nbsp;dash<\/h3>\n<p>Gary Illyes mentions in <a href=\"https:\/\/twitter.com\/dsottimano\/status\/867315538057474049\" target=\"_blank\" rel=\"noopener noreferrer\">this Twitter thread<\/a>&nbsp;that Google\u2019s parsers account for this common error.<\/p>\n<h3>2. en-UK instead of&nbsp;en-GB<\/h3>\n<p>John Mueller covered this in <a href=\"https:\/\/www.reddit.com\/r\/TechSEO\/comments\/87pxsu\/i_am_john_mueller_webmaster_trends_analyst_at\/\" target=\"_blank\" rel=\"noopener noreferrer\">his AMA<\/a>&nbsp;(Ask Me Anything) on Reddit. Because the UK is a reserved code, they can correct for this&nbsp;issue.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1256\" height=\"310\" class=\"wp-image-32014\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0.png\" alt=\"pasted image 0\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0.png 1256w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-680x168.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-768x190.png 768w\" sizes=\"auto, (max-width: 1256px) 100vw, 1256px\"><\/p>\n<h3>3. Hreflang not having a self-reference<\/h3>\n<p>Google\u2019s John Mueller <a href=\"https:\/\/twitter.com\/JohnMu\/status\/1012702315474632704\" target=\"_blank\" rel=\"noopener noreferrer\">recently<\/a> stated that the self-referential hreflang is optional\u2014but good practice.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-172979\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.47.43.png\" alt=\"John Mueller confirms that self-referential hreflangs are good practice\" width=\"1190\" height=\"422\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.47.43.png 1190w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.47.43-680x241.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.47.43-768x272.png 768w\" sizes=\"auto, (max-width: 1190px) 100vw, 1190px\"><\/p>\n<h3>4. Relative vs Absolute URLs<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-172981\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.48.38.png\" alt=\"John Mueller confirms that you can use relative or absolute paths in hreflangs\" width=\"1166\" height=\"550\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.48.38.png 1166w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.48.38-680x321.png 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/Screenshot-2024-03-18-at-12.48.38-768x362.png 768w\" sizes=\"auto, (max-width: 1166px) 100vw, 1166px\"><\/p>\n<h2 id=\"redirecting-users-issues\">Be careful redirecting users<\/h2>\n<p>Websites will in many cases auto-redirect users based on some combination of cookies, IP address, and\/or browser language. This can result in a poor and frustrating experience for users, and is often problematic for search engines trying to index your content. Amongst other things, it can break the connections needed for your hreflang tags.<\/p>\n<p>Here\u2019s what <a href=\"https:\/\/support.google.com\/webmasters\/answer\/182192?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">Google says<\/a>:<\/p>\n<blockquote><p>Do not use IP analysis to adapt your content. IP location analysis is difficult and generally not reliable. Furthermore, Google may not be able to crawl variations of your site properly. Most, but not all, Google crawls originate from the US, and we do not attempt to vary the location to detect site variations. Use one of the explicit methods shown here (hreflang, alternate URLs, and explicit links).<\/p><\/blockquote>\n<p>Always treat search engine crawlers as you would a user from any location. If you\u2019re treating the search engine bot different than you would a user, that is considered <a href=\"https:\/\/support.google.com\/webmasters\/answer\/66355?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">cloaking<\/a>&nbsp;and is a violation of Google\u2019s Webmaster Guidelines.<\/p>\n<p>What you can do is use the same detection logic to suggest a better version of the page for the user on a small banner.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"187\" class=\"wp-image-32027\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/geolocation-banner.jpg\" alt=\"geolocation banner\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/geolocation-banner.jpg 868w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/geolocation-banner-680x146.jpg 680w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/geolocation-banner-768x165.jpg 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\"><\/p>\n<p>Be careful not to take up too much space with this banner. If it\u2019s too large, the banner could be seen as an <a href=\"https:\/\/webmasters.googleblog.com\/2016\/08\/helping-users-easily-access-content-on.html\" target=\"_blank\" rel=\"noopener noreferrer\">interstitial<\/a>.<\/p>\n<h2>A few more warnings<\/h2>\n<p>Encoding characters in URLs with UTF-8 is fine for Google, but there may be a point of failure in your tech stack where it is not supported.<\/p>\n<p>You can\u2019t have hreflang tags in the body because they could be used for hijacking. The tags can be forced into the body section under certain conditions. This is known as breaking the &lt;head&gt; and can be caused by things like iframes or tags not closed in the &lt;head&gt; section, or can be from injecting different things with JavaScript. Use <a href=\"https:\/\/developers.google.com\/web\/updates\/2015\/05\/view-and-change-your-dom-breakpoints\" target=\"_blank\" rel=\"noopener noreferrer\">DOM breakpoints<\/a>&nbsp;to troubleshoot.<\/p>\n<p>To see these, you may need to run through one of Google\u2019s tools to see the rendered DOM or \u201cRight Click\u201d &gt; Inspect in Chrome and search the Elements panel of Chrome DevTools.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"138\" class=\"wp-image-32017\" src=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-1.png\" alt=\"pasted image 0 1\" srcset=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-1.png 718w, https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/12\/pasted-image-0-1-680x131.png 680w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\"><\/p>\n<p>Don\u2019t block pages with hreflang tags with robots.txt. If Google can\u2019t crawl the pages, then the hreflang tags won\u2019t be&nbsp;seen.<\/p>\n<p>Don\u2019t noindex the pages with hreflang tags. They need to be indexed.<\/p>\n<h2>Final thoughts<\/h2>\n<p>Hreflang isn\u2019t <em>that<\/em>&nbsp;complicated. You just need to stay organized, automate the implementation as much as you can, stay on top of any issues that will inevitably arise, and fix those issues as quickly as possible.<\/p>\n<p>Any questions? Let me know in the comments or <a href=\"https:\/\/twitter.com\/joshuachardwick?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">on Twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hreflang is a simple HTML attribute, but it can be challenging to get to grips&nbsp;with. Google\u2019s John Mueller described hreflang as \u201cone of the most complex aspects of SEO\u201d because it gets \u201creally hard quickly.\u201d TBH hreflang is one of<span class=\"ellipsis\">\u2026<\/span><\/p>\n<div class=\"read-more\">Read more \u203a<\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":114,"featured_media":28070,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[329],"tags":[],"coauthors":[336,377],"class_list":["post-28044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-seo","odd"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hreflang: The Easy Guide for Beginners<\/title>\n<meta name=\"description\" content=\"Learn what hreflang tags are, when you should use them, how to implement them, and how to keep your website free of common hreflang errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hreflang: The Easy Guide for Beginners\" \/>\n<meta property=\"og:description\" content=\"Everything you need to know about hreflang.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\" \/>\n<meta property=\"og:site_name\" content=\"SEO Blog by Ahrefs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Ahrefs\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-07T00:12:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-18T13:44:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"990\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joshua Hardwick, Patrick Stox\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"Everything you need to know about hreflang.\" \/>\n<meta name=\"twitter:creator\" content=\"@JoshuaCHardwick\" \/>\n<meta name=\"twitter:site\" content=\"@ahrefs\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\"},\"author\":{\"name\":\"Joshua Hardwick\",\"@id\":\"https:\/\/ahrefs.com\/blog\/#\/schema\/person\/e6a89cbde8e750d22996aa26e213e712\"},\"headline\":\"Hreflang: The Easy Guide for Beginners\",\"datePublished\":\"2019-06-07T00:12:50+00:00\",\"dateModified\":\"2025-12-18T13:44:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\"},\"wordCount\":4699,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png\",\"articleSection\":[\"Technical SEO\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\",\"url\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\",\"name\":\"Hreflang: The Easy Guide for Beginners\",\"isPartOf\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png\",\"datePublished\":\"2019-06-07T00:12:50+00:00\",\"dateModified\":\"2025-12-18T13:44:06+00:00\",\"description\":\"Learn what hreflang tags are, when you should use them, how to implement them, and how to keep your website free of common hreflang errors.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage\",\"url\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png\",\"contentUrl\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png\",\"width\":1920,\"height\":990},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ahrefs.com\/blog\/#website\",\"url\":\"https:\/\/ahrefs.com\/blog\/\",\"name\":\"SEO Blog by Ahrefs\",\"description\":\"Link Building Strategies &amp; SEO Tips\",\"publisher\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ahrefs.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ahrefs.com\/blog\/#organization\",\"name\":\"Ahrefs\",\"url\":\"https:\/\/ahrefs.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ahrefs.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/06\/ahrefs-logo.png\",\"contentUrl\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/06\/ahrefs-logo.png\",\"width\":2048,\"height\":768,\"caption\":\"Ahrefs\"},\"image\":{\"@id\":\"https:\/\/ahrefs.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Ahrefs\/\",\"https:\/\/x.com\/ahrefs\",\"https:\/\/www.linkedin.com\/company\/ahrefs\/\",\"https:\/\/www.youtube.com\/c\/ahrefscom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ahrefs.com\/blog\/#\/schema\/person\/e6a89cbde8e750d22996aa26e213e712\",\"name\":\"Joshua Hardwick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg109e89523fcea81015d3cc08c79f9036\",\"url\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg\",\"contentUrl\":\"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg\",\"caption\":\"Joshua Hardwick\"},\"description\":\"Head of Content @ Ahrefs (or, in plain English, I'm the guy responsible for ensuring that every blog post we publish is EPIC).\",\"sameAs\":[\"https:\/\/x.com\/JoshuaCHardwick\"],\"url\":\"https:\/\/ahrefs.com\/blog\/author\/joshua-hardwick\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hreflang: The Easy Guide for Beginners","description":"Learn what hreflang tags are, when you should use them, how to implement them, and how to keep your website free of common hreflang errors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/","og_locale":"en_US","og_type":"article","og_title":"Hreflang: The Easy Guide for Beginners","og_description":"Everything you need to know about hreflang.","og_url":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/","og_site_name":"SEO Blog by Ahrefs","article_publisher":"https:\/\/www.facebook.com\/Ahrefs\/","article_published_time":"2019-06-07T00:12:50+00:00","article_modified_time":"2025-12-18T13:44:06+00:00","og_image":[{"width":1920,"height":990,"url":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png","type":"image\/png"}],"author":"Joshua Hardwick, Patrick Stox","twitter_card":"summary_large_image","twitter_description":"Everything you need to know about hreflang.","twitter_creator":"@JoshuaCHardwick","twitter_site":"@ahrefs","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#article","isPartOf":{"@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/"},"author":{"name":"Joshua Hardwick","@id":"https:\/\/ahrefs.com\/blog\/#\/schema\/person\/e6a89cbde8e750d22996aa26e213e712"},"headline":"Hreflang: The Easy Guide for Beginners","datePublished":"2019-06-07T00:12:50+00:00","dateModified":"2025-12-18T13:44:06+00:00","mainEntityOfPage":{"@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/"},"wordCount":4699,"commentCount":0,"publisher":{"@id":"https:\/\/ahrefs.com\/blog\/#organization"},"image":{"@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage"},"thumbnailUrl":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png","articleSection":["Technical SEO"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ahrefs.com\/blog\/hreflang-tags\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/","url":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/","name":"Hreflang: The Easy Guide for Beginners","isPartOf":{"@id":"https:\/\/ahrefs.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage"},"image":{"@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage"},"thumbnailUrl":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png","datePublished":"2019-06-07T00:12:50+00:00","dateModified":"2025-12-18T13:44:06+00:00","description":"Learn what hreflang tags are, when you should use them, how to implement them, and how to keep your website free of common hreflang errors.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ahrefs.com\/blog\/hreflang-tags\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ahrefs.com\/blog\/hreflang-tags\/#primaryimage","url":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png","contentUrl":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/06\/fb-hreflang-tags.png","width":1920,"height":990},{"@type":"WebSite","@id":"https:\/\/ahrefs.com\/blog\/#website","url":"https:\/\/ahrefs.com\/blog\/","name":"SEO Blog by Ahrefs","description":"Link Building Strategies &amp; SEO Tips","publisher":{"@id":"https:\/\/ahrefs.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ahrefs.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ahrefs.com\/blog\/#organization","name":"Ahrefs","url":"https:\/\/ahrefs.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ahrefs.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/06\/ahrefs-logo.png","contentUrl":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2023\/06\/ahrefs-logo.png","width":2048,"height":768,"caption":"Ahrefs"},"image":{"@id":"https:\/\/ahrefs.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Ahrefs\/","https:\/\/x.com\/ahrefs","https:\/\/www.linkedin.com\/company\/ahrefs\/","https:\/\/www.youtube.com\/c\/ahrefscom"]},{"@type":"Person","@id":"https:\/\/ahrefs.com\/blog\/#\/schema\/person\/e6a89cbde8e750d22996aa26e213e712","name":"Joshua Hardwick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg109e89523fcea81015d3cc08c79f9036","url":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg","contentUrl":"https:\/\/ahrefs.com\/blog\/wp-content\/uploads\/2019\/10\/meme.jpg","caption":"Joshua Hardwick"},"description":"Head of Content @ Ahrefs (or, in plain English, I'm the guy responsible for ensuring that every blog post we publish is EPIC).","sameAs":["https:\/\/x.com\/JoshuaCHardwick"],"url":"https:\/\/ahrefs.com\/blog\/author\/joshua-hardwick\/"}]}},"_links":{"self":[{"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/posts\/28044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/users\/114"}],"replies":[{"embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/comments?post=28044"}],"version-history":[{"count":0,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/posts\/28044\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/media\/28070"}],"wp:attachment":[{"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/media?parent=28044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/categories?post=28044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/tags?post=28044"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/ahrefs.com\/blog\/wp-json\/wp\/v2\/coauthors?post=28044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}