How to fix seo variant urls not canonicalized on WooCommerce

Add a canonical tag to every product variant URL pointing back to the base product page, so Google consolidates ranking signals onto one authoritative URL instead of splitting them across hundreds of near-duplicate pages.

Steps for WooCommerce

  1. Install the free Yoast SEO or Rank Math SEO plugin if not already present (Plugins → Add New, search for 'Yoast SEO' or 'Rank Math').
  2. WooCommerce variable products generate URLs like /products/my-shirt/?attribute_pa_color=red. Yoast SEO and Rank Math both automatically canonicalise attribute/variation URLs back to the base product URL — confirm this is active.
  3. In Yoast SEO: go to SEO → Search Appearance → WooCommerce and ensure 'Product Variations' is set to 'noindex' or that canonicals are handled (Yoast handles this transparently).
  4. In Rank Math: go to Rank Math → Titles & Meta → WooCommerce and verify 'Canonical URL' is enabled for product pages.
  5. If you have a custom or headless WooCommerce setup, add the canonical programmatically in your theme's functions.php: add_action('wp_head', function(){ if(is_product()){ global $post; echo '<link rel="canonical" href="'.get_permalink($post->ID).'">'; } });
  6. Test with Google Search Console URL Inspection on a ?attribute_ variant URL.
Official WooCommerce documentation ↗
<link rel="canonical" href="https://www.example.com/products/base-product-slug">

What is seo variant urls not canonicalized?

When a shopper picks a color, size, or other option on a product page, most ecommerce platforms create a new URL — for example, `/products/my-shirt?color=Red` or `/products/my-shirt?size=L`. These variant URLs contain almost identical content to the main product page. A canonical tag is a small HTML snippet you place in the `<head>` of each variant page that says to Google: "The definitive version of this content lives at [base product URL] — please treat that as the real one." It does not redirect shoppers; it only guides search engines.

Without canonical tags on variant URLs, Google sees hundreds or thousands of near-duplicate product pages and must guess which one to rank. This splits your "link equity" (the ranking power earned from backlinks and user signals) across all variants instead of concentrating it on your main product page, pushing every version lower in search results. It also wastes your crawl budget — Googlebot spends time re-crawling colour and size variants instead of discovering new products or categories. Stores with large catalogues (hundreds of products × multiple variants) can lose significant organic traffic this way. Fixing canonicalisation is one of the highest-ROI SEO tasks for any product-rich store.

See the complete Seo variant urls not canonicalized guide for every platform and the full background.

Not sure if your WooCommerce store has this?

Run a free SEOLZ audit — we’ll find seo variant urls not canonicalized and every other issue across your whole site.

Scan my site free

Fix seo variant urls not canonicalized on another platform