A WordPress homepage is typically reachable via several URLs - with and without www, with and without https, with /index.php, with various tracking parameters. The <link rel="canonical"> tag tells Google which version is authoritative. Without it, signals fragment.
Why this matters
Google treats every distinct URL as a separate document. https://example.com, https://www.example.com, https://example.com/, https://example.com/index.php, and https://example.com/?utm_source=newsletter are five different pages with identical content as far as the algorithm is concerned. That triggers duplicate content classification, and instead of all signals (backlinks, engagement metrics, keyword relevance) flowing into a single canonical document, they split across variants.
The direct consequence is weaker ranking. If you have 50 inbound links - 30 to the www version, 20 to the non-www version - Google ranks two pages separately with diluted authority instead of consolidating into one strong page. Search Console reports affected URLs under "Duplicate, Google chose different canonical than user" - a sign the algorithm picked a version for you (not always the right one) instead of obeying your declaration.
How to detect
View source on the homepage (Ctrl+U) and search for rel="canonical". You should see exactly one tag in the <head> like <link rel="canonical" href="https://example.com/" />. Zero tags or multiple conflicting tags both indicate problems.
Second check: in Google Search Console > URL Inspection paste the homepage URL. The Canonical section displays two values: "User-declared canonical" (what your code says) and "Google-selected canonical" (what Google actually used). If they differ, Google ignored your declaration. The most common cause is the declared canonical pointing at a URL that 301s or returns a non-200 status.
Third check: manually visit several variants - https://example.com, https://www.example.com, http://example.com. All non-canonical variants should 301 redirect to the canonical one, not load identical content in parallel.
How to fix
Two stages. First, install and activate an SEO plugin (Yoast SEO, Rank Math, RankPlus, SEOPress, All in One SEO). Each one emits a canonical tag automatically on every page. Verify in plugin settings that the feature is not disabled - in Yoast under Search Appearance, in Rank Math under Titles & Meta.
Second, set up 301 redirects between variants. In WordPress, go to Settings > General and ensure both "WordPress Address (URL)" and "Site Address (URL)" point to the same variant (with or without www, but consistent). At the server level (Apache .htaccess or Nginx server block) add a 301 redirect from the alternate variant to the canonical one.
If the site sits behind Cloudflare, Page Rules or Bulk Redirects can force canonicalization at the edge - faster than origin redirects and reduces server load.
Common mistakes
First mistake: a canonical that points at a URL which 301 redirects. If you declare canonical as https://example.com but that URL redirects to https://www.example.com, Google sees the chain, gets confused, and abandons your declaration. Always point the canonical at a URL that returns HTTP 200 directly.
Second mistake: writing relative canonicals. href="/" instead of href="https://example.com/". The HTML spec accepts relative URLs but in practice this causes subtle bugs - especially when category templates inherit the relative path instead of substituting the full page URL.
Third mistake: stacked canonicals. One SEO plugin emits a canonical, the theme emits its own, a multilingual plugin adds a third. Google sees multiple tags and ignores all of them. Use a crawler like Screaming Frog SEO Spider to identify pages with more than one canonical declaration.
Verifying the fix
After fixing, view source on the homepage and confirm a single canonical tag with an absolute URL. Run curl -I https://example.com and curl -I https://www.example.com - one returns 200, the other returns 301 to the first. In Search Console > URL Inspection confirm that User-declared and Google-selected canonical match. Track the Indexed Pages report over 2-4 weeks to see duplicate variants drop out of the index.