Hreflang: The Frequently Asked Questions

In the last five years, I provided technical support to the customers of Hreflang Manager. A plugin for WordPress that allows to specify the alternative versions of a page for different languages or regions with hreflang.

In general, the support questions for a WordPress plugin are strictly related to the plugin itself, but in this case, most of the questions were related to the general concepts associated with hreflang.

In this article, you can find the most common questions I had to answer.

Why do I receive the “No Return Tag” error?

When Google analyzes a hreflang entry verifies the referenced page. If the entries in the referenced page don’t include a reference to the originating page Google generates the “No Return Tag” error.

In other words, if page A includes a reference to page B, page B must include a reference back to page A.

Example

If the page https://example.com/en/ for English speaking users implements hreflang like this:

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />

The page https://example.com/es/ for Spanish speaking users should link back to https://example.com/en/ by using the same references:

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />

How to use the x-default attribute value?

The x-default attribute value should be used to define a default page for all the languages or regions you did not explicitly specify.

Example

Here there is a version of the page for English speaking users, an alternative version for Spanish speaking users and an alternative version for all the users that are not English speaking or Spanish speaking.

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

The table below represents the behavior of Google with the implementation above and specific categories of users:

Category of UsersPage Served by Google
English speaking searchershttps://example.com/en/
Spanish speaking searchershttps://example.com/es/
German speaking searchershttps://example.com/
French speaking searchershttps://example.com/

Why Google doesn’t see my hreflang implementation?

The Google Search Console doesn’t provide instant results. It takes days to update the international targeting information based on your hreflang implementation.

For this reason, my recommendation for a perfect implementation is to:

  1. Implement hreflang
  2. Use a testing tool to verify the implementation and fix errors that may arise
  3. Verify again hreflang on the Google Search Console after a few days

Does hreflang perform a redirect?

Hreflang gives directives about the language and geographic targets of specific pages of your website to the search engines.

Having hreflang implemented changes the pages served by the search engines, but the browser doesn’t apply any redirect.

Is it enough to implement hreflang on the homepage?

No, hreflang should be implemented on all the pages of your website that have an alternative version.

Does the order of the references matter?

No, the order of the references to the alternative versions of the page is not relevant.

How to test the implementation of Hreflang?

Here are different methods you can use to test hreflang:

  • Manually, by carefully inspecting the HTML/HTTP Header/Sitemap (depending on the type of implementation)
  • With one of the many hreflang testing tools available on the web, like Merkle SEO hreflang tag testing tool, HREFLang checker and validator, etc.
  • With the Hreflang Tag Checker Chrome extension (works only if hreflang is implemented with HTML tags)
  • By checking the International Targeting page of the Google Search Console when Google updates the data

How to use hreflang and canonical together?

The canonical URL is used to signal the URL used as the official version of a page when multiple URLs generate the same content.

When you implement hreflang, use the canonical URL of all the referenced pages.

Example

Assume that https://example.com/en/ is the page for English speaking users and that https://example.com/es/ is the page for Spanish speaking users.

With a correct HTML implementation of hreflang and canonical, in the head section of https://example.com/en/ you will find this markup:

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="canonical" href="https://example.com/en/" />

And in the head section of https://example.com/es/ you will find this markup:

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="canonical" href="https://example.com/es/" />

Do I have to link the pages referenced with hreflang?

Adding a selector with the links to the alternative versions of the page is appropriate in most cases, but the interface elements don’t have any relation with the implementation of hreflang.

Is there a way to automate the implementation process?

If the URL structure of the alternative version of the page is predictable you can use a server side scripting language like PHP to generate the hreflang implementation.

Example

This is an example of a hreflang implementation with alternative pages that have a predictable structure.

<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/hello-world/" />
<link rel="alternate" hreflang="en-ca" href="https://example.com/en-ca/hello-world/" />
<link rel="alternate" hreflang="en-au" href="https://example.com/en-au/hello-world/" />

If instead the URL structure of the alternative version of the page is not predictable, the hreflang implementation should be manually created. In other words the website administrators or editors have to manually add the URLs of the alternative versions.

This is an example of a hreflang implementation with alternative pages that don’t have a predictable structure:

<link rel="alternate" hreflang="en" href="https://example.com/en/hello-world/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/hola-mundo/" />
<link rel="alternate" hreflang="it" href="https://example.com/it/ciao-mondo/" />

What should I do with the pages that don’t have an alternative version?

Do not implement hreflang on these pages.

Where can I learn more about hreflang?

Use this documentation page provided by Google as a reference.

What are the different methods to implement hreflang?

There are three different ways to implement hreflang.

Note that each implementation method includes an example where there is a page targeted at English speaking users with an alternative version targeted at Spanish speaking users.

HTML Tags

This implementation is the one used in the examples available in this article and consists in adding the link elements in the head section of the page.

Example

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" /> 

HTTP Headers

You can also indicate the alternative version of a page by including specific data in the HTTP Header.

Example

Link: <https://example.com/en/ >; rel="alternate"; hreflang="en",
      <https://example.com/es/ >; rel="alternate"; hreflang="es" 

Sitemap

The alternative versions of a page can be specified inside a sitemap.

Example

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="https://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/en/</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="https://example.com/en/ "/>
    <xhtml:link 
               rel="alternate"
               hreflang="es"
               href="https://example.com/es/"/>
  </url>
  <url>
    <loc>https://example.com/es/</loc>
     <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="https://example.com/en/ "/>
    <xhtml:link 
               rel="alternate"
               hreflang="es"
               href="https://example.com/es/"/> 
  </url>
</urlset>

Start with our Powerful WordPress Plugins

Discover the WordPress Plugins in our portfolio and all their features. Use powerful tools for your websites and win the competition.