Automate your affiliate marketing. Read our expert review of Dolphin Anty. Read Review

Meta Tags and Hreflang Checker: Check Hreflang Errors

5 of 1 ratings

Enter the address of a page. The server of dieg.dev opens it, shows everything in its head (title, meta tags, link tags, canonical, robots) and checks its hreflang annotations. The tags that a script adds after the page is loaded are not seen.

Opens every page from the hreflang list (up to 8): its status, the redirects, and whether it links back to this page. It needs one request for every page, so it is slower.

Hreflang tag generator

List the versions of a page: the address, the language and, if needed, the region. You get the link tags for the head, the HTTP header, and the XML sitemap. Everything is made in your browser and nothing is sent or saved. Put the same set of tags on every version of the page. Choose a region only when you have separate versions of one language for different countries (for example en-GB and en-US): the list shows the usual regions of the language first.

Address of the version Language (ISO 639-1) Region (ISO 3166-1)
The page for users whose language is not in the list. Choose one of the addresses above.
all three results as one text, for a message to a developer

Meta Tags and Hreflang Checker: Read the Head of a Page and Find Hreflang Errors

Enter an address and the tool shows everything in the head of the page: the title, every <meta> tag (name, property, http-equiv and charset), the <link> tags, the canonical address and the robots rules, including the header X-Robots-Tag. The main part is the check of hreflang: the result is shown at the top of the page, in red when there is an error. Below the checker there is a generator of hreflang tags: for every language it offers first the regions that are usual for it, and the copy buttons give you the result as a text that you can send to a developer. A meta tags checker and an hreflang validator in one page.

What hreflang is

The annotations of hreflang tell Google which versions of a page exist for other languages and regions. Google describes three ways to give them, and the tool reads the first two:

  • Link tags in the head: <link rel="alternate" hreflang="en-GB" href="https://example.com/en/" />, one for every version, including the page itself.
  • The HTTP header Link, used for files that are not HTML: Link: <https://example.com/en/>; rel="alternate"; hreflang="en-GB", ...
  • A sitemap with xhtml:link elements inside every url. The tool does not read sitemaps, but the generator below can make one.

The rules that the check uses

They come from the documentation of Google, "Tell Google about localized versions of your page":

  • "Each language version must list itself as well as all other language versions."
  • "If two pages don't both point to each other, the tags will be ignored." This is the return link, and the deep check opens the alternate pages to look for it.
  • "Alternate URLs must be fully-qualified, including the transport method (http/https)."
  • The language is a code of ISO 639-1 (two letters) and the region a code of ISO 3166-1 Alpha 2. "You can't specify the country code by itself." Google ignores an invalid region code, and it names EU, UN and UK as examples (the code of the United Kingdom is GB).
  • x-default is a reserved value for users whose language settings do not match any of your versions.

What the tool reports

  • Errors (red): an unknown language or region code, a region without a language, an underscore instead of a hyphen, a three-letter language code, an address that is not fully qualified, a page that does not list itself, one value that points to different addresses, and, in the deep check, an alternate page that cannot be opened, returns an error status, or does not link back.
  • Warnings (amber): the same annotation repeated, a list with no other version, a canonical address that differs from the address of the page, an alternate address that redirects, an alternate page with noindex or with another canonical address.
  • Notes (blue): no x-default, a noindex rule on the page, no hreflang found, the number of pages that were not checked.

The result "no hreflang problems found" means that these checks passed. It is not a promise about what a search engine will do. The list of the language and region codes comes from open data sets of the ISO standards, and the check is not case sensitive. Run the tool on every language version too: each version has its own set of tags.

How the generator chooses the regions

For every language the generator shows first the regions that are usual for it, and all the other regions stay in the list below them. The usual regions come from the file territoryInfo.json of the Unicode CLDR (version 48): a region is taken when the language has an official status there and the GDP of the region is at least 1% of the sum of the GDP of all the regions where the language is official; at most 12 regions, the biggest first. For English this gives US, IN, GB, CA, AU, PK, NG, PH, ZA, SG and IE, for Russian RU, KZ, UA and BY, for Portuguese BR, PT, AO, MO and MZ. A pair that is not in the list, for example de-CU, is still possible: the generator only adds a note under the table. It is a hint of the interface, not a rule of Google. Choose a region only when you have separate versions of one language for different countries.

The deep check of the alternate pages

When you tick "Also check the alternate pages", the tool opens every address from the hreflang list (up to 8) and reads its status, the redirects, its own hreflang annotations, its canonical address and its robots rules. If an alternate page does not list the checked page, you get an error about the missing return link. It makes one request for every page, so it is slower and is limited more strictly.

What the meta tags mean

  • <meta charset="utf-8"> declares the character encoding of the document. MDN: UTF-8 is the only valid encoding for HTML5 documents, and the tag must be located entirely within the first 1024 bytes of the document. Google also recommends UTF-8.
  • name and content work together as a name and a value of the metadata. http-equiv defines a pragma directive, an instruction for the browser; its allowed values are names of equivalent HTTP headers.
  • description: Google says that this tag provides a short description of the page, and in some situations the description is used in the snippet in search results.
  • robots and googlebot control the behavior of crawling and indexing. The first applies universally, the second is specific to Google.
  • viewport tells the browser how to render the page on a mobile device; its presence indicates to Google that the page is mobile friendly. MDN recommends <meta name="viewport" content="width=device-width" /> and warns that user-scalable=no prevents people with low vision from reading the page.
  • keywords: Google says that the meta keywords tag is not used by Google Search, and it has no effect on indexing and ranking at all.

Good to know

  • The tool reads the HTML as the server delivers it (the first 1.5 MB). Tags that JavaScript adds after the page is loaded are not seen.
  • The request is made from the server of dieg.dev. The tool sends its own name in the User-Agent (DiegDevChecker) and only plain GET requests. Only public addresses and the usual web ports are checked, and the number of checks is limited. A short journal of the checks (the checked host, the time and a code of the visitor, not the address) is kept for 7 days to answer complaints.

Related tools

To see the status codes and the whole redirect chain use the HTTP status code and redirect checker, to split an address into its parts the URL parser, and to measure how fast a page starts to answer the TTFB checker.

Similar tools

HTTP Status Code & Redirect Checker

Check the HTTP status code and response headers of any URL and follow the whole redirect chain (301, 302, 307, 308) step by step, with server IP and timings.

42
Free Online URL Parser: Extract Link Components

Fast and free URL parsing tool by DIEG. Extract host, protocol, path, and query parameters instantly. Essential DevTool for webmasters and SEO experts.

16
TTFB Checker: Test Time to First Byte Online

Free TTFB checker: measure the time to first byte of any website with DNS, connect, TLS and server wait times, from 1 to 5 runs and a median result.

293

Popular tools