Ecommerce Sitemap: Best Practices for Online Stores

Products, categories, filters and out-of-stock items: how to build a clean sitemap for your online store.

Ecommerce Sitemap: Best Practices for Online Stores
Contents
  1. Why ecommerce sites need a good sitemap
  2. What to include in an ecommerce sitemap
  3. Filters, variants and pagination
  4. Handling out-of-stock and discontinued products
  5. Split your sitemap by page type
  6. Add product images
  7. Keep lastmod honest
  8. Sitemaps on popular store platforms
  9. Sitemap vs Google Merchant Center feed
  10. Audit your store sitemap in minutes
  11. Build and check your store sitemap for free

An ecommerce sitemap is an XML sitemap that lists the product, category, brand and content pages of an online store. It should include only live, indexable, canonical URLs. It should leave out filters, sort orders, cart, account and search pages, and is usually split into separate files for products, categories and posts. Online stores are some of the hardest sites for search engines to crawl. A shop with a few hundred products can produce tens of thousands of URLs once filters and tracking parameters are added, so a clean sitemap tells Google exactly which pages matter. This guide covers what to include, how to handle variants, filters and out-of-stock items, and how to keep the sitemap accurate as your stock changes.

Why ecommerce sites need a good sitemap

  • Products change all the time. New items, price changes and returning stock need to be found quickly.
  • Deep pages are hard to reach. A product five clicks deep inside a category may rarely be crawled through links alone.
  • Duplicate URLs are everywhere. Colour filters, size filters and sort orders create many versions of the same page.
  • Crawl time is limited. On very large stores, every request Google spends on a filter page is one it doesn’t spend on a product.

What to include in an ecommerce sitemap

Page typeInclude?Why
Product pagesYesYour main money pages
Category and sub-category pagesYesThey rank for broad searches like “men’s running shoes”
Brand pagesYes, if indexableUseful for brand + product searches
Blog posts and buying guidesYesThey attract visitors earlier in the buying journey
Homepage and key info pagesYesAbout, delivery, returns and contact pages build trust
Filter, sort and parameter URLsNoDuplicates of the category page
Cart, checkout, account, wishlistNoPrivate pages with no search value
Internal search resultsNoThin, endless and usually noindex

The simple rule: list only pages that are live (status 200), indexable and canonical. Anything that redirects, returns an error or carries a noindex tag should stay out.

Filters, variants and pagination

Faceted navigation (filters)

Filters for colour, size, price and brand are useful for shoppers but create endless URL combinations such as ?colour=red&size=9&sort=price. Keep these out of the sitemap. In most cases, point their canonical tag to the main category page. The exception is a filtered page you have deliberately made into a proper landing page, for example “red running shoes”, with its own clean URL, title and text. Pages like that can be listed.

Product variants

If each colour or size has its own URL, decide which one is the main page. When variants canonicalise to a single product page, list only that page. When each variant is a separate, self-canonical page with its own content, list each one. The rule is the same as everywhere else: non-canonical URLs don’t belong in a sitemap.

Paginated category pages

Page 2, 3 and beyond of a category help Google reach older products. If those pages are indexable and self-canonical, listing them is fine, but it is optional. What matters more is that they are linked with normal <a href> links, not only loaded by a “load more” button that needs JavaScript.

Handling out-of-stock and discontinued products

  • Temporarily out of stock: keep the page live and in the sitemap. Show “back soon” or let people sign up for alerts.
  • Permanently discontinued, with a close replacement: redirect it (301) to the replacement or the parent category, and remove the old URL from the sitemap.
  • Permanently gone, no replacement: return a 404 or 410 and remove it from the sitemap.

Leaving dead products in the sitemap is one of the most common reasons stores see “Not found (404)” errors in Search Console.

Split your sitemap by page type

Larger stores should break their sitemap into smaller files joined by a sitemap index — for example one file for products, one for categories and one for blog posts:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap><loc>https://shop.example.com/sitemap-products.xml</loc></sitemap>
  <sitemap><loc>https://shop.example.com/sitemap-categories.xml</loc></sitemap>
  <sitemap><loc>https://shop.example.com/sitemap-posts.xml</loc></sitemap>
</sitemapindex>

