CanonicalTag.com logoCanonicalTag.comThe canonical tag & URL canonicalization
CMS PlatformCMS & Website Platforms

Canonical URLs in Rank Math

Rank Math self-canonicalizes every indexable page by default, but the Advanced tab and a developer filter let you take full control.

Does Rank Math add canonical tags automatically?

A canonical tag is the line of code, <link rel='canonical' href='...'>, that appears in a page's HTML head and tells search engines which URL is the master version when duplicate or near-duplicate versions exist elsewhere. Rank Math ships with this turned on. Rank Math's own support documentation states plainly that Rank Math adds the canonical tag to all the indexable URLs on a site, and that it uses the current post or page URL as the canonical URL by default, meaning you would only touch the setting if you want to point a page somewhere else.

In practice that self-referencing canonical appears on single posts, pages, and custom post types, pointing each one at its own permalink. It also appears on archive and taxonomy pages, including category, tag, custom taxonomy, author, and date archives, each pointing at itself. On paginated archive and blog pages, Rank Math gives each paginated URL, such as /page/2/, its own self-referencing canonical rather than pointing every page back to page one, which lines up with Google's current guidance on pagination. If WooCommerce is active, Rank Math treats products as an indexable custom post type and extends the same self-referencing behavior to product pages and product archives, with variation or filtered product URLs generally pointed at the parent product.

One hedge worth noting: exact archive and pagination canonical output has shifted across Rank Math releases over the years. If pagination canonicalization matters for a specific site, verify the behavior on the version actually installed rather than assuming it matches what's described here.

Where to set a canonical override in Rank Math

Rank Math lets you override the automatic canonical on a per-post, per-page, or per-CPT basis. Open the item in the WordPress editor and look for the Rank Math meta box below or beside the content editor. Click into the Advanced tab, and you'll find a Canonical URL field. It's blank by default, which simply means Rank Math is auto-generating the self-referencing canonical for you. Type a full URL into that field and Rank Math outputs that URL as the canonical instead.

There's a catch that trips up a lot of site owners: the Advanced tab only shows up when Rank Math is running in Advanced Mode. If you open a post and don't see an Advanced tab or Canonical URL field at all, that's almost always the reason. Switch modes at WordPress Dashboard, then Rank Math SEO, then Dashboard, where you can toggle from Easy Mode to Advanced Mode.

Rank Math is also explicit about a distinction that matters: setting a custom Canonical URL is a different concept from noindex. A canonical consolidates ranking signals toward a chosen URL while the page still exists and can be crawled; noindex removes a URL from the index outright. Don't reach for one when you mean the other.

How Rank Math handles archives and pagination

Archives are one of the more complicated corners of canonical handling, because a single archive, a category page for example, can list the same posts as a tag page, an author page, or the blog home, depending on how a site is structured. Rank Math's default is to self-reference: each category, tag, custom taxonomy, author, and date archive gets a canonical pointing at itself, not at some other archive that happens to list overlapping content.

Pagination follows the same self-referencing logic. When a category or blog archive spans multiple pages, page 2 gets a canonical pointing to page 2, page 3 points to page 3, and so on, rather than all of them collapsing back to page 1. That matters because each paginated page typically surfaces a different set of posts or products, and collapsing them all to page 1 would tell Google to ignore content it can't actually see there.

For WooCommerce stores, this same self-referencing pattern extends to product archives and, per Rank Math's own support guidance, to product variations and filtered product URLs, which are generally pointed at the main or parent product page rather than left to self-reference every permutation. Because pagination and archive behavior has evolved across Rank Math versions, confirm the live output on your installed version if this is critical for a large catalog or content archive.

Controlling canonicals with a filter

For anything the settings screen doesn't cover, a custom template, a headless setup, or a page type Rank Math wouldn't guess correctly, Rank Math exposes a developer filter: rank_math/frontend/canonical. It lets you intercept and change the canonical URL Rank Math is about to output on the frontend, or suppress it entirely by returning an empty string.

add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    // Modify the canonical URL, or return '' to suppress output entirely
    return $canonical;
});

Add that snippet to your child theme's functions.php file or a code-snippet plugin, then adjust the logic inside the callback, checking is_singular(), a post type, or a URL pattern, to decide when to change or drop the canonical. Returning an empty string is the common technique for suppressing Rank Math's canonical output on templates where you don't want a canonical tag at all, such as a custom archive you're handling separately.

This is the one documented, canonical-specific hook in Rank Math's filter library. There are other frontend meta filters for titles, descriptions, and robots meta, but rank_math/frontend/canonical is the one built specifically for this tag. If you're comfortable with PHP, it's a more reliable way to handle edge cases than trying to force the Canonical URL field to do something it wasn't designed for across dozens or hundreds of pages at once.

Common Rank Math canonical mistakes

The mistakes that show up most often with Rank Math are less about the plugin misbehaving and more about how people use its settings.

  • Confusing canonical with noindex, they solve different problems, and Rank Math's own documentation flags this directly.
  • Accidentally overwriting the Canonical URL field across many posts, such as bulk-pasting a homepage or category URL, which quietly canonicalizes dozens of pages away from themselves and can drop them out of the index.
  • Expecting the Advanced tab and Canonical URL field to appear in Easy Mode, they won't, until Advanced Mode is switched on.
  • Treating the Alternate page with proper canonical tag status in Google Search Console as an error that needs fixing, when Rank Math's own guidance says this usually means Google is doing exactly what it should, excluding a duplicate and indexing the main version.
  • Stacking a canonical to a different URL together with a noindex tag on the same page, which sends Google mixed, conflicting signals about what to do with that URL.

Frequently Asked Questions

Does Rank Math override WordPress core's default canonical tag?

Yes. Once Rank Math is active, it takes over canonical output for indexable content, replacing WordPress core's default self-referencing canonical with its own logic, including the Advanced tab override and the rank_math/frontend/canonical filter.

Why is the Canonical URL field missing from my Rank Math meta box?

Almost always because Rank Math is in Easy Mode. The Advanced tab, and the Canonical URL field inside it, only appears once you switch to Advanced Mode from WordPress Dashboard, then Rank Math SEO, then Dashboard.

Should I worry about "Alternate page with proper canonical tag" in Search Console?

Generally no. Rank Math's own knowledge base describes this status as meaning Google recognized two versions of a page with the same canonical URL and correctly excluded the duplicate while indexing the main version. It's worth periodically confirming the affected pages are genuinely meant to be canonicalized, but it's not treated as an error by default.

Can I remove the canonical tag entirely on a page using Rank Math?

Yes, through the rank_math/frontend/canonical filter. Returning an empty string from the callback suppresses Rank Math's canonical output for that template or condition, which is the documented way to drop the tag rather than override it.

Does Rank Math canonicalize WooCommerce product variations to the parent product?

Rank Math treats products as an indexable custom post type, and its own support guidance recommends letting the plugin generate the self-referencing canonical for the main product while pointing variation and filtered product URLs at the parent or main product page.