hreflang is an attribute that informs Google and other search engines about the different language versions of a webpage. Web content will then be delivered to match the target region of the user. Correct implementation of the hreflang attribute may thus be of benefit for usability and indirectly for search engine optimization.
With the increasing internationalization of websites, Google introduced the hreflang attribute in 2011. It has the purpose of providing webmasters the opportunity to mark their internationally focused websites, so that the content can be output matching the region.
Two scenarios were originally considered.
Additionally, there is also a third option to use hreflang.
Since the introduction of hreflang, Google has expanded its support with regard to tagging. Since July 2014, integration problems with the hreflang attribute can be checked in the Google Webmaster Tools.
There are basically three ways to implement hreflang for a multilingual website. Here is an example of a German website with English and Swiss German language versions. For languages, the ISO 639-1 codes can be used.  ISO 3166 1 alpha 2 for can be used country abbreviations.
<http://mysite.com/en />; rel="alternate"; hreflang="en"
<?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>http://www.meineseite.de/en/</loc> <xhtml:link rel=”alternate” hreflang=”de” href=”http://www.mysite.de/de/”/> <xhtml:link rel=”alternate” hreflang=”de-ch href=”http://www.mysite.de/de-ch/”/> <xhtml:link rel=”alternate” hreflang=”en” href=”http://www.mysite.de/en/” /> </url> </urlset>
<head> <link rel="alternate" hreflang="en" href="http://meineseite.de/en" /> </head>
What is important here is that the hreflang link element is included in the <head> section of all subpages of a website, so that the identification of the correct language version works through search engines. Consequently, any new language version requires a separate link element.
If individual pages of a website are in the same language but in each case address a different geographical target, the country code must be supplemented with an appropriate language code. In the case of a German website which is focused on Germany and Austria, the hreflang link element would look like this.
<head> <link rel="alternate" hreflang="de-DE" href="http://mypage.de/ " /> </head> <head> <link rel="alternate" hreflang="de-AT" href="http://meineseite.de/at" /> </head>
If a website has a single page that is referenced to all language versions, the hreflang="x-default" can be used. Each page then refers in the <head> through the hreflang="x-default" to this overview page. This tactic lends itself with .com domains, which are internationally oriented and have many language versions.
If you operate websites that are internationally oriented and its content exists in different language versions or its content is in the same language but has regional characteristics, hreflang should definitely be used. That way optimal conditions are created to ensure that the content is delivered in a user-specific way.
Using hreflang per se is not a ranking factor. Nevertheless, insertion of the attribute can indirectly contribute to SEO. Bounce rates can be reduced increasing the length of stay on a site when content is displayed to users on the first visit without the need to select the right language version of the website. At the same time, it also increases the chance of a possible conversion of that same user.
Since regional differences can also be specified with hreflang in the source code, user behavior can be further positively influenced. If a buyer from Switzerland, for example, visits a German web shop based in Germany, the Switzerland version can be referred to directly with hreflang. The shop operator can thereby display a webpage to the German-speaking Swiss customer that is optimized for him specifically, including the appropriate currency, the appropriate delivery costs and possibly even customized content that address cultural particularities of Switzerland. Regionalisms and different spelling versions can be taken into account.
Internationally oriented websites with different languages strengthen their usability and relevance of the page for users by using hreflang. By reducing the bounce rate and increasing the length of time the visitor stays on site, the web store or shop is also indirectly optimized for search engines.