How to Set a Canonical Tag on WordPress
Published · Updated
A canonical tag tells Google which URL is the main version of a page when the same content can be reached at more than one address, for example with tracking parameters or with and without www. Without it, Google may split ranking signals between the copies.
The fix on WordPress
If using Yoast or RankMath, the canonical URL field is in the SEO box below the editor, under "Advanced."
Builder menus change over time. If a label looks different, look for the closest option and check WordPress's help centre.
What this usually looks like on WordPress
WordPress and the common SEO plugins output a canonical tag on most pages automatically, so the problem is rarely "no canonical". It is a canonical that points to the wrong place: a staging domain left over from a migration, the http version of a site that now runs on https, a www and non-www mismatch, or an archive page whose canonical sends search engines somewhere unexpected.
Why this matters
Most site builders handle this automatically. Without it, if the same content is reachable from more than one URL, Google may split ranking credit between them instead of giving it all to one strong page.
Common mistakes on WordPress
Mismatched WordPress Address and Site Address
In Settings, General, these two URLs set the base for every canonical. If one still says http or points at the wrong subdomain, every canonical inherits the mistake.
Leftover staging URLs
After copying a site from staging to live, hard-coded URLs in the database can keep pointing at the old domain. A careful search-and-replace on the database, with a backup first, fixes that.
Pointing paginated pages at page one
Page 2 of a blog archive is not a duplicate of page 1. Each paginated page should normally carry a canonical to itself.
Two plugins both writing canonicals
An SEO plugin and a second plugin or theme feature can each output a canonical tag. View the source and make sure there is exactly one rel="canonical" on the page.
How to check it worked
- View the page source (Ctrl+U, or Cmd+Option+U on a Mac) and search for rel="canonical".
- In Search Console, URL Inspection shows the user-declared canonical and the one Google actually selected. If they differ, Google disagrees with your choice.
Use the URL Inspection tool in Search Console. It shows the canonical you declared and the one Google selected. If they differ, Google has chosen to disagree, usually because the pages are near identical or because other signals, such as redirects, internal links and your sitemap, point somewhere else. Make those signals consistent, then allow time for Google to recrawl.
Common questions
Does WordPress add canonical tags automatically?
Most builders add them by default. Check the notes on this page for what is and is not handled on this platform.
What should a canonical tag point to?
The full preferred URL of the page itself, including https. It should be a page that loads normally and is not blocked from Google.
Same fix on other builders
More fixes for WordPress