A canonical marks the preferred URL among duplicate or very similar pages. It's most often written as a link rel="canonical" element in the HTML head.
What a canonical solves
The same content can be reachable through parameters, different protocols or several categories. The canonical helps Google consolidate signals and choose the URL it should show in results.
Google treats it as a strong signal and still makes its own call. If the other information points elsewhere, it may choose a different canonical URL.
How to set it up
Every indexable main page can point to itself. Duplicate variants point to the preferred absolute URL.
Internal links, the XML sitemap, redirects and hreflang should agree with the canonical. Conflicting signals make it harder to pick the right version.
Where it most often goes wrong
- every page points its canonical to the homepage,
- the canonical leads to a redirect or a non-indexable URL,
- the sitemap and internal links use a different variant,
- language versions point to one version without a good reason.
A canonical doesn't replace a redirect. If you're retiring an old URL and users should always land somewhere else, use a proper server-side redirect.