If you run a WordPress site, the same content can often be reached at more than one address: with and without tracking parameters, over HTTP and HTTPS, or through filtered category views. This guide is for bloggers, marketers and small-business owners who want to understand canonical URLs, know which signals matter most, avoid the usual mistakes, and check what Google actually chose in Search Console.
What canonicalization means
Google’s documentation defines canonicalization as the process of selecting the representative URL of a piece of content. The canonical URL is the page Google picks as the most representative from a set of duplicate pages, and the process is often called deduplication. It lets Google show just one version of duplicate content in search results.
Google lists several common causes of duplicates: the same content served for different regions, separate mobile and desktop versions, HTTP and HTTPS versions that are both reachable, sorting and filtering on category pages that create extra URLs, and accidental variants such as a demo site left open to crawlers. Some duplication is normal and does not violate Google’s spam policies, but it can confuse visitors and make performance harder to track.
How Google chooses a canonical
During indexing, Google identifies the main content of each page and groups pages with the same or very similar main content into a cluster. From that cluster it picks the page its collected signals suggest is the most complete and useful for searchers. The canonical page is crawled most regularly, while duplicates are crawled less often to reduce the load on your site.
The signals Google names include whether a page is served over HTTP or HTTPS, redirects, whether the URL appears in a sitemap, and rel=”canonical” annotations. The key point is in Google’s own words: indicating a canonical preference is a hint, not a rule. You can state which URL you prefer, but Google may choose a different one. Treat every method below as a way to make your preference clear, not as a command.
The methods Google documents, and how strong they are
Google’s page on consolidating duplicate URLs lists the methods from strongest to weakest influence. None is required, and if you specify nothing Google selects the version it considers best to show users. The methods can be combined, which increases the chance that your preferred URL is the one shown.
| Method | Strength (per Google) | Best used for |
|---|---|---|
| Redirects | Strong signal | Retiring a duplicate page; server-side HTTP redirects work fastest |
| rel=”canonical” link element | Strong signal | Duplicates that must stay reachable on your own site |
| rel=”canonical” HTTP header | Strong signal | Non-HTML files such as PDFs |
| Sitemap inclusion | Weak signal | Listing the one URL per page you consider canonical |
Redirects
Use a permanent redirect only when you are deprecating a duplicate. Google’s example: if a page is reachable at three hostnames, choose one as canonical and redirect the other two to it. If you need to set this up, see our guide to setting up 301 redirects on WordPress safely.
The rel=”canonical” link element
This is the option Google describes as preferred for duplicates within a site. Its rules are specific:
- Put the link element in the head of the page. Google says it is only accepted there.
- Add a self-referential canonical to the canonical page itself.
- Use absolute URLs. Relative paths are supported but not recommended.
- Annotations that include hreflang, lang, media or type attributes are not used for canonicalization; use rel=”alternate” for alternate versions instead.
A typical element looks like this: <link rel="canonical" href="https://example.com/my-post/" />.
The HTTP header
You can send a Link response header with rel=”canonical”, which suits files that have no HTML head, such as PDFs. Google supports this method for web search results only. Choose either the HTML element or the header for a given page, not both, because using both is more error-prone when they end up pointing to different URLs.
Sitemaps
List only the canonical version of each page in your sitemap. It is easy to maintain on large sites, but Google describes sitemap entries as weaker than rel=”canonical” mappings, and says Google decides which pages are duplicates based on content similarity. For more on sitemaps, read our guide to understanding sitemaps.
What WordPress does and where plugins fit
The WordPress developer reference documents a core function, rel_canonical(), described as outputting rel=canonical for singular queries. It returns early when the current request is not a singular one, so core handles single posts, pages and similar content, not archive pages. It relies on wp_get_canonical_url(), which returns the canonical URL for a published post, adds the page number for paginated posts, and passes the result through a filter called get_canonical_url. That filter is how themes and plugins can change the output.
Google’s own page notes that CMS platforms such as WordPress may not let you edit page HTML directly and may offer a settings page instead. For SEO plugins, check the plugin’s documentation, because behaviour differs. As one example, Rank Math’s knowledge base says to open the post, go to the Advanced tab of the Rank Math panel (turn on Advanced Mode under Rank Math SEO, Dashboard if the tab is missing), edit the Canonical URL field and save. Whatever plugin you use, confirm the result by viewing the page source and searching for rel=”canonical”.
Common mistakes to avoid
- Using robots.txt to handle duplicates. Google warns that disallowed URLs may still be indexed without content. If you edit that file, test it first.
- Using noindex to pick a canonical within a site. It blocks the page entirely rather than consolidating it.
- Sending conflicting canonicals through different methods for the same page.
- Pointing to a URL fragment. Google generally does not support fragments as canonicals.
- Relative paths or a canonical outside the head.
- Listing HTTP URLs in sitemaps when HTTPS versions exist.
Also link internally to the canonical URL rather than to duplicates.
How to check the Google-selected canonical in Search Console
- Paste the full URL into the inspection bar at the top of any Search Console screen. It must belong to the property you have open.
- Read the default view, which shows the most recently indexed version. Google states this is not a live test.
- Open the Page indexing section and compare two fields: User-declared canonical (what your page declares through a tag, header, sitemap or other method) and Google-selected canonical (the URL Google chose).
If the page has no alternate versions, the Google-selected canonical equals the inspected URL. If you find an unexpected URL there, Google advises declaring a canonical version explicitly. Two cautions: the live test does not check canonical selection, because it cannot predict it, and the value may be a few hours out of date compared with the index.
Reading the Page indexing statuses
Google’s Page indexing report notes that not every non-indexed URL is a problem, and that duplicates are expected. The goal is for your important canonical pages to be indexed. Three statuses relate to canonicals:
| Status | Meaning | What to do |
|---|---|---|
| Duplicate without user-selected canonical | The page duplicates another and you have not declared a preferred URL; Google chose another page and will not show this one | Not an error. If Google picked the wrong one, declare the right canonical; if the page is not a real duplicate, make its content substantially different |
| Alternate page with proper canonical tag | The page is an alternate (for example AMP or a mobile version) that correctly points to an indexed canonical | No action needed |
| Duplicate, Google chose different canonical than user | You marked this page canonical, but Google indexed a different URL instead | Compare the two fields in URL Inspection, then correct the declaration or make the pages genuinely similar |
For pages that sit in other not-indexed states, see our explainer on Crawled and Discovered statuses.
Key takeaways
- A canonical preference is a hint, not a rule. Google may choose a different URL.
- Redirects and rel=”canonical” are strong signals; sitemap inclusion is weak. Combine them without contradicting yourself.
- Use absolute URLs, place the element in the head, and add a self-referential canonical.
- Do not use robots.txt or noindex to choose a canonical.
- Verify the outcome with URL Inspection by comparing user-declared and Google-selected canonicals.
FAQ
Is a canonical tag a directive Google must follow?
No. Google says indicating a canonical preference is a hint, not a rule, and that it may choose a different canonical for various reasons.
Do I have to specify a canonical at all?
No method is required. Without one, Google selects the version it considers best to show users. Specifying one helps you influence which URL appears, consolidate signals and simplify tracking.
Should I use both the HTML element and the HTTP header?
Google advises choosing one, since using both is more error-prone when they point to different URLs.
Why does Search Console show a different canonical than the one I set?
Google may select another URL, for example if your declared canonical is not similar enough to the page. Compare the User-declared canonical and Google-selected canonical in URL Inspection, then fix the declaration or the content differences.
Sources
- What is URL Canonicalization (Google Search Central)
- How to specify a canonical URL with rel=”canonical” and other methods (Google Search Central)
- URL Inspection tool (Search Console Help)
- Page indexing report (Search Console Help)
- rel_canonical() (WordPress Developer Resources)
- wp_get_canonical_url() (WordPress Developer Resources)
- Setting Canonical URLs in Rank Math (Rank Math knowledge base)
