Fix guide · WordPress
How to Add a Canonical Tag in WordPress (2026)
A canonical tag (<link rel="canonical" href="…">) tells search engines which URL is the "real" version of a page when multiple URLs serve identical or very similar content. WordPress is prone to duplicate-content paths — ?page=2, tag archives, category pages and paginated comments can all duplicate your posts. Adding canonical tags prevents the wrong URL from ranking.
Why it matters
What this issue costs you
Without canonical tags, Google has to guess which URL to index and rank. It can split link equity across duplicates, delay indexing of the preferred URL, or rank a URL parameter variant instead of your clean URL. Canonical tags are a direct signal — Google respects them in the vast majority of cases.
Step-by-step
How to fix: Missing canonical tag
WordPress
- 1
Yoast SEO (automatic + per-page override)
Yoast SEO automatically outputs a self-referencing canonical for every page and post, which is the correct default. If you need to override it for a specific page (e.g., a syndicated post that should point to the original), open the page in the editor → Yoast SEO meta box → Advanced → "Canonical URL" field. Paste the preferred URL.
- 2
Rank Math (automatic + override)
Rank Math also outputs self-referencing canonicals automatically. To override: open the page, click the Rank Math icon → Advanced Tab → "Canonical URL". Paste the preferred URL and save.
- 3
No plugin — add via wp_head
If you need to add canonical tags without an SEO plugin, use this snippet in functions.php. It outputs a self-referencing canonical for singular posts, pages and the homepage.
functions.phpfunction sac_canonical_tag() { if ( is_singular() ) { $url = get_permalink(); } elseif ( is_front_page() || is_home() ) { $url = home_url( '/' ); } else { return; } echo '<link rel="canonical" href="' . esc_url( $url ) . '">' . PHP_EOL; } add_action( 'wp_head', 'sac_canonical_tag', 1 ); - 4
Confirm the tag is present
After saving, view the page source (right-click → View Source) and search for "canonical". You should see: <link rel="canonical" href="https://yoursite.com/your-page-slug/"> inside the <head>. Run our checker again to confirm the finding is resolved.
Verify the fix
Run the checker to confirm the issue is resolved
After applying the steps above, paste your URL below. Our checker will re-run every applicable check and show whether missing canonical tag still shows as a failing check.
FAQ
Common questions about missing canonical tag
Should every WordPress page have a canonical tag?
Yes — the safest default is a self-referencing canonical on every page (pointing to itself). It prevents any ambiguity and is the recommendation from Google. SEO plugins like Yoast and Rank Math do this automatically once installed.
What's the difference between a canonical and a 301 redirect?
A 301 redirect sends both users and bots to a different URL and removes the old one from the index. A canonical keeps both URLs accessible to users but tells Google which one to treat as authoritative. Use a redirect when the old URL should no longer exist; use canonical when you want to keep both URLs live.
My site has pagination (?page=2). Do I need canonicals for those?
Yes. For paginated archives, use rel="next" and rel="prev" (Yoast handles this). Each paginated page should still have its own self-referencing canonical. If you don't want paginated pages indexed at all, set noindex on them.
While you're here
Related fix guides for WordPress
Need a full audit?
This checker spots individual issues instantly. deepseoanalysis.com crawls your whole site and tracks changes weekly, from $24/mo.
See all WordPress fix guides, or run a free check now.