Manual: hreflang Viewer

The feature "hreflang Viewer" of Visual SEO Studio, documented in detail.

hreflang Viewer

This bottom pane tool lists all alternate/hreflang directives found for the selected page.

hreflang viewer in Visual SEO Studio
hreflang viewer in Visual SEO Studio

For each directive it shows where it was found (HTML, HTTP header, XML Sitemap), the language and country name (and sometimes is different than what you thought!), and a complete diagnostic for all potential issues.
You can filter the list based on the issue you are focusing on, and read the list of all missing generic language codes.

Toolbar

Show

Sometimes is better to "see less" in order to concentrate on a single aspect you want to analyze.
This option permits you to filter the alternate/hreflang tags and only show a subset of them matching common issues to be fixed.

Page hreflang viewer, filtering options
Page hreflang viewer, filtering options

  • All hreflang tags in this page
  • hreflang tags with unknown language code
  • hreflang tags with unknown country code
  • hreflang tags with unusual language/country pair
  • hreflang tags pointing to pages not in the crawl session
  • hreflang tags pointing to non-crawled pages
  • hreflang tags pointing to non-HTML resources
  • hreflang tags pointing to 'noindex' pages
  • hreflang tags pointing to non-canonical pages
  • hreflang tags pointing to non-'200 OK' resource
  • hreflang tags pointing to pages with no return tag
  • hreflang tags 'x-default' pointing to cacheable redirects

Each filtering option permits to visualize only the page alternate/hreflang directives which fail one of the tests highlighted in the columns of the table below the control.
You can find an explanation of each issue in the specific columns documentation.

Shown tags

The number of alternate/hreflang tags found matching the filter selected in the "Show" option.

It is shown as a ratio of two numbers: the number of alternate/hreflang tags listed after applying the filter, over the number of all alternate/hreflang tags.
When the selected filter option is "All hreflang tags in this page", it is normal that the two numbers are the same.

Generic languages missing

The number of generic language codes missing on the selected page, along with their comma separated list. Value x-default can also considered.

Page URL

The address of the page pointed by the selected alternate/hreflang tag.

Context menu

The hreflang Viewer table provides a context menu you can trigger by right clicking with the mouse on a page row:

hreflang viewer context menu
hreflang viewer context menu

Context menu command items are:

  • Browse URL
    Navigates with the default browser the URL of the page pointed by the selected alternate/hreflang tag.
  • Show in code
    Selects the Content side panel and there highlights the alternate/hreflang tag.
  • Show in DOM
    Selects the DOM side panel and there highlights the alternate/hreflang tag.
  • Show blocking robots.txt

    Available when the Crawl Status states that the resource was not crawled because of a block in the robots.txt file.
    Once clicked the robots.txt file will be selected in the main view, the Content side pane will be activated, and the corresponding line containing the directive in the robots.txt file will be highlighted.

Column headers

HTML

A symbol stating whether the alternate/hreflang directive was found in the page meta tags.
Possible values are:

  • Internal linkThe alternate/hreflang directive was found in the page meta tags.
  • Blank, otherwise.

HTTP

A symbol stating whether the alternate/hreflang directive was found in the page HTTP headers.
Possible values are:

  • Internal linkThe alternate/hreflang directive was found in the page HTTP headers.
  • Blank, otherwise.

XML

A symbol stating whether the alternate/hreflang directive was found in an XML Sitemap.
Possible values are:

  • Internal linkThe alternate/hreflang directive was found in an XML Sitemap.
  • Blank, otherwise.

hreflang

The value of the hreflang attribute in the alternate/hreflang tag, representing the language code of the page pointed by the href attribute.

Attribute hreflang accepts values that define languages (ISO 639-1) and countries (ISO 3166-1 Alpha 2). A language or a combination of language and country separated by the symbol "-" can be used as a value. A country-only value is not allowed. Macro region values are not valid.

Language Name

The full English name of the language (generic or specific) having the code shown in the "hreflang" column.

This is extremely useful to clarify what the code or combination of codes actually means.

Absolute URL

The absolute URL of the destination address pointed by the alternate/hreflang tag.

Language

A symbol stating whether the alternate/hreflang directive passes the test:
Is the language code a known one?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

Examples of common mistakes are:

  • "jp" does not exist ("ja" is Japanese, "jp" means Japan)
  • "cn" does not mean "Chinese" (use for example "zh-hans" or "zh-hant")
  • "br" is not the code for Brazilian Portuguese ("pt-BR")

Country

A symbol stating whether the alternate/hreflang directive passes the test:
Is the country code a known one?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

Examples of common mistakes are:

  • "en-UK" should be "en-GB"
  • "en-EU" (macro regions are not valid)
  • Various unofficial, “pseudo-ISO” codes

L/C (Language/Country)

A symbol stating whether the alternate/hreflang directive passes the test:
Is the pair language/country a commonly used one?

Possible values are:

  • SuccessYes. Test passed.
  • WarningNo. Test failed. Not necessarily an error, but better double check.

alternate/hreflang rules are relaxed regarding composing ISO codes of language-country pairs.
For example "en-FR" is correct, but unusual and could be a mistake.

Examples of common mistakes are:

  • es-LA” (Spanish spoken in Laos, not in "Latin America")
  • en-NA” (English spoken in Namibia, not in "North America")

Test 1

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to an URL within the crawl session?

Possible values are:

  • SuccessYes. Test passed.
  • WarningNo. Test failed. Not necessarily an error, but better double check.

In the example below the Italian page has an alternate/hreflang tag pointing to the English version of the page, but this one is not in the crawl session.

Example of page with hreflang tag pointing to an out-of-session resource
Example of page with hreflang tag pointing to an out-of-session resource

