Why e-commerce sitemaps are different

An e-commerce website can have hundreds, thousands, or even millions of URLs. A store may include product pages, category pages, brand pages, collection pages, sale pages, seasonal landing pages, buying guides, blog posts, product images, localized product pages, country-specific storefronts, translated category pages, and marketplace listings.

A traditional crawler may not discover all of these pages correctly.

Products may be hidden behind pagination, JavaScript rendering, filters, infinite scroll, category tabs, search pages, or API-loaded collections. Some products may not be linked from the homepage, but they may still be valid public product pages. Some localized versions may use different domains, subdomains, or language folders.

For an e-commerce site, the product catalog is often the real source of truth. If your API knows every product slug, category, image, language version, and update date, it can be a better source for sitemap generation than a crawler.

What an e-commerce XML sitemap should include

A good e-commerce XML sitemap should focus on public, canonical, indexable URLs.

That means your sitemap may include:

  • /products/[slug]
  • /categories/[slug]
  • /brands/[slug]
  • /collections/[slug]
  • /guides/[slug]
  • /blog/[slug]

But it usually should not include:

  • /cart
  • /checkout
  • /account
  • /login
  • /admin
  • /search?q=...
  • /products?sort=price
  • /products?color=red&size=m

The goal is not to include every URL your website can generate. The goal is to include the URLs that represent useful, indexable pages. A sitemap should not become a trash bag full of filters, duplicates, internal routes, private pages, or temporary URLs.

Product sitemap generation from API data

Most modern stores already have product data in a structured format.

With SitemapFlow, you can map this response into product URLs. A simple product URL pattern may be /products/[response.slug]. If your store uses category-based product URLs, the pattern may be /[response.category.slug]/[response.slug].

If your store uses brand-based routes, the pattern may be /brands/[response.brand.slug]/[response.slug].

The important part is choosing the canonical URL structure your store actually uses. If the product can be reached through multiple paths, the sitemap should usually include the canonical version, not every duplicate variation.

Relative paths and full URLs for e-commerce routes

SitemapFlow supports relative paths and full URLs.

A relative path is useful when the generated URL should use the main store domain or the custom domain configured for the current scope. A full URL is useful when the route belongs to a specific domain, storefront, subdomain, country domain, or language version.

This is useful for e-commerce websites that have different storefronts, regional sections, documentation subdomains, language folders, or localized product routes.

Image sitemaps for product pages

Images are a major part of e-commerce. A product page may have main product images, gallery images, variant images, lifestyle photos, color-specific images, category thumbnails, brand images, and marketplace listing images.

If your API returns image data, SitemapFlow can map those fields into image sitemap entries.

The sitemap entry can connect the product page with its image data. This is useful because the product page URL and the product image URL often come from different systems. The page may live on the storefront domain, while the image may live on a CDN.

SitemapFlow lets you map both from the same API response. The image location can be mapped with [response.media.main.url], the title with [response.media.main.title], and the caption with [response.media.main.description].

Mapping product image fields from nested JSON

Real e-commerce APIs often return nested image data. For example, your API might return an array of images or a nested media object.

Depending on how the sitemap route is configured, the main image may use a specific field such as [response.images.0.url] or [response.mainImage.url].

For the cleanest workflow, your product API should return predictable image fields for indexable products.

When to include product images in a sitemap

Image sitemap data is most useful when images are important to the page.

For a product page, the main image is often worth including. For a category page, the decision depends on the page. A category page with unique editorial content and a representative image may benefit from image data. A thin category page with only repeated product thumbnails may be less valuable.

The sitemap should support pages that already have useful content. It should not be used to force weak pages into search results.

Hreflang sitemaps for multilingual stores

Many e-commerce websites serve more than one country, region, or language.

A product may have different URLs for English, Spanish, Portuguese, French, or German. Or the store may use subdomains (en.example.com) or country domains (example.es, example.com.br).

Hreflang sitemap entries help describe alternate language or regional versions of a page. This is useful for international SEO because the same product may exist in multiple localized versions. Without clear alternate language mapping, search engines may have a harder time understanding which URL belongs to which audience.

Mapping alternate language URLs in SitemapFlow

SitemapFlow can define alternate language patterns with relative paths or full URLs.

Use a relative path when the localized version belongs to the same domain or current custom domain. Use a full URL when the localized version belongs to a specific domain or subdomain.

