Skip to content

Canonical tag (canonical URL): what it is and how to use it in your store

By the SEOXtreme editorial teamUpdated 6 min read

Your basic t-shirt comes in six colors and five sizes. If each combination generates its own address, and on top of that there are versions sorted by price, links with campaign parameters, and variants with and without "www", Google may find dozens of URLs for what's really a single page. Which one does it show in results? The winner is called the canonical URL, and the canonical tag is your way of voting for it.

If you don't vote, Google decides on its own, and it doesn't always choose the version you'd want to see in results. In this guide you'll see what canonicalization is, how to write the tag without errors, what to do in a store's typical cases, and how to check which version Google chose.

In short:

  • The canonical URL is the version Google chooses as representative among duplicate or nearly identical pages.
  • The rel=canonical tag is a strong signal, but it's a hint: Google can choose another if your signals contradict each other.
  • In stores, the key cases are variants, filters, listing sorts, pagination, and campaign parameters.
  • Each page of a paginated category gets its own canonical; never point them all to page 1.
  • Check in Search Console the canonical Google chose and align links, sitemap, and redirects.

Canonical tags meaning: what a canonical URL is and why it exists

Google defines canonicalization as the process of choosing the representative URL for a piece of content, and the canonical URL as the one it chose as most representative within a group of duplicate pages. Its guide on what canonicalization is makes it clear: having some duplicate content is normal and doesn't violate its spam policies.

So why worry? For three practical reasons:

  • Concentrated signals. If links and visits are split across five versions of a product page, none of them builds up all the strength.
  • The right URL in results. You don't want Google to show ?utm_source=facebook or a version sorted by price instead of your clean product page.
  • Efficient crawling. Every duplicate Google checks is time it doesn't spend on your new products.

Pure duplicate content (descriptions copied from the manufacturer, for example) has its own guide: duplicate content in online stores.

Canonical tags and SEO: the signals Google uses to choose

Google combines several signals and, as its documentation reminds you, your preference is a hint, not a rule:

Signal Strength according to Google Example in a store
Redirect Strong A product's old URL redirects to the new one
rel="canonical" tag Strong The ?color=black version points to the base product page
Inclusion in the sitemap Weak The sitemap lists only clean URLs
HTTPS over HTTP Preference Google prefers the equivalent HTTPS version

The lesson is consistency: if the tag says A, the sitemap lists B, and your menu links to C, Google will have to guess. Its guide on how to specify a canonical URL asks you to always link to the canonical URL and not to declare different canonicals for the same page with different methods.

The canonical tag in HTML: a canonical tag example

It goes in the HTML <head>, with the absolute URL. Google only accepts it there and discourages relative paths:

<!-- In the <head> of https://yourstore.com/product/basic-cotton-tee/?color=black -->
<link rel="canonical" href="https://yourstore.com/product/basic-cotton-tee/">

<!-- And in the <head> of the base product page itself, pointing to itself -->
<link rel="canonical" href="https://yourstore.com/product/basic-cotton-tee/">

The second line is the self-referencing canonical: Google recommends including it on the canonical page too. For files that aren't HTML, such as a PDF of your size guide reachable at two addresses, the signal is sent in an HTTP header:

Link: <https://yourstore.com/downloads/size-guide.pdf>; rel="canonical"

Canonicalization in stores: five cases and their answer

Color and size variants

If all variants are chosen on the same page through parameters, Google asks in its guide to product variant structured data for a single canonical URL for the group, usually the base one with no variant preselected. If each variant has its own page with its own content, each one can be its own canonical.

In WooCommerce, variable products live on a single product page and links to a variation use parameters like ?attribute_pa_color=black. The canonical WordPress prints points to the product page's permalink, without those parameters; just check that your SEO plugin doesn't change it to the version with parameters.

Filters and listing sorts

?orderby=price or ?filter_color=black show the same category products re-sorted or trimmed. The usual approach is for them to point with a canonical to the clean category. If you generate thousands of combinations, Google considers it more effective in the long run to prevent their crawling with robots.txt; choose one path per filter type, because a blocked URL doesn't let its canonical be seen. And if a filter has searches of its own ("black cotton t-shirts"), turn it into an indexable page with its own canonical and its own text, as we explain in category page SEO.

Pagination

Google's pagination guide is explicit: don't use the first page as the canonical for the whole series; give each page its own canonical and link them in order with <a href> links. Google no longer uses rel="next" or rel="prev".

Campaign and tracking parameters

URLs with ?utm_source= arriving from ads or emails should point with a canonical to the clean URL. What comes after # isn't a concern: Google ignores fragments.

Domain versions

http://, https://, with and without www: here the tag isn't enough. Unify everything with a 301 redirect to the main HTTPS version and keep the canonical as reinforcement.

How to check which canonical Google chose

Open Search Console's URL Inspection tool and check the indexing section:

  • "User-declared canonical": the one you indicated.
  • "Google-selected canonical": the one Google chose.

