Self-referencing hreflang is one of the most common issues and questions people have when implementing hreflang tags. Best practices recommend that you have self-referencing hreflang tags. But what that means is not clear within Google’s developer pages.

What is Self-Referencing Hreflang?

Self-referencing hreflang means that a particular page that has been translated into other languages is also included in the set of those hreflang attributes.

To be even more clear, your site should contain hreflang tags for every translated version of that page and itself. So, for example, if your site’s content has been translated into French to appear in France, German to appear in Germany, and Japanese to appear in Japan search results, then the on-page hreflang tags should be as follows:

Hreflang tags on US landing page for the blog:

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

Hreflang tags on French translated landing page for the blog:

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

Hreflang tags on German translated landing page for the blog:

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

Hreflang tags on Japanese translated landing page for the blog:

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

Notice that each page contains the same number of hreflang tags on every single page. It also includes each alternate and the page in which the code appears on. This is the self-referencing hreflang in action.

In addition, if you choose to implement hreflang tags within your XML sitemap, your configuration should also include each URL and its alternates, including itself. This means that each page should be referenced within the <loc> tag. It should also then be mentioned in the xlink tag as well.

Example of Self-referencing hreflang tags in XML sitemaps:

<?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.example.com/english/page.html</loc>

    <xhtml:link 

               rel="alternate"

               hreflang="de"

               href="http://www.example.com/deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="de-ch"

               href="http://www.example.com/schweiz-deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="en"

               href="http://www.example.com/english/page.html"/>

  </url>

  <url>

    <loc>http://www.example.com/deutsch/page.html</loc>

    <xhtml:link 

               rel="alternate"

               hreflang="de"

               href="http://www.example.com/deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="de-ch"

               href="http://www.example.com/schweiz-deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="en"

               href="http://www.example.com/english/page.html"/>

  </url>

  <url>

    <loc>http://www.example.com/schweiz-deutsch/page.html</loc>

    <xhtml:link 

               rel="alternate"

               hreflang="de"

               href="http://www.example.com/deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="de-ch"

               href="http://www.example.com/schweiz-deutsch/page.html"/>

    <xhtml:link 

               rel="alternate"

               hreflang="en"

               href="http://www.example.com/english/page.html"/>

  </url>

</urlset>

 

The resource for the code sample above is from Google. For further reading visit: Tell Google about localized versions of your page.

One way to easily check your implementation is to confirm the following: every page that contains translated content (if translated in all languages) should contain the same amount of hreflang tags on every page on your site that is translated into additional languages.

Just as the canonical tag would point to this URL, the hreflang tags should also contain a tag for the page it is on.

This means, for example, that if you have 6 tags on one page, then each page that is translated should also contain 6 hreflang tags.

seoClarity contains an hreflang tag checker within our built-in crawler which identifies the number of tags per page. It’s easy to check to make sure you have the same number of tags by setting the crawl to only the pages that are translated, and then checking the amount of hreflang tags by page. Take a look at this example (note that the specific pages have been removed):

 

You should always have the same amount of tags as the amount of content. In the platform example above, this is seen in the “tags found” column. Tags should always be the same number.

What If I Don’t Use Self-Referencing Hreflang Tags?

If your site does not add a self-referencing hreflang tag, users can be sent to the wrong site in the wrong language. This is an overall bad user experience and can increase bounce rates and decrease time on site. In fact, missing the hreflang tag can have a direct impact on your ROI.

When Not to Use Self-Referencing Hreflang Tags

In instances where the site content itself is not translated into another language, sites perform better without the hreflang tags entirely.

The exception to that would be if, for instance, your site is displaying different pricing or is listed on a different URL, or if your site restricts product to only one specific country. Then hreflang tags can also be used to indicate to Google where you prefer for that URL to appear.

Should You Use the Hreflang Tag on All Pages, Even When Some Have No Alternate?

The answer here is no. If there are pages on your site that do not contain translated versions, do not include an hreflang tag. Some sites use an empty tag or self-reference the page it’s on in these instances, but that is unnecessary and may have negative results (though most likely will be ignored).

Other Common Issues With Hreflang Tags

Some other of the more common issues we have identified with hreflang tags include pages containing conflicting hreflang tags and canonical tags, as well as using the same URL and specifying it to more than one language and country.

Recommended Reading: 12 Common Hreflang Mistakes and How to Prevent Them


Example of Conflicting Hreflang Tags and Canonicals:

US Site

<link rel="canonical" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

FR Site

<link rel="canonical" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

In this instance the canonical would be for the FR site and not the same as the US site.

Example of Specifying One URL to More Than One Language and Country:

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="en-fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

In this instance you would use a global “fr” tag as opposed to listing the URL more than once.

<link rel="alternate" hreflang="en-us" href="https://www.seoclarity.net/blog/" />

<link rel="alternate" hreflang="fr" href="https://www.seoclarity.net/fr/blog/" />

<link rel="alternate" hreflang="de-de" href="https://www.seoclarity.net/de/blog//" />

<link rel="alternate" hreflang="ja-jp" href="https://www.seoclarity.net/ja/blog//" />

Conclusion

If you have an international presence in which you have multiple versions of the same page translated into different languages, then you need to use hreflang tags. Whenever hreflang tags are used, you need to ensure to add a self-reference, or URL of the page itself, just as you would for the canonical tag.