Back to blog

3 October 2026

How to Add a Canonical Tag in WordPress—and Verify It

Set a WordPress canonical URL using Yoast SEO or Rank Math, avoid duplicate declarations, and verify the published result with practical checks.

How to Add a Canonical Tag in WordPress—and Verify It

To add or change a canonical tag in WordPress, first check what your site already outputs. Many sites already have a canonical from WordPress or an SEO plugin. Adding another hardcoded tag can create conflicting declarations rather than solve the problem.

This guide covers a single-page change, followed by checks on the public HTML. Plugin instructions were reviewed on 3 October 2026; labels can vary by version and configuration. Use a staging site for changes to templates or custom code.

What should a canonical tag point to?

A canonical identifies the preferred URL for substantially equivalent content. It is a signal, not a guarantee of Google’s selection. Use the complete preferred URL. Google explains the supported methods in its canonicalisation documentation.

<link rel="canonical" href="https://example.com/services/" />

Suppose https://example.com/services/?utm_source=email displays the same service page as the clean URL. Your intended preferred address may be https://example.com/services/. A separate page describing a different service needs its own decision; do not point every service to the homepage.

Step 1: inspect the current output

  1. Open the public page while logged out.
  2. Use View Page Source and search for canonical.
  3. Record the URL in each relevant link element and whether it appears inside the HTML head.
  4. Run our canonical tag checker to inspect the first HTML canonical, robots meta directive and response status.

The checker does not detect every duplicate declaration or HTTP Link header, and it does not run JavaScript. Source inspection and developer tools remain useful when plugins or scripts disagree. Record the “before” result so you can tell whether the change had the intended effect.

WordPress includes a rel_canonical function for singular content. An SEO plugin can influence the final output, so the published response matters more than whether an editor field is blank.

Step 2A: change the URL with Yoast SEO

If your site uses Yoast SEO, edit the relevant post or page, open the Yoast SEO sidebar and its Advanced section, then enter the full preferred address in the Canonical URL field. Save or update the content. These are the steps described in Yoast’s official instructions.

Only enter an override when the default is wrong for this page. Keep a record of why the override exists, particularly if it points to another page or domain. A future editor should not have to guess whether it is intentional.

Step 2B: change the URL with Rank Math

For a site already using Rank Math, edit the content and open the plugin’s Advanced tab. Use its Canonical URL field to set the preferred address, then update the page. Follow Rank Math’s canonical guide for the current interface and advanced-mode requirements.

These are alternative routes. Do not install a second SEO plugin just to obtain another canonical field. Before changing site-wide settings, check whether a theme, custom plugin or previous developer also adds SEO tags.

What if the website has no SEO plugin?

Inspect the current WordPress output first. If the default is correct, there may be nothing to add. If your content model needs different canonical logic, ask a developer to implement a narrowly scoped rule through the appropriate WordPress or plugin extension point.

A fixed URL pasted into a shared header template can affect every page. Define the intended rule in plain language before code is written: which page types qualify, which URL should be used, and what happens when content is unpublished or moved?

Step 3: verify the live change

CheckExpected evidence
Published sourceThe intended canonical appears in the returned head without a conflicting second value.
Target URLIt opens the intended equivalent page and is not an accidental error or redirect chain.
Indexing settingsThe preferred page’s robots instructions match your intention.
Internal navigationYour own links use the preferred URL where appropriate.
SitemapThe intended indexable version appears, rather than unnecessary duplicates.

If old output persists, clear the relevant page cache or CDN cache and inspect the public response again. Use the redirect checker to investigate a target that changes address, and the XML sitemap generator when reviewing a small site’s sitemap.

Step 4: distinguish the declaration from Google’s decision

In Search Console, inspect the URL and compare the available indexed canonical information. A live test and the indexed report answer different questions; see the URL Inspection documentation. Do not assume a successful live test proves that Google has already processed your change.

If the duplicate is labelled as an alternate with a proper canonical, read our guide to that Search Console status before treating it as a fault.

Common mistakes to avoid

  • Using the homepage as a universal target for unrelated pages.
  • Leaving a staging-domain URL in production settings after a migration.
  • Changing the visible page but forgetting a cached head section.
  • Overriding a correct default without documenting the reason.
  • Assuming a canonical is a substitute for a redirect when an old page has permanently moved.

For a redesign, add these checks to the launch plan alongside the content and URL inventory. Our website redesign guide covers the wider planning process.

Frequently asked questions

Should every canonical field be filled manually?

No. Inspect the plugin’s output before overriding it. A correct default is usually easier to maintain than many unnecessary manual settings.

Will this immediately improve rankings?

No. This is a technical consistency task. Search engines need to process the page, and the result depends on other signals and the relevance of the content.

Can Esperto review the implementation?

Yes. Send the affected URL and your intended preferred URL through our enquiry form. Our SEO services and website development services can help investigate the page output and implementation.

KEEP EXPLORING

Related articles