Canonical URL is the “official” address of a page — the one you want Google and other engines to treat as the original when the same (or nearly the same) content can be reached at several URLs.
To a person, yoursite.com/menu, www.yoursite.com/menu, and yoursite.com/menu?ref=instagram look like one page. To a crawler they can look like three. A canonical tag (rel="canonical") points them at the version you care about so rankings, backlinks, and keywords don’t split. It complements a sitemap (discovery) and robots.txt (what to fetch). It does not replace clean web architecture.
A real-life example of a canonical URL
You publish a recipe on your own site, then syndicate it to Medium. Without a canonical back to your URL, search may rank Medium first — you did the work, they get the click. Closer to home: a Decatur bakery shares a catering page with UTM parameters. If those tracking URLs get indexed as separate pages, the real menu page loses steam.
One canonical per page, pointing at the final URL (not a redirect). WordPress SEO plugins can set this without code. For the creator-focused walkthrough, see What Are Canonical URLs?.