Volver al blog
Canonical Checker7 min de lectura18 de abril de 2026

Canonical in WordPress: Configuration with Yoast SEO and Rank Math

Yoast SEO and Rank Math manage canonical tags in WordPress automatically, but there are situations where you need to intervene manually. Learn how to configure, verify, and fix canonicals on your WordPress site.


If you have WordPress with Yoast SEO or Rank Math installed, basic canonical handling is already managed automatically. But "automatically" does not mean "perfectly." There are cases — archive pages, custom taxonomies, URLs with parameters, themes with legacy code — where the automatic canonical is incorrect or absent. This guide covers the correct configuration and the cases where you need to intervene.

How Yoast SEO manages canonical

Yoast SEO automatically adds the canonical tag on all WordPress content types. The default behavior:

  • Posts and pages: self-referential canonical toward the permanent URL of the post/page.
  • Archive pages (category, tag, author, date): self-referential canonical toward the archive URL.
  • Homepage: canonical toward the site URL (with or without trailing slash, depending on your configuration).
  • Pagination pages (/page/2/): canonical toward the first page of the archive.
  • Internal search (?s=query): automatic noindex (does not generate canonical).

Changing the canonical of a specific page in Yoast

In the editor of any post or page, the Yoast SEO panel has an "Advanced" section where you can manually change the canonical URL for that specific page. Use it when you need a page to point to a canonical URL different from itself.

  1. 1.Open the post or page in the WordPress editor.
  2. 2.In the Yoast SEO panel (right sidebar or block below the editor), click "Advanced".
  3. 3.In the "Canonical URL" field, enter the URL the canonical should point to.
  4. 4.Save the post — Yoast uses this URL instead of the post URL as the canonical.

How Rank Math manages canonical

Rank Math manages canonical similarly to Yoast, with some differences in behavior for taxonomies and custom post types.

  • Posts and pages: automatic self-referential canonical.
  • Custom taxonomies (CPT): canonical active if the post type is configured as indexable in Rank Math → Titles and Meta → Post Types.
  • Pagination pages: canonical toward page 1 of the archive (configurable behavior).
  • Attachments: canonical toward the parent post or noindex, configurable in Rank Math → Titles and Meta → Media.

Changing the canonical in Rank Math

  1. 1.Open the post in the WordPress editor.
  2. 2.In the Rank Math panel (sidebar), go to the "Advanced" tab.
  3. 3.In the "Canonical URL" field, enter the desired canonical URL.
  4. 4.Save the post.

Common canonical problems in WordPress

Problem 1: Attachment pages indexed without correct canonical

WordPress generates attachment pages for each uploaded image (not /wp-content/uploads, but /image-name/). These pages have minimal content and often have no canonical or a self-referential canonical, when they should have noindex or a canonical pointing to the post that contains them.

  • In Yoast: Yoast → Search Appearance → Content Types → Media → enable "Redirect attachment URLs to the attachment itself." This adds a 301 redirect from the attachment page to the image file.
  • In Rank Math: Rank Math → Titles and Meta → Media → "Redirect attachments to their parent post."

Problem 2: URLs with WooCommerce pagination parameters

WooCommerce adds parameters like ?orderby=price or ?per_page=24 that generate variants of category pages. Yoast and Rank Math normally add a canonical toward the URL without parameters, but verify this is actually happening correctly on your installation.

Problem 3: Incorrect canonical due to plugin conflict

If you have two SEO plugins active, both may try to add the canonical tag, resulting in two different canonical tags in the same <head>. Google will process only the first one or ignore them all. Make sure you have only one active SEO plugin managing canonical.

Problem 4: Theme that adds its own canonical

Some themes add their own canonical in the header, which can conflict with the SEO plugin's canonical. Review the theme code (header.php or functions.php) searching for "canonical" to verify whether the theme is interfering.

How to verify canonicals on your WordPress site

Enter a sample of your WordPress URLs in iRankly's Canonical Checker — homepage, recent posts, category pages, archive pages, pagination pages — to verify that each content type has the correct canonical.

Prueba la herramienta gratis

Canonical CheckerAnaliza tus URLs con {tool} de iRankly. Sin registro, sin tarjeta.

Usar herramienta gratis

Pay special attention to canonical tags on WordPress tag pages. If you have many tags with few posts each, they are candidates for noindex or canonical toward the most relevant category to avoid low-quality duplicate content.


Prueba la herramienta gratis

Analiza tus URLs con Canonical Checker de iRankly. Sin registro, sin tarjeta.

Usar herramienta gratis