{"id":53845,"date":"2022-12-30T11:07:44","date_gmt":"2022-12-30T09:07:44","guid":{"rendered":"https:\/\/lanet.click\/hreflang-2\/"},"modified":"2025-09-23T00:22:04","modified_gmt":"2025-09-22T21:22:04","slug":"hreflang","status":"publish","type":"post","link":"https:\/\/lanet.click\/en\/hreflang\/","title":{"rendered":"The hreflang attribute for a multilingual site"},"content":{"rendered":"<p>While promoting sites in several regions and attracting users from different countries, SEO specialists face several specific problems. One of the most common among them is the correct display of the promoted site in specific regional results. In this regard, the key task of a specialist is to help search engines understand which countries the site pages are aimed at, as well as in which languages the content is presented on it. For this, special link attributes are used. In particular, they include hreflang, the attribute implemented by Google.<\/p>\n<h2>What is the hreflang attribute<\/h2>\n<p>The hreflang attribute is an extension for websites with content in multiple languages. It is used to correctly display relevant versions of the resource in search engines following users&#8217; requests. In addition, this attribute prevents the two pages of the site from sticking together.<\/p>\n<h3>How websites use the hreflang attribute<\/h3>\n<p>When you enter a specific query in the search bar, Google will understand where the consumer is located and will offer him the most relevant version of the site in the results without the need to enter any additional keywords.<\/p>\n<h3>What hreflang looks like<\/h3>\n<p>In the HTML code, the attribute is represented as follows (as an example):&lt;link href=&#8221;https:\/\/lanet.click\/contacts\/&#8221; rel=&#8221;alternate&#8221; hreflang=&#8221;uk-UA&#8221; \/&gt;Let\u2019s consider its main components:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>rel=&#8221;alternate&#8221; is the HTML attribute of the link tag;<\/li>\n<li>hreflang=&#8221;language and country code&#8221; \u2014 this part of the code indicates the specific language of the page, as well as the country for which it is used.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28020\" src=\"https:\/\/lanet.click\/wp-content\/uploads\/2022\/12\/hreflang_1.webp\" alt=\"\" width=\"1200\" height=\"675\" \/><\/p>\n<h2>Is multilingualism necessary on the site<\/h2>\n<p>The multilingualism of the site is necessary for it to rank in the search for more queries. In turn, under this condition, <a href=\"https:\/\/lanet.click\/en\/seo\/\">SEO promotion<\/a> will be more effective since a multilingual resource will cover a large audience and will be able to generate high traffic.<\/p>\n<h3>How to designate different language versions of resource pages<\/h3>\n<p>Let&#8217;s get acquainted with the main methods used to implement the described attribute.<\/p>\n<h3>Creation of separate domains for different languages<\/h3>\n<p>Creating separate sites, each of which will be localized for a certain language, is the most expensive of all available options. The result is two separate domains that require separate promotion and updating published information.<\/p>\n<h3>Subdomains<\/h3>\n<p>If subdomains are created, the search engine will recognize them in the same way as in the previous case \u2014 as separate sites. It means that this method has the same disadvantages.<\/p>\n<h3>Subfolders<\/h3>\n<p>The optimal way, in this case, is to create subfolders (as implemented on our website \u2014 https:\/\/lanet.click\/ru\/ and https:\/\/lanet.click\/en\/). This option is not only the simplest and cheapest, but also the most effective.<\/p>\n<h2>When specifying alternative pages is necessary<\/h2>\n<p>It means of promotion is needed in the following cases:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>if there is a complete translation of the website\u2019s pages in another language;<\/li>\n<li>if there is a translation of certain elements of the site;<\/li>\n<li>if the content is published in only one language but with different information for consumers from different countries.<\/li>\n<\/ul>\n<h2>When the hreflang attribute should not be used<\/h2>\n<p>There are also several situations in which specifying alternative pages is not recommended.<\/p>\n<h3>For sites in the same language with similar content<\/h3>\n<p>It refers to those cases when the promotion of resources is necessary on the territory of different countries, but at the same time, similar content is published in one language.<\/p>\n<h3>For pages that are non-canonical<\/h3>\n<p>It is about if a certain site page has a duplicate. When pointing the rel=canonical tag to another page, conflicts may occur, confusing the search engine.<\/p>\n<h2>Correct use of the hreflang attribute<\/h2>\n<p>Let&#8217;s consider the main ways of using the hreflang attribute so that the promotion of a multilingual site is correct and effective. There are only three options for its implementation.<\/p>\n<h3>Using HTML tags<\/h3>\n<p>The most common option is to place the code in the &lt;head&gt; of the document on all pages. The language and region code is indicated here, and the corresponding link is attached.<\/p>\n<h3>Using an HTTP header<\/h3>\n<p>This option works for formats other than HTML (such as PDF). The HTTP header structure specifies the corresponding page address, as well as the region and language code.<\/p>\n<h3>Using the Sitemap file<\/h3>\n<p>Effective indication of the required alternative page can be achieved by including appropriate links in the structure of the Sitemap file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28026\" src=\"https:\/\/lanet.click\/wp-content\/uploads\/2022\/12\/hreflang_2.webp\" alt=\"\" width=\"1200\" height=\"675\" \/><\/p>\n<h2>Languages and regions<\/h2>\n<p>To implement the hreflang attribute, you must specify the standard language and region codes. The first case uses the ISO 639-1 format (e.g. ru, en), and the second ISO 3166-1 Alpha 2 (e.g. ru-en, es-ar).<\/p>\n<h2>What is x-default<\/h2>\n<p>The x-default value helps to determine the required page to automatically redirect the user to the request. As a rule, the main page of the promoted site is used for this.<\/p>\n<h2>Errors in using the hreflang attribute<\/h2>\n<p>Several technical errors can be made when implementing the hreflang attribute, which will prevent search engines from seeing it in the site structure. These include the following common cases:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>no backlinks;<\/li>\n<li>lack of reference to itself on the page with this attribute;<\/li>\n<li>indicating only the country code;<\/li>\n<li>using an attribute on a non-canonical page;<\/li>\n<li>more than one language code is specified for one link;<\/li>\n<li>specifying several pages with the same language code;<\/li>\n<li>missing the required x-default value in the hreflang attribute.<\/li>\n<\/ul>\n<h2>How to identify and fix existing errors in the hreflang attribute<\/h2>\n<p>Hreflang checking and troubleshooting are not done manually but automatically, thanks to the capabilities of the Google Search Console tool. For this, the functionality of the \u00abTargeting countries and languages\u00bb report is used.<\/p>\n    <div class=\"read-block\">\n        <p>\n            Read also:            <a href=\"https:\/\/lanet.click\/en\/skorochennia-posylan\/\" target=\"_blank\" rel=\"noopener\">\n                How to shorten links: link shortening services            <\/a>\n        <\/p>\n    <\/div>\n    \n<h2>Conclusion<\/h2>\n<p>In general, a language markup is an effective tool for promoting a multilingual site. With its help, the ranking in the regions indicated in the code will be significantly improved, as well as the user experience.<\/p>\n<div id=\"gtx-trans\" style=\"position: absolute; left: -52px; top: 0px;\">\n<div class=\"gtx-trans-icon\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>While promoting sites in several regions and attracting users from different countries, SEO specialists face several specific problems. One of [&hellip;]<\/p>\n","protected":false},"author":49,"featured_media":39950,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[234],"tags":[],"class_list":["post-53845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/posts\/53845"}],"collection":[{"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/comments?post=53845"}],"version-history":[{"count":0,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/posts\/53845\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/media\/39950"}],"wp:attachment":[{"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/media?parent=53845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/categories?post=53845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lanet.click\/en\/wp-json\/wp\/v2\/tags?post=53845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}