The fix, in one snippet
<link rel="canonical" href="https://example.com/guides/first-post">
Illustrative values. Change the paths, hostnames and options to match your own site before using it.
The sections below explain what is tested, why it matters and the alternatives.
What we test
For every HTML page we look for <link rel="canonical"> in the head, resolve it against the page's own URL, and record the result. The check fails when pages have no canonical at all.
We do not require the canonical to be self-referential; pointing elsewhere is legitimate and is reported separately. What is reported here is the absence of any declaration.
Why it matters
Almost every site serves the same page at more than one URL without meaning to: with and without a trailing slash, with tracking parameters attached, with and without www, over HTTP and HTTPS, with session identifiers, through print or AMP variants. Each variant is a separate URL to a search engine.
Left undeclared, the engine picks one itself. It usually picks well, but "usually" means the signals for a page are sometimes split across three URLs, none of which ranks as well as the one would have. Shared links, which are the strongest external signal you get, land on whichever variant the person happened to copy.
A self-referential canonical costs one line and removes the ambiguity entirely.
How to fix it
Emit an absolute, self-referential canonical on every indexable page, generated from the route rather than from the request URL so that parameters cannot leak into it:
<link rel="canonical" href="https://example.com/guides/first-post">
Rules that keep it correct: always absolute, always HTTPS, always the preferred host, no tracking parameters, and consistent with the trailing-slash convention your server actually uses. Paginated listings should be self-referential per page, not all pointing at page one.
Confirm with curl -s https://example.com/page | grep canonical and check a few parameterised URLs to make sure the value does not change with the query string.
Where this fits
Canonical URL missing is check 4 of 10 that the seo & site health audit runs under indexing and crawlability, ordered the way they are worth fixing. That ordering is the point: Fixing this one while the check above it still fails buys less than it looks like.
Fix this one first
Above it in the same category sits Redirect loops (high), where a URL that redirects back to something already in its own chain never resolves. An attacker who has that does not need this, so it is the better use of the same hour.
What fixing this still leaves open
Canonical URL missing closes one route in. Immediately below it: Canonical points to another URL, where a canonical pointing at a different URL asks search engines to index that URL instead of this one; Linked pages blocked by robots.txt, where a page you link to internally but disallow in robots.txt sends contradictory signals and wastes the link; Redirect chains, where a URL that reaches its destination through two or more redirects costs every visitor and every crawler extra round trips.
Found in the same scan
The seo & site health audit reports this alongside checks from other categories that are at least as serious, including Broken internal links, where an internal link that returns an error is a dead end for the reader and a wasted request for the crawler, and Duplicate body content, where two pages with identical body text are one page at two addresses, and search engines will pick one of them for you. A single run of seo & site health audit answers all of them at once.
The first few lines
You are a senior web engineer. I ran a security and SEO scanner against my site and it reported the finding below. Fix it properly rather than suppressing the symptom.
Finding: Canonical URL missing (medium severity)
Scanner check id: seo-canonical-missing
The rest of this prompt names the pages and line numbers we found the problem on, the configuration to change, and the constraints a good answer has to respect. It is free, it just needs an account so the work is not scraped wholesale.
Sign in with GoogleSigning in is free and takes one click. We store your email address and nothing else.