WordPress Canonical URL Settings: Field, Then Self
WordPress canonical URL settings: Field-Then-Self in Yoast or Rank Math. Set the keeper URL; do not fight the plugin with a second tag. Not a canonical explainer.

WordPress canonical URL settings are a field and a source view—not a second essay on what rel=canonical means. Most posts should self-name their permalink. The custom box is for the rare duplicate you still need live.
This page is Field-Then-Self. It is not canonical tags explained. It is not Rank Math vs Yoast (which plugin). Hint versus redirect is canonical vs 301. URL Inspection checks what Google stored.
Leave the canonical field empty so the permalink self-canonicalizes. Fill it only when this URL must point at a keeper. View source for one tag, not two.
WordPress core: wp_get_canonical_url. Plugin UIs change; confirm Yoast: change the canonical URL and Rank Math’s current canonical docs on rankmath.com.
Table of contents
- Field-Then-Self
- What core already does
- Yoast and Rank Math without a plugin war
- Two tags, two plugins, one mess
- When to type a URL in the box
- FAQ
- View source once
Field-Then-Self
FIELD-THEN-SELF
Default empty field → permalink is the canonical
Exception type the keeper HTTPS URL (exact slash)
Then View Source → one rel=canonical
If you type http:// or the no-slash variant while the site 301s to HTTPS-with-slash, you just taught the plugin the loser. Match the live address bar.
What core already does
On a typical theme, WordPress prints a canonical for the queried object. You do not need a custom field for a normal post. You need a plugin field when you are overriding that default.
Changing the permalink under Settings → Permalinks is a site-wide pattern. It is not this box. After a permalink pattern change, old slugs need 301s, not a hundred typed canonicals.
Yoast and Rank Math without a plugin war
Pick one SEO plugin that owns titles, schema, and canonicals. Two SEO plugins often emit two canonicals.
In the editor (labels vary by version):
- Yoast SEO: look for Canonical URL in the advanced / search appearance panel for that post
- Rank Math: look for Canonical URL in the advanced tab of the Rank Math box
If the field is hidden, enable advanced settings in that plugin. Do not paste a header snippet “to be sure.”
This is not a feature-count bake-off. Rank Math vs Yoast is that decision.
Two tags, two plugins, one mess
View source on a published post. Search rel="canonical". Count.
- Zero on an indexable article: fix the plugin or theme
- One pointing at the permalink: leave it
- Two different hrefs: disable the extra output (old theme function, second SEO plugin, header injection)
hreflang is a different link element. Do not “canonical all languages to English” in this box.
When to type a URL in the box
Rare, on purpose:
- A tracking URL that must stay bookmarkable but should count as the clean post
- A legitimate duplicate you cannot 301 this week
Not for:
- “Make page 2 count as page 1” (pagination forbids that pattern)
- Killing a URL you should redirect
- Pointing every draft at the homepage
FAQ
Where do I set a canonical URL in WordPress?
Core WordPress outputs a canonical via wp_get_canonical_url on many themes. Custom “this page should count as that URL” fields usually live in your SEO plugin. In Yoast SEO and Rank Math, look for a Canonical URL (or similar) field on the post/page editor. Labels move—open the plugin’s current docs if you cannot see it.
Should every post have a custom canonical?
Usually no. Leave the field empty so the plugin self-canonicalizes the permalink. Fill it only when this URL is a duplicate of a keeper you named on purpose.
Is this Rank Math vs Yoast?
No. That owner is which plugin to pick. This URL is where the canonical field lives and how not to emit two tags. Plugin wars stay on the comparison post.
Can I paste a canonical in the header myself?
If the plugin already prints rel=canonical, a second header tag fights it. View source. One canonical. Two disagreeing tags are worse than the default.
What if Google picked a different canonical?
Inspect the URL in Search Console. Fix the field, internal links, and sitemap to the keeper. Do not mash Request indexing on the loser. Inspection click-path is its own post.
Does a custom canonical replace a 301?
No. If the old permalink should die, redirect it. Hint vs move is the canonical-vs-301 post. This page is only the WordPress field.
Where are official plugin docs?
Yoast canonical URLs and Rank Math’s canonical documentation on rankmath.com. WordPress.org: wp_get_canonical_url. Confirm the live UI; screenshots rot.
Does pagination use this field?
Page 2 should not canonical to page 1. That rule is the pagination owner. Do not “fix” archives by pasting page 1 into every page-2 field.
View source once
Publish or update one post. View source. Confirm a single canonical that matches the address bar. Then stop touching the field on every article “for SEO.”
Keep learning
More guides in the same topic lane.
WordPress Application Passwords: App Access Without Sharing wp-admin
WordPress application passwords: App-Then-Revoke. Give a plugin or REST client a token, not your real password. Not two-factor login, not a client password vault.
RSS Feeds for Small Blogs: The Subscribe Job a Sitemap Cannot Do
RSS feeds for small blogs: Feed-Then-Inbox. Let readers and tools subscribe. Not an email ESP, not an XML sitemap, not a newsletter monetization guide.
Redirect Chains on Small Blogs: One Hop, Not a Maze
Redirect chains on small blogs: Collapse-Then-Hop. Point A straight at the keeper. Not a 404 page, not a broken-link hunt, not a domain move.