Definition
A canonical URL is the preferred address for a page among duplicate or very similar URLs. A page can declare its preferred version with a canonical link element. This gives search engines a signal about which URL should represent the content when they choose how to consolidate duplicates.
When canonical URLs help
They are useful when the same content is reachable through tracking parameters, print views, alternate paths, or other URL variants. Choose a preferred URL that loads the intended page, uses the correct secure host, and is consistent with internal links and the sitemap.
Canonicalization is a signal, not a command. Google may select a different canonical when other evidence points elsewhere. A canonical tag also does not replace a redirect when a URL has moved permanently, or a noindex directive when a page should not appear in search.
Review the whole URL setup
Check that the declared canonical returns a successful response and is not blocked from crawling. Use the same preferred host and URL style in internal links and sitemap entries. For retired pages, redirect to a close replacement or return an appropriate not-found or gone status when no replacement exists.