{"id":25024,"date":"2021-01-15T14:27:09","date_gmt":"2021-01-15T13:27:09","guid":{"rendered":"https:\/\/weventure.de\/?p=25024"},"modified":"2022-11-14T15:04:51","modified_gmt":"2022-11-14T14:04:51","slug":"hreflang-tag","status":"publish","type":"post","link":"https:\/\/weventure.de\/en\/blog\/hreflang-tag","title":{"rendered":"Hreflang Tag – The must-have for international websites"},"content":{"rendered":"\n
When should you use the Hreflang tag? If you run a multilingual and\/or multiregional website, you should use the Hreflang tag. It helps you in two ways:<\/p>\n\n\n\n This tag distinguishes different versions of a given web page. The tag should be used on every relevant subpage. For example, if you have a product detail page that exists in three versions for Germany, Austria, and Switzerland, it’s worth tagging all three. This way you show Google which page is relevant in which region, and at best rank with the correct version (including correct currency and delivery time) in all three countries. Even if your site is multilingual, this award is worth it, especially if your site has been translated one-to-one. <link rel=\u201dalternate\u201d hreflang=\u201dde-de\u201d<\/strong> The abbreviations in the Hreflang stand for the language and the region, in our example thus:<\/p>\n\n\n\n If the hreflang tag is to avoid duplicate content, why not work with canonicals? There are several generators<\/a> online. Of course, you can also create the tags yourself according to the example above and use a country code list for help. For this, there are Hreflang checks<\/a> with which you can check your code.<\/p>\n\n\n\n Hreflang x-default<\/strong> There are three ways to include the tag: This variant is a good choice for websites that have a large number of regional versions of a web page. Putting the tags on each individual subpage would be a monumental task and a lot of code. Instead, an element is created in the sitemap for each URL with a loc tag and xhtml:links:
<\/strong>You have problems with duplicate content<\/strong>, because the contents of your German, Swiss and Austrian pages are often identical? Here the Hreflang tag helps. We explain what this tag can do, how to install it and what advantages the Hreflang tag brings with it.
<\/p>\n\n\n\n
\n\n\n\n
You probably have the same content translated into different languages or even the same content for your German, Austrian and Swiss website versions. Here you need to be especially careful of duplicate content and be very specific about which version is relevant for which region.
<\/p>\n\n\n\n\n\n What is a Hreflang Tag?
<\/h2>\n\n\n\n
<\/p>\n\n\n\n
In our example (language<\/strong> German), the tag would look like this:<\/strong><\/p>\n\n\n\n
href=\u201dhttps:\/\/beispiel.com\/de\/<\/strong>produkt-1\u201d \/>
<link rel=\u201dalternate\u201d hreflang=\u201dde-at\u201d<\/strong>
href=\u201dhttps:\/\/beispiel.com\/at\/<\/strong>produkt-1\u201d \/>
<link rel=\u201dalternate\u201d hreflang=\u201dde-ch\u201d<\/strong>
href=\u201dhttps:\/\/beispiel.com\/ch\/<\/strong>produkt-1\u201d \/><\/p>\n\n\n\n
It is important that the hreflang tag must also be self-referencing. So on the page example.com\/de\/product-1 this URL must also be specified for users from Germany (de-de).
<\/p>\n\n\n\nHreflang vs Canonical<\/h2>\n\n\n\n
If you still want to be in the index and rank with all three example pages, then the canonical solution unfortunately doesn’t work. With a canonical you show Google that a page is only a duplicate of another page. Therefore only the original will rank. So in our case it is rather suboptimal, because we still want to rank with the Swiss page in Switzerland, with the German page in Germany and with the Austrian page in Austria.
<\/p>\n\n\n\nHow do I create the Hreflang tag correctly?
<\/h2>\n\n\n\n
Of course, it would be difficult and unnecessary to cover all countries and languages of this world by hreflang tag. For all cases that are not covered, the x-default is responsible. In our example it would look like this:
<link rel=\u201dalternate\u201d hreflang=\u201dx-default<\/strong>\u201d
href=\u201dhttps:\/\/beispiel.com\/de<\/strong>\/produkt-1\/\u201d >
So here, all visitors who cannot be localized in Germany, Austria or Switzerland will be referred to the German page (de).
<\/p>\n\n\n\nWhere is the tag installed??
<\/h2>\n\n\n\n
1. HTML link element in the header
<\/strong>In this variant, the tags are built into the header of each individual subpage as shown in the example above:
<link rel=\u201dalternate\u201d hreflang=\u201dde-de\u201d<\/strong>
href=\u201dhttps:\/\/beispiel.com\/de<\/strong>\/produkt-1\u201d \/>
<link rel=\u201dalternate\u201d hreflang=\u201dde-at\u201d<\/strong>
href=\u201dhttps:\/\/beispiel.com\/at<\/strong>\/produkt-1\u201d \/>
<link rel=\u201dalternate\u201d hreflang=\u201dde-ch\u201d<\/strong>
href=\u201dhttps:\/\/beispiel.com\/ch<\/strong>\/produkt-1\u201d \/>
2. Hreflang in xml sitemap<\/strong>
<\/p>\n\n\n\n
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9″
xmlns:xhtml=”http:\/\/www.w3.org\/1999\/xhtml”>
<url>
<loc>https:\/\/beispiel.com\/de\/produkt-1<\/strong>\/<\/loc>
<xhtml:link rel=”alternate” hreflang=”de-ch”<\/strong>
href=”https:\/\/beispiel.com\/ch<\/strong>\/produkt-1″ \/>
<xhtml:link rel=”alternate” hreflang=”de-at”<\/strong>
href=”https:\/\/beispiel.com\/at<\/strong>\/produkt-1″ \/>
<xhtml:link rel=”alternate” hreflang=”de-de” <\/strong>
href=”https:\/\/beispiel.com\/de<\/strong>\/produkt-1″” \/>
<\/url>
<url>
<loc>https:\/\/beispiel.com\/de\/produkt-2<\/strong>\/<\/loc>
<xhtml:link rel=”alternate” hreflang=”de-ch”<\/strong>
href=”https:\/\/beispiel.com\/ch<\/strong>\/produkt-2″ \/>
<xhtml:link rel=”alternate” hreflang=”de-at” <\/strong>
href=”https:\/\/beispiel.com\/at<\/strong>\/produkt-2″ \/>
<xhtml:link rel=”alternate” hreflang=”de-de” <\/strong>
href=”https:\/\/beispiel.com\/de<\/strong>\/produkt-2″” \/>
<\/url>
3. Hreflang in HTTP header<\/strong>
This form of markup is especially suitable for documents that are not in HTML form, for example PDFs:
Link: <https:\/\/beispiel.com\/de\/whitepaper.pdf\/<\/a>>; rel=\u201dalternate\u201d; hreflang=\u201dde-de\u201d
Link: <https:\/\/beispiel.com\/ch\/whitepape.pdf\/<\/a>>; rel=\u201dalternate\u201d; hreflang=\u201dde-ch\u201d
Link: <https:\/\/beispiel.com\/at\/whitepaper.pdf\/<\/a>>; rel=\u201dalternate\u201d; hreflang=\u201dde-at\u201d
<\/p>\n\n\n\nCommon mistakes
<\/h2>\n\n\n