Skip to content

HRefLangs tags

Validated HRefLang tags with errors

SEOInfo includes an automatic validator for HrefLang tags. It will check in the background any HRefLang tag found in a page for errors. This is done in accordance with Google specification for localized versions of a page

Hrelang tags locations

Per the above specification, SEOInfo only looks at HRefLang attributes attached to <link> elements located in the <head> section of HTML documents. Regular links inside of <body> with hreflang attributes will not be taken into account. HReflangs in response headers and sitemaps are not handled at the moment.

Validation

Validation of HRefLang tags starts automatically as soon as they are found in a page you navigate too. Static results are available immediately under the HRefLang accordion on the MAIN tab.

Validated HRefLang tags

Here is another page with errors this time:

Validated HRefLang tags with errors

Hovering over the red circle icon will display the more detailed error message in a bubble. Clicking it will display the error in a modal box.

Validation process

SEOInfo will check the following whenever one or more HRefLang are found on a page:

  • Validate that each link is fully qualified, including transport method (http/https).
  • Validate language code against iso639-1
  • Validate country code against iso3266-1 alpha 2
  • Validate language script variations against iso15924
  • Check language codes with multiple entries
  • Check for multiple x-default entries
  • Check for meta robots blocking current page
  • Check for robots.txt blocking current page
  • Display language and country or script variation in plain text for verification

Language names

SEOInfo includes a full list of language, country and script variation codes and as such can validate them instantly. As the actual language/country/variation is displayed in clear text, you can thus verify that the specified language is the desired one.

HRefLang targets validation process

SEOInfo will automatically loads each HRefLang attribute target page in the background and check that they are valid as well. This is important as the HRefLang specification (at least by Google) sets forth that all hreflang links must be reciprocal.

So even if hreflang links are valid on a page, they are not really valid until all corresponding hreflangs tags are found and validated on the target pages as well.

Here are the checks SEOInfo will perform on the HRefLang tags found in target pages:

  • All hreflangs must be present
  • Language code and country/script variations checks
  • Check for multiple entries
  • Check for meta robots blocking
  • Check for robots.txt blocking

NB: verification of the target page for each HRefLang tag is throttled, that is SEOInfo makes sure to avoid overloading the target server with too many requests.