How to fix seo variant urls in sitemap on WooCommerce

Remove product variant URLs (e.g. ?variant= or ?sku= query strings) from your XML sitemap and keep only the canonical base product URL for each product.

Steps for WooCommerce

  1. If using Yoast SEO: go to WP Admin → SEO → Search Appearance → Products → ensure 'Product Variations' is set to 'noindex' and that variations are excluded from the sitemap under SEO → General → Features → XML Sitemaps (click the '?' then 'See the XML sitemap') — variations should not appear.
  2. If using Rank Math: WP Admin → Rank Math → Sitemap Settings → Products → toggle off 'Include Product Variations in Sitemap'.
  3. If using All in One SEO (AIOSEO): WP Admin → All in One SEO → Sitemaps → Additional Pages — review for any manually added variant URLs, and under 'Post Types' ensure product variations are excluded.
  4. If using a custom or plugin-generated sitemap, add a filter in your child theme's functions.php to strip URLs matching the pattern '?attribute_' or any query-string parameter before they are added to the sitemap.
  5. Re-submit the updated sitemap URL in Google Search Console.
Official WooCommerce documentation ↗

What is seo variant urls in sitemap?

When shoppers (or your platform) switch between product options like size, color, or material, the URL often changes to include a query string such as `?variant=12345` or `?sku=red-large`. These variant URLs all show the same product page with slightly different state — they are not separate products. An XML sitemap is a file that tells search engines which pages you want indexed. Including variant URLs in that sitemap tells Google there are many distinct pages worth crawling and indexing, when in reality there is only one canonical product page. The fix is to ensure your sitemap lists only the clean, base product URL (e.g. `/products/blue-sneaker`) for each product, with no query-string parameters attached.

Google treats variant URLs as duplicate or near-duplicate pages of the same product. Submitting them in your sitemap wastes your crawl budget — the portion of time and resources Google allocates to your site — on pages that add no indexing value, which means your real category and product pages may be crawled and refreshed less frequently. Duplicate content signals can also dilute the ranking strength of your canonical product page, splitting authority across many near-identical URLs instead of concentrating it on the one page you actually want to rank. Practically speaking, if Google indexes a variant URL instead of your base product URL, you may appear in search results with an ugly, parameter-laden link that confuses shoppers and reduces click-through rate. Keeping a clean sitemap is one of the fastest, lowest-risk wins for improving crawl efficiency and protecting your organic search traffic.

See the complete Seo variant urls in sitemap guide for every platform and the full background.

Not sure if your WooCommerce store has this?

Run a free SEOLZ scan — we’ll find seo variant urls in sitemap and every other issue across your whole site.

Scan my site free

Fix seo variant urls in sitemap on another platform