Difference between revisions of "Hreflang"

From Seobility Wiki
Jump to: navigation, search
(Similar articles)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<seo title="hreflang - What does that mean?" metadescription="In this article, you will learn what hreflang is used for and how to implement this annotation correctly in HTML code." />
+
<seo title="hreflang: Definition and SEO Best Practices" metadescription="Learn what hreflang is used for and how it can be implemented in HTML code following SEO best practices!" />
  
 
== Definition ==
 
== Definition ==
 
 
[[File:Hreflang.png|thumb|450px|right|alt=hreflang|'''Figure:''' hreflang - Author: Seobility - License: [[Creative Commons License BY-SA 4.0|CC BY-SA 4.0]]|link=https://www.seobility.net/en/wiki/images/8/89/Hreflang.png]]
 
[[File:Hreflang.png|thumb|450px|right|alt=hreflang|'''Figure:''' hreflang - Author: Seobility - License: [[Creative Commons License BY-SA 4.0|CC BY-SA 4.0]]|link=https://www.seobility.net/en/wiki/images/8/89/Hreflang.png]]
  
Line 25: Line 24:
  
 
* If pages have been translated completely into other languages, e.g. if there is a German, English and French version.
 
* If pages have been translated completely into other languages, e.g. if there is a German, English and French version.
* If most parts of a page are maintained in a particular language, but parts such as the navigation bar or footer are adapted to different languages. This is especially the case if pages contain user-generated content, e.g. in forums.
+
* If most parts of a page are maintained in a particular language, but parts such as the [[Website Navigation|navigation]] bar or [[Footer|footer]] are adapted to different languages. This is especially the case if pages contain [[User-Generated Content|user-generated content]], e.g. in forums.
 
* If several pages share the same language, but there are small regional differences such as different currencies or spellings. Example: There are two versions of an English page, one for users in the US and the other for users from the UK. In this case, it is especially important to use hreflang, as search engines might otherwise interpret the pages as [[Duplicate Content|duplicate content]].
 
* If several pages share the same language, but there are small regional differences such as different currencies or spellings. Example: There are two versions of an English page, one for users in the US and the other for users from the UK. In this case, it is especially important to use hreflang, as search engines might otherwise interpret the pages as [[Duplicate Content|duplicate content]].
 
* If individual pages have been translated or should only be accessible for certain languages ​​or countries, and the other users are to access a standard/default page.
 
* If individual pages have been translated or should only be accessible for certain languages ​​or countries, and the other users are to access a standard/default page.
Line 59: Line 58:
 
<pre><xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/" /></pre>
 
<pre><xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/" /></pre>
  
Which of these three alternatives you should use depends on the size and structure of your website.
+
Which of these three alternatives you should use depends on the size and [[Website Structure|structure]] of your website.
  
 
== How to use hreflang correctly ==
 
== How to use hreflang correctly ==
Line 74: Line 73:
 
Although the use of hreflang is not a direct ranking factor, it can indirectly impact the search engine optimization (SEO) of a website. For example, if hreflang links are missing or not implemented correctly, search engines might consider the content of two alternative language versions as duplicate content, which can have a negative effect on the SEO and ranking of these pages.
 
Although the use of hreflang is not a direct ranking factor, it can indirectly impact the search engine optimization (SEO) of a website. For example, if hreflang links are missing or not implemented correctly, search engines might consider the content of two alternative language versions as duplicate content, which can have a negative effect on the SEO and ranking of these pages.
  
Furthermore, using hreflang correctly will result in each user receiving only relevant search results, which will improve their user experience. This, in turn, can increase dwell times and reduce your bounce rate, which will positively impact your SEO and Google's evaluation of your page.
+
Furthermore, using hreflang correctly will result in each user receiving only relevant search results, which will improve their [[User Experience|user experience]]. This, in turn, can increase dwell times and reduce your [[Bounce Rate|bounce rate]], which will positively impact your SEO and Google's evaluation of your page.
  
 
However, you should bear in mind that alternate links are only an indication to Google which can also be ignored. Thus a positive impact on SEO can not be guaranteed.
 
However, you should bear in mind that alternate links are only an indication to Google which can also be ignored. Thus a positive impact on SEO can not be guaranteed.
Line 89: Line 88:
 
[[Category:Search Engine Optimization]]
 
[[Category:Search Engine Optimization]]
 
[[Category:Web Development]]
 
[[Category:Web Development]]
 +
 +
<html><script type="application/ld+json">
 +
    {
 +
      "@context": "https://schema.org/",
 +
      "@type": "ImageObject",
 +
      "contentUrl": "https://www.seobility.net/en/wiki/images/8/89/Hreflang.png",
 +
      "license": "https://creativecommons.org/licenses/by-sa/4.0/",
 +
      "acquireLicensePage": "https://www.seobility.net/en/wiki/Creative_Commons_License_BY-SA_4.0"
 +
    }
 +
    </script></html>
 +
 +
{| class="wikitable" style="text-align:left"
 +
|-
 +
|'''About the author'''
 +
|-
 +
| [[File:Seobility S.jpg|link=|100px|left|alt=Seobility S]] The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about <html><a href="https://www.seobility.net/en/wiki/Seobility_Wiki_Team" target="_blank">the people behind the Seobility Wiki</a></html>.
 +
|}
 +
 +
<html><script type="application/ld+json">
 +
{
 +
  "@context": "https://schema.org",
 +
  "@type": "Article",
 +
  "author": {
 +
    "@type": "Organization",
 +
    "name": "Seobility",
 +
    "url": "https://www.seobility.net/"
 +
  }
 +
}
 +
</script></html>

Latest revision as of 16:07, 6 December 2023

Definition

hreflang
Figure: hreflang - Author: Seobility - License: CC BY-SA 4.0

hreflang is used when different languages ​​or contents with regional differences exist on a website. Its purpose is to tell search engines which URL to use for which language ​​and region. Thus, each page is assigned to the right country version of a search engine, ensuring that users from a particular country only see the pages that are relevant to them in search results. The attribute was introduced by Google in 2011 to better understand the international architecture of websites.


hreflang Checker

Check alternate and hreflang links on your web page

Application scenarios

Google recommends the use of hreflang in the following scenarios:

  • If pages have been translated completely into other languages, e.g. if there is a German, English and French version.
  • If most parts of a page are maintained in a particular language, but parts such as the navigation bar or footer are adapted to different languages. This is especially the case if pages contain user-generated content, e.g. in forums.
  • If several pages share the same language, but there are small regional differences such as different currencies or spellings. Example: There are two versions of an English page, one for users in the US and the other for users from the UK. In this case, it is especially important to use hreflang, as search engines might otherwise interpret the pages as duplicate content.
  • If individual pages have been translated or should only be accessible for certain languages ​​or countries, and the other users are to access a standard/default page.

Structure of the alternate link element

The hreflang annotation in the head section of an HTML document is structured as follows:

<link rel="alternate" hreflang="xx-XX" href="URL" />
  • <link opens the link element and indicates that there is a relationship between the current page and the specified URL
  • rel="alternate" tells search engines that there is an alternative version of the current document
  • hreflang="xx-XX": This attribute specifies for which language (xx) and, if applicable, for which region (XX) the following URL should be displayed. Languages must be indicated in ISO 639-1 format and countries in ISO 3166-1 Alpha 2 format.
  • the attribute href="URL" specifies the URL of the alternative version of the current document
  • /> closes the link element

For example, if you have a German web page and you want to refer to the English version of it, you have to use the following code:

<link rel="alternate" hreflang="en" href ="http://www.example.com/" />

Implementation

As already mentioned, hreflang can be used in a link element in the head area of ​​the HTML code. However, this is not possible if the file is not saved as an HTML file but as PDF, for example. In this case, you have two options:

1. Specification in HTTP response header:

Link: <http://www.example.com/>; rel="alternate"; hreflang="en"

2. Specification in an XML Sitemap:

This variant is particularly suitable for very large websites with many different language versions since it can limit the effort of implementing the hreflang annotation here. In this case, an xhtml:link element must be added to each URL element of the sitemap:

<xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/" />

Which of these three alternatives you should use depends on the size and structure of your website.

How to use hreflang correctly

You should consider the following aspects when using alternate links:

  • Basically, each page that contains alternate links also has to link to itself, i.e. on a German web page, the HTML code must also refer to the German version of this page.
  • In addition, each referenced page must link back to the referring page. This means that if a German page refers to the English version of this page, the English page must also refer back to the German version (bidirectional linking, see figure above). Otherwise, Google may ignore or misinterpret the hreflang annotation.
  • In addition, you have to ensure that the language or country codes are correctly specified in accordance with the ISO standard. Although it is possible to only specify a language, the sole indication of a country is invalid. The capitalization of country codes is not necessary.
  • If a web page only offers alternate page versions for certain languages ​​or countries and the other visitors are to be directed to a standard page, this general page can be defined with the attribute value hreflang="x-default".

Indirect Relevance of hreflang for Search Engine Optimization (SEO)

Although the use of hreflang is not a direct ranking factor, it can indirectly impact the search engine optimization (SEO) of a website. For example, if hreflang links are missing or not implemented correctly, search engines might consider the content of two alternative language versions as duplicate content, which can have a negative effect on the SEO and ranking of these pages.

Furthermore, using hreflang correctly will result in each user receiving only relevant search results, which will improve their user experience. This, in turn, can increase dwell times and reduce your bounce rate, which will positively impact your SEO and Google's evaluation of your page.

However, you should bear in mind that alternate links are only an indication to Google which can also be ignored. Thus a positive impact on SEO can not be guaranteed.

Related links

Similar articles

About the author
Seobility S
The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about the people behind the Seobility Wiki.