If they match, all good. If not, look for the contradictory signal. In the Page indexing report, three statuses point you in the right direction:

  • "Alternate page with proper canonical tag": normal; Google respected your canonical.
  • "Duplicate without user-selected canonical": the tag is missing.
  • "Duplicate, Google chose different canonical than user": your signals aren't convincing; check internal links, sitemap, and redirects.

If an important page doesn't appear for these reasons, follow the diagnosis in why Google isn't indexing your site.

Frequent canonical tag mistakes

  1. Pointing all pagination to page 1. Google may stop considering pages 2 and onward, and with them the path to their products.
  2. Using relative URLs. They work, but Google recommends absolute ones.
  3. Pointing to URLs that redirect, return a 404, or have noindex. The canonical should be an indexable page that responds with a 200.
  4. Duplicating the tag. The theme and the SEO plugin each print their own, sometimes with different URLs.
  5. Putting it outside the <head>. If a script inserts it into the body, Google ignores it.
  6. Canonicalizing with robots.txt or noindex. Google discourages both for choosing canonicals.
  7. Copying the canonical from a template. Hundreds of product pages pointing to the home page is a classic mistake after a migration.
  8. Listing non-canonical URLs in the sitemap. Your XML sitemap should contain only the versions you want indexed.

The canonical tag in WordPress and WooCommerce

WordPress prints the canonical tag on its own, but only on singular content: posts, pages, and product pages. Categories, tags, and other archives depend on your SEO plugin. Open the source code of a category and a product page and search for rel="canonical": it should appear only once and with the correct URL.

Before (the theme and the plugin compete, and one of them carries over the sort parameter):

<link rel="canonical" href="https://yourstore.com/product-category/t-shirts/?orderby=price">
<link rel="canonical" href="https://yourstore.com/product-category/t-shirts/">

After (a single tag, with the category's clean URL):

<link rel="canonical" href="https://yourstore.com/product-category/t-shirts/">

To remove the extra tag, turn off the equivalent option in the theme or plugin that shouldn't handle SEO. Also keep your slugs stable; we explain it in SEO-friendly URLs.

SEOXtreme can handle the canonical as your only SEO plugin or work alongside Yoast, Rank Math, or AIOSEO, detecting them so tags aren't duplicated. If you're comparing options, see our Yoast and Rank Math alternative.

Conclusion: one page, one URL to represent it

The canonical tag isn't magic: it's an orderly way to tell Google which of your URLs represents each piece of content. It works when all your signals tell the same story: the tag, internal links, the sitemap, and redirects.

Your next step: inspect in Search Console a product page with variants, a filtered category, and page 2 of a listing, and confirm that the canonical Google chose matches yours. You'll find more guides like this one in the Technical SEO section.

Frequently asked questions

What is a canonical URL?

It's the URL Google chooses as the most representative among several duplicate or very similar pages, and the one it normally shows in its results. You can suggest which one you prefer with the rel=canonical tag, with redirects, or by including that URL in your sitemap, but Google takes your preference as a hint, not an order, and may choose another.

What's the difference between the canonical tag and a 301 redirect?

With a 301 redirect, the old URL stops showing and the visitor lands directly on the new one. With the canonical tag, both URLs keep working for the user, but you tell Google which one to consolidate and show in results. Use the 301 when a page should no longer exist and the canonical when you need to keep several versions accessible, like a product with color parameters.

Should every page have a canonical pointing to itself?

Yes, that's recommended. Google suggests including the rel=canonical tag on the canonical page itself too. A self-referencing canonical, written with the absolute URL, makes your preference clear when versions appear with campaign parameters, capital letters, or different slashes, something very common in stores with filters, listing sorts, and product variants.

How do I know which canonical URL Google chose?

In Google Search Console, open the URL Inspection tool and paste the address. In the indexing section you'll see 'User-declared canonical' and 'Google-selected canonical'. If they don't match, Google chose another version: check your internal links, your sitemap, and your redirects, because they're probably sending contradictory signals.

Should the pages of a paginated category point to page 1?

No. Google recommends not using the first page of a paginated series as the canonical and, instead, giving each page its own canonical URL. Page 2 of a category shows different products from page 1, so it isn't a duplicate. Also, Google no longer uses the rel=next and rel=prev tags, although other search engines might still read them.

Sources

  1. What is canonicalization (Google Search Central)
  2. How to specify a canonical URL with rel=canonical and other methods (Google Search Central)
  3. Pagination, incremental page loading, and their impact on Google Search (Google Search Central)
  4. URL Inspection tool (Search Console Help)
  5. Product variant structured data (Google Search Central)
  6. Managing crawling of faceted navigation URLs (Google Search Central)
  7. rel_canonical() (WordPress Developer Resources)

Written and reviewed by the SEOXtreme editorial team using official sources (Google Search Central, platform documentation, and published studies). If you spot outdated information, email us at hola@vidaxtreme.com.

Keep learning

Stop optimizing by hand

SEOXtreme does this work for you across your whole catalog, with your approval. Try it for 14 days, no credit card.

14-day free trialAudit