Ecommerce Sitemap: What to Include, Split and Leave Out
Short answer: an ecommerce XML sitemap should list the pages you want to rank, meaning canonical product URLs, category pages and useful content, and nothing else. Leave out filter and sort URLs, variant URLs that point their canonical at a parent product, cart and account pages, and products that are gone for good. Split it by type through a sitemap index so you can see which part Google struggles with.
Looking for a visual site map instead, the diagram of pages you draw while planning a store? That is a design document. A typical store’s structure is home → categories → subcategories → products, with brand pages, a blog and help pages alongside. This guide covers the XML file that tells search engines which of those pages exist.
What to Include and What to Leave Out
| Include | Leave out |
|---|---|
| Canonical product URLs; category and subcategory pages; brand pages with real content; buying guides and blog posts; key landing pages, including filter pages you have promoted to real pages | Filter and sort URLs (?color=, ?sort=); internal search results; cart, checkout, account, wishlist and login pages; variant URLs that canonicalize to a parent; discontinued products you redirected or removed |
The rule behind the list: every URL in the sitemap should return 200, be indexable, and name itself as canonical. Anything else sends Google mixed signals.
Filters: Promote a Few, Keep the Rest Out
Faceted navigation is the biggest source of extra URLs on most stores. A few hundred products with color, size, material and price filters can produce an enormous number of combinations, nearly all of them near-duplicates.
"Exclude all filters" is too blunt, though. Some filter pages match real searches, such as a brand within a category ("nike running shoes"). Promote that short list to proper landing pages with their own title, copy and canonical URL, and list them in the sitemap. Keep color, size, sort and price combinations out of the sitemap, and either block their parameters in robots.txt or let them canonicalize to the unfiltered category. Pick one per parameter: a page blocked in robots.txt can’t show Google its noindex or canonical tag.
Product Variants
For most stores, one product page with the variants selected on the page is right, and only that URL goes in the sitemap. Give a variant its own indexable URL only when people search for it separately and you have something different to say about it.
Out-of-Stock and Discontinued Products
Choose one policy and apply it everywhere:
- Coming back: keep the page live, show availability and a restock signup, and keep it in the sitemap.
- Gone, with a successor: 301 redirect to the closest product or the parent category, and remove it from the sitemap.
- Gone, no successor: return 404 or 410 and remove it from the sitemap. A 410 says explicitly that the item is gone for good; Google handles 404 and 410 in much the same way.
What to avoid: a sitemap full of URLs that now return 404, redirect, or carry a noindex tag. Search Console reports each of those as a problem with the sitemap.
Split the Sitemap by Type
https://store.com/sitemap.xml # index https://store.com/sitemap-products.xml # canonical product URLs https://store.com/sitemap-categories.xml # categories + promoted filter pages https://store.com/sitemap-pages.xml # about, shipping, help https://store.com/sitemap-blog.xml # guides and articles
Search Console’s page indexing report can be filtered by sitemap, so separate files show you at a glance whether products or categories are the part Google isn’t indexing. In the index, set each child’s <lastmod> to the most recent change among its URLs.
Product Images
If Google Images matters for your products, list each product’s images inside its <url> entry with the image sitemap extension, rather than in a separate file of image URLs. See the image sitemap guide for the format.
Large Catalogs
Google limits each sitemap file to 50,000 URLs or 50 MB uncompressed. Past that, split by category or by ID range and list the files in an index. Regenerate only the files whose products changed, and take <lastmod> from real product update times, not the time the sitemap was built; Google uses <lastmod> only when it is consistently accurate.
Pagination
Paginated category pages (?page=2) don’t need to be in the sitemap, but don’t hide them from crawlers either, because they are how Google reaches deeper products. Google’s guidance is to give each page in the series its own canonical URL rather than pointing them all at page 1.
Platform Guides
How this works on your platform: Shopify, WooCommerce, Magento, BigCommerce, Wix and Squarespace.
Check the Result
Before you submit, list every URL your sitemap contains and count them by type; the number of product URLs should be close to your number of live products. For an outside check, the free sitemap finder reads your robots.txt, loads the sitemap, and tests 30 of its URLs for 404s, redirects, noindex tags and canonical problems.