Seo variant urls in sitemap
Moderate effortFound on 1% of audited stores.
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.
What it is
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.
Why it matters
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.
How to fix it
- Audit your current sitemap (usually at yourstore.com/sitemap.xml or /sitemap_index.xml) and identify any URLs containing query parameters such as ?variant=, ?sku=, ?color=, or ?size=.
- Determine whether your platform is generating these variant URLs automatically (most do) or whether a third-party sitemap app/plugin is responsible.
- Configure your sitemap generator to exclude URLs with query parameters, or explicitly allowlist only clean base product URLs.
- Verify each base product URL has a self-referencing canonical tag pointing to that same clean URL — this reinforces to Google which version to index.
- Regenerate or re-submit your sitemap in Google Search Console (Indexing → Sitemaps) so Google fetches the corrected version.
- After a few days, use the URL Inspection tool in Google Search Console to confirm that variant URLs are no longer being submitted and that the canonical product URLs are being indexed correctly.
Fix it on your platform
Pick your platform for the exact steps.
How to fix seo variant urls in sitemap on Shopify
- Shopify's built-in sitemap.xml automatically includes only canonical product URLs and excludes variant query strings — if you are seeing variant URLs, a third-party sitemap app is the likely culprit.
- Go to Apps → check for any installed sitemap, SEO, or schema apps (e.g. 'SEO Manager', 'Sitemap & SEO', 'Smart SEO').
- Open the app's settings and look for a 'Sitemap' or 'URL Filters' section; disable variant URL inclusion or enable 'exclude query parameters'.
- If you have no sitemap app, verify the native sitemap at yourdomain.com/sitemap.xml — it should list only /products/[handle] URLs with no query strings.
- Re-submit the sitemap in Google Search Console under Indexing → Sitemaps.
How to fix seo variant urls in sitemap on Shopify Plus
- Same as Shopify above. If you are using a custom Hydrogen/headless storefront, see the Headless / Custom entry.
- For script-generated sitemaps in a custom storefront, filter out any URL that contains a '?' character before writing entries to the sitemap XML.
How to fix seo variant urls in sitemap on WooCommerce
- 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.
- If using Rank Math: WP Admin → Rank Math → Sitemap Settings → Products → toggle off 'Include Product Variations in Sitemap'.
- 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.
- 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.
- Re-submit the updated sitemap URL in Google Search Console.
How to fix seo variant urls in sitemap on BigCommerce
- BigCommerce generates its sitemap automatically at yourdomain.com/xmlsitemap.php and normally excludes variant query strings.
- Go to Store Setup → Store Profile → Verify your store URL is correct so the sitemap root is accurate.
- If a third-party SEO app (e.g. 'SEO Doctor', 'Aheadworks SEO', 'Yotpo') is overriding the sitemap, open that app's settings and disable variant URL inclusion.
- For headless BigCommerce storefronts, see the Headless / Custom entry and filter out ?sku= or ?variant= parameters in your sitemap-generation script.
- Re-submit the sitemap in Google Search Console.
How to fix seo variant urls in sitemap on Wix
- Wix manages the sitemap automatically; store owners cannot directly edit the XML file.
- Go to your Wix Dashboard → Marketing & SEO → SEO Tools → SEO Settings, and verify 'Let Wix create and manage your sitemap' is enabled — this uses the safe, canonical-only version.
- Ensure product pages are set to 'Indexed' (not hidden) so the canonical page appears: Dashboard → Marketing & SEO → SEO Tools → SEO Patterns → Product Pages.
- If you have Wix eCommerce, Wix automatically uses the clean product URL without variant parameters in the sitemap — no further action is needed unless a third-party Wix app is generating a custom sitemap.
- Re-submit yoursite.com/sitemap.xml in Google Search Console.
How to fix seo variant urls in sitemap on Squarespace
- Squarespace automatically generates a sitemap at yoursite.com/sitemap.xml and controls its contents — you cannot manually edit it.
- Go to Pages → click the gear icon on each product page → SEO tab → ensure 'SEO Visibility' is enabled (not hidden), which lets the canonical page appear in the sitemap.
- Squarespace Commerce variant URLs (e.g. ?variant=) are not included in the native sitemap — if you see them, a third-party integration or script may be injecting them.
- Check any connected marketing or SEO apps in Extensions and disable sitemap customization features that add query-string URLs.
- Re-submit your sitemap in Google Search Console to trigger a fresh crawl.
How to fix seo variant urls in sitemap on Webflow
- Go to Webflow Designer → Project Settings (gear icon) → SEO tab → 'Sitemap' section.
- Ensure 'Auto-generate sitemap' is enabled; Webflow's native sitemap lists only canonical Collection (product) page URLs without query parameters.
- If you are using Webflow Commerce with variant URLs appearing in the sitemap, check for third-party sitemap or SEO integrations under Integrations tab and disable variant URL inclusion.
- For custom sitemap files uploaded to Webflow (via Assets or hosting), open the XML file, delete any <loc> entries containing '?' parameters, and re-upload.
- Re-submit in Google Search Console after publishing changes.
How to fix seo variant urls in sitemap on Adobe Commerce (Magento)
- Go to Admin Panel → Marketing → SEO & Search → Site Map.
- Click 'Edit' on your sitemap (or 'Add Sitemap' if none exists) and review the generation settings.
- Navigate to Stores → Configuration → Catalog → XML Sitemap — expand 'Product Options' and verify that only 'Use URLs' is set to base product URLs; set 'Use Secure URLs' appropriately.
- Install or configure a sitemap extension (e.g. Amasty SEO Toolkit or Mirasvit SEO) that has an explicit 'Exclude URLs with query parameters' option, and enable it.
- Alternatively, add a custom plugin/observer on the sitemap generation event to filter out any product URL containing a query string before it is written to the sitemap XML.
- Regenerate the sitemap (Marketing → SEO & Search → Site Map → Generate) and re-submit in Google Search Console.
How to fix seo variant urls in sitemap on Magento Open Source
- Follow the same steps as Adobe Commerce (Magento) above — the admin path and configuration keys are identical.
- For programmatic sitemap generation via cron, edit app/code/[Vendor]/Sitemap/Model/Sitemap.php (or the equivalent community module) to filter getCollection() results and exclude URLs with query parameters.
- Run bin/magento cron:run --group=index to regenerate, then verify the output XML file.
How to fix seo variant urls in sitemap on PrestaShop
- Go to Admin → Modules → Module Manager → search for 'Google Sitemap' (the native module).
- Open the module configuration and look for 'Exclude dynamic URLs' or 'URL parameters to exclude' — add 'variant', 'sku', 'color', 'size', or whichever parameters your store uses.
- If using a third-party SEO module (e.g. SEO Expert, Yoast for PrestaShop), find its Sitemap settings and disable 'include product combinations/attributes in sitemap'.
- Regenerate the sitemap from the module settings page and verify the output XML.
- Re-submit in Google Search Console.
How to fix seo variant urls in sitemap on Headless / Custom (I build in code)
- In your sitemap generation script or build pipeline, fetch the list of all product URLs from your CMS or commerce API.
- Before writing each <loc> entry, strip any query string: in Node.js use `new URL(url).pathname`; in Python use `urllib.parse.urlsplit(url).path`.
- Write only the clean, canonical path (e.g. /products/blue-sneaker) to the <loc> element.
- Ensure each corresponding product page also outputs a <link rel='canonical'> tag pointing to the same clean URL.
- Rebuild and deploy the sitemap, then re-submit in Google Search Console.
How to fix seo variant urls in sitemap on Next.js (Headless)
- Locate your sitemap source — either `app/sitemap.ts` (App Router) or a custom `pages/sitemap.xml.tsx` / `getServerSideProps` route (Pages Router). This is the ONLY place to make changes.
- In the function that builds sitemap entries, strip every query string (e.g. `?variant=`, `?sku=`, `?color=`) from product URLs before they are emitted. Use `new URL(rawUrl)` and read only `origin + pathname` — discarding `search` entirely.
- Deduplicate the resulting URL list with a `Set` or `Map` keyed on the clean pathname, so that multiple variants that share the same base product URL collapse into a single sitemap entry.
- Return (or render) only the deduplicated, query-string-free canonical URLs. For App Router this means returning the cleaned array from `sitemap.ts`; for Pages Router this means building the XML string from the cleaned array inside `getServerSideProps`.
- Verify the output by visiting `/sitemap.xml` locally and confirming no `?variant=` / `?sku=` parameters appear, and that each product path appears exactly once.
- Optionally set a `<link rel='canonical'>` on every product page (via `generateMetadata` or `next/head`) pointing to the same base URL, so crawlers that reach a variant URL are explicitly directed to the canonical version.
Does your site have this issue?
Run a free SEOLZ scan to find seo variant urls in sitemap — and every other issue — across your whole site in minutes.
Scan my site freeFrequently asked questions
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.
Why does seo variant urls in sitemap matter?
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.
How do I fix seo variant urls in sitemap?
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.
Authoritative references
- SEO Starter Guide — Google Search Central
- Consolidate duplicate URLs (canonical) — Google Search Central
- Robots meta tag & noindex — Google Search Central