It means the spider did not explore the page pointed by the alternate/hreflang tag, for a variety of possible reasons. May be because the crawl process stopped before, may be they were external links, and so on. The program is not thus able to check if there are errors in its hreflang implementation.

Test 2

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to a visited page?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

In the example below the Italian page has an alternate/hreflang tag pointing to the English version of the page, but this one cannot be visited by the spider.

Example of page with hreflang tag pointing to a URL the crawled cannot visit
Example of page with hreflang tag pointing to a URL the crawled cannot visit

It means the spider did not explore the page pointed by the alternate/hreflang tag, because something prevented it. In the example the English page is not crawlable because of a Disallow directive in the robots.txt file blocking its access.

Test 3

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to a proper HTML page?

Possible values are:

  • SuccessYes. Test passed.
  • WarningNo. Test failed. Not necessarily an error, but better double check.

The following example depicts the test scenario:

Example of page with hreflang tag pointing to a PDF file
Example of page with hreflang tag pointing to a PDF file

Having the alternate/hreflang tag pointing to a non-HTML resource is not an error per-se, but is extremely rare; it is usually the consequence of a human mistake.

Test 4

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to an indexable page?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

The following example depicts the test scenario:

Example of page with hreflang tag pointing to a 'noindex' page
Example of page with hreflang tag pointing to a 'noindex' page

The two directive are giving conflicting signals to the search engine:
The noindex says the destination page should not be indexed by the search engines, the alternate/hreflang says is should be indexed to be shown in SERP to users with a certain localization.
What the search engine will do is not predictable; in our experience Google takes the most restrictive directive and avoid indexing the destination page (but this is not a documented behavior and thus nothing guarantees it will work the same in the future).

Test 5

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to a page with canonical URL?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

The following example depicts the test scenario:

Example of page with hreflang tag pointing to a non-canonical page
Example of page with hreflang tag pointing to a non-canonical page

The two directive are giving conflicting signals to the search engine:
The canonical link tag (non self-referring) says the destination page should not be indexed by the search engines because the page pointed by the canonical link tag should, the alternate/hreflang says is should be indexed to be shown in SERP to users with a certain localization.
What the search engine will do is not predictable.

Test 6

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to a page with status code '200 OK'?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

The following example depicts the test scenario:

Example of page with hreflang tag pointing to a non-existing page
Example of page with hreflang tag pointing to a non-existing page

The destination page of the alternate/hreflang tag should of course return a "200 OK" status code.
The only exception to the rule is when the attribute value is hreflang="x-default" and the destination page status code is a non-cacheable redirect (e.g. HTTP status codes 302, 303 or 307), then the case would not be reported here.

Test 7

A symbol stating whether the alternate/hreflang directive passes the test:
Is the HREF pointing to a page with return tag?

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

Two versions of the same logical page in different languages should point to each other with the alternate/hreflang tag.
If they don't, the tags will be ignored. The rule was created to prevent an external site to arbitrarily name itself as an alternative version of one of your pages.

The following example depicts the test scenario:

Example of page with hreflang tag with no return tag
Example of page with hreflang tag with no return tag

In the example the Italian version of the page has an alternate/hreflang tag pointing to the English version, which does not return a tag pointing to the Italian version.

Test 8

A symbol stating whether the alternate/hreflang directive passes the test:
Is the x-default hreflang tag pointing to non-cacheable redirect? (if it points to a redirect)

Possible values are:

  • SuccessYes. Test passed.
  • ErrorNo. Test failed.

One of the uses of the "x-default" value of the hreflang attribute is for URLs redirecting users based on their location or language preference.
This solution is sometimes used for the root domain address of multilingual websites where all languages have a dedicated subfolder or subdomain.

In such cases it is important the redirection to be "non-cacheable", i.e. a temporary redirect like HTTP status codes 302, 303 or 307 (it is a valid rule even when no hreflang is set).
In case of cachable redirect, like for example HTTP status codes 301 or 308, the browser would remember the redirection requesting the next time directly the destination URL. A change of language preferences would fail to get the desired result.

HREF

The value of the href attribute in the HTML markup of the alternate/hreflang tag.
Google requires attribute href of an alternate/hreflang to contain an absolute URL (even though HTML specifications would permit a relative URL).

Line

The line in the HTML file where the alternate/hreflang was found.
The cell is an active link; clicking on it will highlight in the Content or DOM side panel (depending on what you choose from the resulting context menu) the alternate/hreflang tag.

Position

The horizontal coordinate in the HTML file where the alternate/hreflang was found.
The cell is an active link; clicking on it will highlight in the Content or DOM side panel (depending on what you choose from the resulting context menu) the alternate/hreflang tag.

robots.txt

A symbol stating whether the visit to the URL pointed by the alternate/hreflang tag is allowed by the robots.txt file.
Possible values are:

  • robots.txt blockedAccess to the resource pointed by the alternate/hreflang tag is blocked by the robots.txt file.
  • Blank, when no blockage by robots.txt was detected.

Blocking directive in robots.txt

When the URL pointed by the alternate/hreflang tag is internal, but could not be followed because of a block in the robots.txt file, the cell reports the blocking directive of the robots.txt file.
The directive has an active link: once clicked the robots.txt file will be selected in the main view, the Content side pane will be activated, and the corresponding line containing the directive in the robots.txt file will be highlighted.

Internal

A symbol stating whether the page pointed by the alternate/hreflang tag is an internal site page or an external resource.
Possible values are:

  • Internal linkThe alternate/hreflang tag points to an INTERNAL resource.
  • External linkThe alternate/hreflang tag points to an EXTERNAL resource.