Website monitoring · No. 17
Canonical and hreflang check
In short
Canonical is a tag a page uses to tell search engines which address is its main one. For a regular page, it should point to the page itself. Hreflang is markup that links the language and regional versions of a page so that Google shows people the version in their language. Both break silently: after an update the canonical starts pointing to another page, a non-existent language code like “ua” appears in hreflang, a language version stops linking back. Then Google ignores the markup, and the wrong version of the page shows up in search.
Contents
What are canonical and hreflang?
Canonical is the <link rel="canonical" href="…"> tag in the page code. It tells Google which address to treat as the main one if the same page can be opened at several addresses. For a regular page, the canonical points to the page itself — Google recommends exactly that:
“Do include a rel="canonical" link on the canonical page itself (also known as a self-referential canonical).”
Hreflang is the set of <link rel="alternate" hreflang="…" href="…"> tags that list the language and regional versions of a page. Google uses them to show a person the version in their language or for their country (Google documentation).
An hreflang code consists of a language code and, optionally, a country code. This is where mistakes happen most:
| What was meant | Correct | Mistake |
|---|---|---|
| Ukrainian | uk or uk-UA | ua — a country code, not a language code |
| English for the United Kingdom | en-GB | en-UK — there’s no such country code |
| A version for all other languages | x-default | — |
What’s the harm in canonical and hreflang mistakes?
A canonical pointing to another page tells Google: this page is a copy, show the other one. A category page with a canonical to the home page, or a product with a canonical to another model, may drop out of search even though nobody blocked it. At the same time, canonical is only a hint: “indicating a canonical preference is a hint, not a rule” (Google documentation), so the outcome of the mistake is unpredictable.
Hreflang only works when all versions agree with each other:
“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.”
- The wrong language in search. If hreflang is ignored, a person in Poland may get the Ukrainian version, and a person in Ukraine the Russian one.
- A broken version in the pair. A language version returns 404, is blocked with noindex or has a canonical to another address — and the pair doesn’t work.
- Nobody sees the mistake. The site works, the language switcher works. Search Console no longer has a separate report on hreflang errors, so the problem is noticed from falling traffic from other countries.
Why do canonical and hreflang break?
Mostly because of templates and plugins:
- Canonical from a template. The theme outputs a canonical to the home page on every page, or to the first category page on every pagination page.
- Copied pages. A new page was created as a copy of an old one, canonical included.
- Wrong language codes. Someone entered
uainstead ofukoren-UKinstead ofen-GBin the translation plugin settings. - A deleted or moved version. A language version moved to another address, but hreflang on the other versions wasn’t updated.
- Different markup on different versions. One language version was updated and the others weren’t, so they stopped linking to each other.
- A duplicate code. The same language code is listed twice with different addresses.
How do you spot a canonical or hreflang problem?
The signs are in the page code and in search:
| What you see | Likely cause | What to do |
|---|---|---|
| The canonical points to another address | A template or a copied page | Point the canonical to the page itself |
| The page has no canonical | The theme or plugin doesn’t output it | Add a self-referencing canonical |
hreflang contains ua or en-UK | A wrong language or country code | Replace it with uk / en-GB |
| The page doesn’t list itself in hreflang | The plugin lists only the other versions | Add an hreflang line with the page’s own address |
| A language version doesn’t link back | The versions were updated separately | Align hreflang on all versions |
| Search shows the wrong language version | hreflang was ignored | Check the codes, return links and canonical of all versions |
How to check canonical and hreflang yourself
You’ll need a browser and some attention to detail:
- Open the page source (
Ctrl+U) and findrel="canonical". The address should match the page’s address. - Find all
hreflanglines. Check the codes: the language is two letters (uk,en), the country comes after a hyphen (uk-UA,en-GB). The page itself should be among the versions. - Open each language version: it should open, not be blocked with noindex, have a canonical to itself and link back to your page in hreflang.
- Make sure each code appears only once.
- Or use the FullCheckApp “Canonical and hreflang” check and get the results in a clear visual format.
For a site in five languages, that’s dozens of clicks per page — and they should be repeated after every update.
If you chose the last option, you’ve already made the right call: the check runs automatically, and you’ll be the first to know about any warning or critical issue.
What FullCheckApp checks
“Canonical and hreflang” is one of the four checks in the SEO block. It works for the home page and the pages added to monitoring. The default severity is a warning.
- Canonical. The tag is present and points to the same page.
- Language and country codes. The codes are correct; common mistakes get a hint:
ua→uk,en-UK→en-GB. - One code, one address. The same code isn’t listed twice with different addresses.
- A link to itself. The page is in its own list of versions.
- Return links. FullCheckApp opens and checks each language version on the site’s domain: it works, isn’t blocked from indexing and links back. Versions on other domains aren’t checked.
ua — there’s no such language code; Ukrainian is uk (or uk-UA)
de · https://example.com/de/ — no return link to /uk/
Whether the page itself is blocked from indexing is shown by the noindex and nofollow check, and whether it opens at several addresses — by the duplicate URL check.
FAQ
Should the canonical always point to the page itself?
For pages that should be in search — yes. A canonical to another address is set on purpose for copies: sorting and filter pages, versions with parameters. But such pages are usually not added to monitoring. If a canonical to another address appears on the home page, a category or a product page, it’s most often a template error.
Why is “ua” a mistake if everyone writes it?
In hreflang, the language comes first, per ISO 639-1, and Ukrainian is “uk” there. UA is the country code for Ukraine per ISO 3166-1, and it can only come second: uk-UA. Google doesn’t recognize “ua” as a language, so such an hreflang line doesn’t work.
What is a return link in hreflang?
It’s the hreflang line on a language version that points back to your page. If the Ukrainian page links to the English one, the English one must link to the Ukrainian one too. Google says that if two pages don’t both point to each other, the tags are ignored.
Do I need x-default?
It’s not required, but Google recommends it for language or country selector pages and for home pages that automatically redirect visitors. x-default shows which version to open for people whose language has no version of its own.
Why aren’t versions on other domains checked?
FullCheckApp checks the site you added and doesn’t open other domains without your knowledge. If your language versions live on separate domains, add them to monitoring as separate sites — then their markup will be checked too.
Sources
- Google Search Central — How to specify a canonical with rel="canonical" and other methodsdevelopers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
- Google Search Central — What is URL canonicalizationdevelopers.google.com/search/docs/crawling-indexing/canonicalization
- Google Search Central — Tell Google about localized versions of your pagedevelopers.google.com/search/docs/specialty/international/localized-versions
Check your website
Add your website address — the first check runs right away, and you’ll see the status of every item in this article.
Check for free