Splitting has two big benefits. You stay under the limit of 50,000 URLs per file (see sitemap size limits). And in Search Console’s page indexing report you can filter by each sitemap, so you can see at a glance if products are being indexed less than categories.

Add product images

Product photos can bring visitors from Google Images. An image sitemap adds <image:image> tags to each product URL, so Google finds the main photos even when they are loaded by scripts or sliders:

<url>
  <loc>https://shop.example.com/trainers/red-runner</loc>
  <image:image>
    <image:loc>https://shop.example.com/img/red-runner-side.jpg</image:loc>
  </image:image>
</url>

Remember to add xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" to the root tag.

Keep lastmod honest

Update the lastmod date only when something meaningful changes on the page — price, stock status, description or images. If every product shows today’s date every day, Google learns to ignore the field. Accurate dates help Google re-crawl the products that actually changed.

  • Shopify creates /sitemap.xml automatically. It is a sitemap index split into products, collections, pages and blogs, and you cannot edit it directly. To hide a page from search, set Shopify’s seo.hidden option (many SEO apps do this for you). Shopify then adds noindex and removes the page from the sitemap.
  • WooCommerce uses the WordPress sitemap at /wp-sitemap.xml, where products get their own file, or the sitemap of an SEO plugin such as Yoast or Rank Math. See our WordPress sitemap guide.
  • Custom or headless stores need a sitemap generated by your code or by a crawler.

Even with an automatic sitemap, check it. Platforms sometimes include filtered collections, out-of-stock variants or redirected URLs. Other platforms are covered in how to create an XML sitemap.

Sitemap vs Google Merchant Center feed

If you sell through Google Shopping, you may already send a product feed to Merchant Center. The feed and the sitemap do different jobs. The feed sends prices, stock and product data for Shopping ads and free listings. The sitemap helps Google find and crawl your product pages for normal search results. Keep both, and keep them in step, so the products in your feed are also live in your sitemap.

Audit your store sitemap in minutes

To see what your sitemap really contains, open it in the Sitemap URL Extractor. Filter by /product or /collections/ to count products and categories. Choose Duplicates only to find products listed twice, and click Check status to catch 404s and redirects left behind by sold-out items. Sort by date to spot products that haven’t been updated for years.

Build and check your store sitemap for free

  1. Generate it. Our XML sitemap generator crawls your store and leaves out redirects, noindex pages and non-canonical URLs. Tick Split by type to get separate files for products, categories and posts, and Include images for an image sitemap.
  2. Test it. Run the result through the sitemap checker with the page sample turned on, to catch broken or redirected product URLs.
  3. Submit it in Search Console and list it in robots.txt — our guide to adding a sitemap to robots.txt shows the exact line to use.

Tip: Re-generate or re-check your sitemap after big stock changes, seasonal sales or a platform migration — that is when broken product URLs usually appear.

Frequently asked questions

Quick answers to the questions we hear most. Still have a question? Ask us through our contact page.

Should out-of-stock products be in my sitemap?

Yes, if they are coming back. Remove products that are permanently gone and redirect or 404 their URLs.

Should filter and sort URLs be in my sitemap?

No. They are usually duplicates of the category page. List only canonical, indexable URLs.

Do I need an image sitemap for my store?

It helps Google find product photos, especially ones loaded by sliders or scripts, which can bring visits from Google Images.

How should a large store split its sitemap?

By page type — products, categories and posts — joined with a sitemap index, keeping each file under 50,000 URLs.

Should product variants be in my sitemap?

Only if each variant is a separate, self-canonical page. If colour or size variants point their canonical tag to one main product page, list only that page.

Is a Merchant Center product feed the same as a sitemap?

No. The feed sends prices and stock data for Google Shopping, while the sitemap helps Google crawl your product pages for normal search results. Keep both up to date.

Crawly

Crawly is the friendly sitemap guide of XML Sitemap Generator. Every guide is written and checked by the team behind our free sitemap tools.

Related articles

Sitemap Guides

Sitemap Size Limit: 50,000 URLs and 50 MB Explained

23 Nov 2026 · 5 min read
Technical SEO

Non-Canonical URLs in Your Sitemap: Why They Matter and How to Fix Them

23 Nov 2026 · 4 min read
Sitemap Guides

How to Create a Sitemap in WordPress (With or Without a Plugin)

23 Nov 2026 · 4 min read