You can define multiple language versions, and the same API response can generate the alternate language patterns. If each language has its own translated slug, your API should return those fields separately (e.g., [response.slugs.en], [response.slugs.es]).

This makes the sitemap more accurate for multilingual product pages.

x-default for international e-commerce

The x-default value is commonly used for a default or fallback version of a page.

The generic version can be configured as the x-default URL if that is the fallback page you want users to reach when no specific language or region version is selected.

In SitemapFlow, x-default can use the same pattern system. The best choice depends on your real store structure.

Combining image and hreflang sitemap data

Some e-commerce pages need both image and hreflang sitemap data. A product page may have one canonical product URL, one product image URL, alternate language versions, a default fallback URL, and an update date.

This lets one product record generate a richer sitemap entry. For international e-commerce websites, this is often cleaner than manually maintaining separate files for every product, language, and image.

Headless e-commerce sitemap generation

Headless e-commerce websites often separate the storefront from the backend catalog.

The frontend may be built with React, Next.js, Vue, Nuxt, Svelte, Astro, or another framework. The products may come from a commerce API, CMS, PIM, ERP, or custom backend. That means the sitemap should not depend only on crawling rendered pages.

This makes SitemapFlow a practical fit for headless ecommerce sitemap generation, especially when the website uses API-based routes and structured product data.

Large e-commerce sitemap organization

Large stores often need multiple sitemap files. A store with thousands of products, categories, images, and localized URLs may be better organized with a sitemap index and separate sitemap sections.

This makes the sitemap easier to manage, especially when different parts of the store update at different speeds. Product pages may update daily. Blog posts may update weekly. Brand pages may change rarely.

A structured sitemap system helps you keep those sections separate instead of generating one huge file with everything mixed together.

Common mistakes with e-commerce sitemaps

The biggest mistake is including too many low-value URLs. An e-commerce platform can generate endless combinations of filters, sorting, colors, sizes, prices, tags, and search results. Most of those URLs should not be in a clean XML sitemap unless they represent unique, canonical, valuable landing pages.

Other common mistakes include:

  • including cart and checkout URLs
  • including account pages and admin routes
  • generating duplicate product URLs
  • including discontinued products with no useful page
  • mapping the wrong image field or using broken CDN image URLs
  • forgetting localized product versions
  • using the same hreflang URL for every language

A strong e-commerce sitemap should be selective. More URLs do not automatically mean better SEO. Better URLs mean better SEO.

Generate e-commerce image and hreflang sitemaps with SitemapFlow

SitemapFlow helps you generate dynamic XML sitemaps for e-commerce websites using static pages, REST API routes, product data, image fields, and alternate language patterns.

Instead of manually maintaining product sitemap files or hoping a crawler finds every product, you can use the structured data your store already has. Connect the API. Map the product routes. Add images. Configure hreflang. Generate a cleaner e-commerce sitemap.

Generate your XML sitemap

FAQ

What is an e-commerce sitemap generator?

An e-commerce sitemap generator creates XML sitemap URLs for online store pages such as products, categories, brands, collections, blog posts, and buying guides. SitemapFlow can generate these URLs from API data instead of relying only on crawling.

Can I generate a product sitemap from an API?

Yes. If your API returns product fields such as slug, id, category, brand, or updatedAt, SitemapFlow can map those fields into product sitemap URLs.

Can SitemapFlow create image sitemaps for products?

Yes. If your API returns image URLs, SitemapFlow can map those fields into image sitemap entries. It can also map optional image title and caption fields when your response includes them.

What fields do I need for an image sitemap?

The most important field is the image URL. Optional fields may include image title and caption. For example, you can map [response.image.src], [response.image.title], and [response.image.caption].

Can SitemapFlow create hreflang sitemaps?

Yes. SitemapFlow can create alternate language patterns using relative paths or full URLs. This is useful for multilingual stores, language folders, language subdomains, country domains, and x-default fallback URLs.

Should my sitemap include product filters?

Usually no. Filtered URLs, sorting URLs, internal search pages, and duplicate parameter URLs should generally be avoided unless they are canonical, valuable landing pages with unique content.

Should my sitemap include out-of-stock products?

It depends on your SEO strategy and whether the page still provides value. If the page is public, canonical, useful, and intended to be indexed, it may be included. If it is removed, redirected, private, or thin, it should not be included.

Can I use translated product slugs?

Yes. If your API returns translated slugs, you can map each language version separately. For example, [response.slugs.en], [response.slugs.es], and [response.slugs.ptBR].