Skip to content

What Is a Canonical URL and How to Set It Correctly in WordPress

4 min read

What Is a Canonical URL and How to Set It Correctly in WordPress – canonical url wordpress

If you have ever felt that Google doesn’t quite know which page to show from your site, the cause is often a conflicting signal about addresses. This is where the canonical URL comes in: the tag that tells the search engine which version of a page is the “official” one. Setting up a canonical URL in WordPress correctly is one of the simplest technical optimizations, yet also one of the most frequently ignored — and it can be the difference between a page that climbs the rankings and one diluted among duplicates.

What a Canonical URL Actually Is

A canonical URL is the address you declare as the main version of a page, whenever the same content can be reached through several addresses. In practice, you send Google a clear message: “index this variant and treat the others as copies”.

The signal is delivered through a single line of code, placed in the <head> section of the page:

<link rel="canonical" href="https://your-site.com/my-page/" />

It isn’t an absolute rule, but a strong recommendation. Google respects it in the vast majority of cases, though it may choose another address if it receives clearer signals elsewhere — for example from the sitemap or from internal links that insistently point to a different variant.

Why Duplicate Content Appears in WordPress

WordPress naturally generates several addresses for the same content. Often you don’t even notice, but search engines see all of them. The most common situations are:

  • The version with and without www, or http versus https.
  • Addresses with a trailing slash (/page/) and without it (/page).
  • Tracking parameters in the URL, such as ?utm_source=newsletter.
  • Pagination of comments, categories or archives that repeats the text.
  • WooCommerce products reachable through several categories or filters.

Every extra variant splits the page’s authority into smaller pieces. A well-set canonical URL gathers these signals in one place and directs them to a single address — the one you actually want people to see.

How the rel=”canonical” Tag Works

Think of the canonical tag as an arrow. Each copy of a page carries an arrow pointing to the original you chose. When Google follows these arrows, it consolidates all ranking signals — links, relevance, authority — into a single URL, instead of scattering them across three or four variants.

A correct page has a “self-referencing” canonical: the main address points to itself. The duplicates, in turn, point to it. This way you avoid the situation where Google indexes several versions of the same page and makes them compete against each other for the same keywords.

Flow diagram showing how a canonical URL in WordPress consolidates duplicate pages toward the preferred URL indexed by Google.Canonical Url WordPress1Duplicate pages2rel=canonical tag3Preferred URL4Google indexes one5Consolidated authority
How a canonical URL works in WordPress: from duplicate pages to one indexed address.

How to Set a Canonical URL Correctly in WordPress

The good news is that you don’t have to write any code by hand. WordPress and an SEO plugin do almost all the work, as long as you configure them carefully.

1. Use an SEO plugin

Rank Math or Yoast automatically add the canonical tag to every page and post, with its own address. In most cases, that’s all you need. You can manually override the canonical of a specific page, from the plugin’s advanced settings, whenever you intentionally want to point to a different address.

2. Settle on a single domain version

Decide whether the site runs with or without www and force https everywhere. Set the correct address in Settings → General and let 301 redirects handle the rest. That way the canonical and the real address always match, and Google has no reason to hesitate.

3. Check the important pages

Open a page, right-click → “View Source” and search for rel="canonical". Confirm that the address shown is the correct one, with no parameters and no typos. Google’s official guide on consolidating duplicate URLs explains all the accepted methods in detail.

If you run a store or a site with many pages, a technical SEO audit quickly shows you where you have wrong or missing canonicals. And if you want an experienced pair of eyes, you can request a free audit and we’ll tell you exactly what needs fixing.

Common Mistakes to Avoid

Even with a good plugin, a few traps show up. The most common is a canonical that points to the wrong page — usually to the site’s homepage, after an import or a migration done in a hurry. The result: Google ignores dozens of pages because they all “cancel themselves out”.

Another mistake is blocking the canonical page through robots.txt. If the search engine can’t access the indicated address, the signal becomes useless. Likewise, don’t combine a canonical with a redirect that leads somewhere else — you send the search engine in two directions at once and lose the entire benefit.

Conclusion

The canonical URL is not an obscure technical detail, but a simple tool through which you tell Google which pages truly matter. On a WordPress site, with a properly configured SEO plugin and a single clean domain version, you already have most of the work done. The rest means periodic checks: open the page source, confirm the address, and make sure the duplicates point to the original. Five minutes of attention now can save you months of lost rankings later.