WordPress

WordPress wrong canonical: Yoast and Rank Math

Yoast and Rank Math both write canonicals and either can override the other. The exact fields, the filters, and how to check a page.

WordPress canonical tags usually come from an SEO plugin, so Yoast, Rank Math, another plugin, or the theme can override or duplicate them. Count the live tags, keep one canonical owner, correct its Advanced canonical field, remove any theme or filter duplicate, save, and inspect the page source again.

Why WordPress does this

Say it plainly: on WordPress the canonical is written by the SEO plugin, not by a platform setting. Neither vendor's instructions name a WordPress setting for it; both document their own fields. Yoast states "Yoast SEO adds canonical URLs to your WordPress site", editable via "In the Yoast SEO sidebar, go to Advanced" and "In the Canonical URL field, enter the full canonical URL", with the rule "You must include the full address, including http; https; www; or non-www at the beginning of the URL". Yoast also documents the programmatic route: "you can use the wpseo_canonical filter. If you return false on that, no canonical will be output." Rank Math's field is documented as "Under the Advanced tab, you can change the Canonical URL field to point to the main source of your content", with the tab only visible after enabling advanced mode "from WordPress Dashboard > Rank Math SEO > Dashboard". Run both plugins, or a theme that prints its own tag beside one of them, and the page ships two canonicals for search engines to arbitrate. One more Yoast behavior worth knowing: "We do not output a canonical tag if the page is marked as noindex."

Check it right now

Before changing anything, confirm what a crawler actually sees. The check is free, takes one URL and needs no account.

Run the check

How to fix it

  1. View source on the affected page and count the link rel="canonical" tags; more than one means two writers are active.
  2. Deactivate all but one SEO plugin, since Yoast and Rank Math each write their own canonical.
  3. In Yoast: open the post or page, and in the Yoast SEO sidebar go to Advanced, then correct the "Canonical URL" field, including the full address with http or https.
  4. In Rank Math: open the post or page, go to the Advanced tab of the Rank Math meta box, and correct the "Canonical URL" field. If the tab is missing, enable advanced mode from WordPress Dashboard > Rank Math SEO > Dashboard.
  5. Search the theme's header.php and functions.php for a hardcoded canonical tag or a wpseo_canonical filter returning the wrong value.
  6. Save, then re-check the page with the free canonical checker below.

Why it happens again

Plugins get installed twice during rebuilds, migrated, and left with fields filled by people who have since moved on. Yoast's filter can silently reshape every canonical on the site, Rank Math hides its field behind an advanced-mode setting, and every new post is a fresh chance for a wrong URL with nothing in WordPress to warn that a canonical points off-site.

stillindexed re-checks the URLs you give it every 30 minutes on Starter and alerts when a directive changes, at most 30 minutes after it does. It is a monitor rather than a crawler: it watches a list you choose and tells you when one of seven things changes. Card first, no trial, and a 30 day refund.

See what monitoring covers

Catching it next time

Fixing it once is the easy half. The setting that caused this can be changed again by anyone with access, and the page will keep returning 200 while it happens.

Other ways WordPress loses pages

A canonical tag pointing at the wrong URL, on other platforms

Sources

Every claim about WordPress above is from their own documentation, read on 2026-08-30. Platforms change their settings; if one of these is out of date, their page wins and we would like to know.