An XML sitemap is the most boring file on your store and one of the first an audit flags when it is missing. The pattern: a catalog with thousands of URLs, a generated sitemap that lists the wrong things or none at all, and pages that exist but never got found. The fix is not complicated, but it is specific — what to include, what to exclude, and when to split the file apart.
One expectation to set before anything else, straight from Google’s sitemap documentation: “submitting a sitemap is merely a hint: it doesn’t guarantee that Google will download the sitemap or use the sitemap for crawling URLs on the site.” A sitemap does not force anything; it tells search engines which URLs you consider canonical and worth showing, and it helps them discover pages internal linking might miss — on a large catalog, exactly the pages you care about.
What a sitemap actually does
Two jobs, both narrower than folklore suggests:
- Discovery. Crawlers find pages through links; the sitemap supplements that by letting them “quickly and comprehensively identify all URLs included in the sitemap,” as WordPress’s own sitemap documentation puts it. New products on deep shelves, orphaned campaign pages, blog posts with few internal links — these are the URLs a sitemap rescues.
- Canonical preference. Google: “when creating a sitemap, you’re telling search engines about which URLs you prefer to show in search results. These are the canonical URLs.” If the same content is reachable under several URLs, “choose the URL you prefer and include that in the sitemap instead of all URLs that lead to the same content.”
What it does not do: override a noindex, fix duplicate content, or make a thin page worth indexing. Every URL in a sitemap should be one you would be happy to see in search results exactly as listed.
What to include
The rule is one sentence long: include canonical, indexable URLs you want in Google’s search results. On a store, that set is usually:
| Content type | Include | Notes |
|---|---|---|
| Product pages | Live, in-stock or permanently available products | One canonical URL per product, not one per variant parameter |
| Category/collection pages | Navigable, indexable categories | The pages that carry your commercial queries |
| Static pages | About, contact, shipping, returns, sizing guides | Trust and support pages get searched too |
| Blog and buying guides | All published, indexable articles | Often the most under-linked pages on the site |
Mechanically, Google’s requirements are small but strict:
- Absolute URLs only. “Use fully-qualified, absolute URLs in your sitemaps” —
https://www.example.com/mypage.html, never/mypage.html. “Google will attempt to crawl your URLs exactly as listed.” - UTF-8 encoding, and all XML tag values entity-escaped.
- Location matters. Unless you submit the sitemap through Search Console, “a sitemap affects only descendants of the parent directory,” which is why Google recommends posting sitemaps at the site root.
- If mobile and desktop URLs differ, point to only one version per page, or annotate both properly.
The lastmod question
lastmod is the only optional tag worth caring about, and only if you can be honest with it. Google “uses the <lastmod> value if it’s consistently and verifiably (for example by comparing to the last modification of the page) accurate.” The value should reflect “the last significant update to the page” — main content, structured data, or links count; a copyright-year bump does not. A sitemap that stamps every URL with today’s date is worse than no lastmod at all, because it teaches Google to ignore the field.
What to exclude
The exclusion list is where e-commerce sitemaps usually go wrong. Leave out:
- Non-canonical variants. Parameterized faceted URLs, sort orders, session IDs, tracking parameters. If
?color=red&sort=priceserves the same category page, the sitemap gets the clean canonical URL and nothing else. (Faceted navigation has its own rules — our technical e-commerce SEO guide covers how filters should behave.) noindexedpages. A URL that says “don’t index me” in the meta tag while being advertised in the sitemap sends contradictory signals. Pick one.- Redirects, 404s and server-error URLs. A stale sitemap full of dead links is a generation bug, not a crawl-budget strategy.
- URLs blocked by robots.txt. You cannot both block crawling and request it.
- Thin or placeholder pages. Products with no description, empty categories, “coming soon” pages. The sitemap is a quality claim about every URL in it.
- On-site search results and internal utility URLs. These are for shoppers, not crawlers.
- Paginated depth beyond what earns its place. Page 2 of a sorted category rarely deserves a sitemap entry; the canonical category URL is the asset. This is a judgment call rather than a Google rule — include deep pages when they have unique content and their own demand.
The mental model: the sitemap is a curated guest list, not a database dump.
When to split, and how
Google’s size limits are the trigger: “all formats limit a single sitemap to 50MB (uncompressed) or 50,000 URLs. If you have a larger file or more URLs, you must break your sitemap into multiple sitemaps.” At that point you can create a sitemap index file and “submit that single index file to Google.”
But do not wait for 50,000 URLs. Splitting by content type is useful long before the limit, and Google explicitly supports it: “you can submit multiple sitemaps and sitemap index files to Google. This may be useful if you want to track the search performance of each individual sitemap in Search Console.”
The standard e-commerce split, and the one Shopify ships by default:
| Sitemap | Contains | Why separate |
|---|---|---|
| Products | All canonical product URLs | Largest file; churns most often; own error trends |
| Collections/categories | Category and collection URLs | The money pages; watch indexing rate closely |
| Pages | Static content | Small, stable |
| Blog/posts | Articles | Publishing cadence differs; lastmod is meaningful here |
Separate files turn Search Console into a diagnostic tool: a spike of errors in the products sitemap is a catalog sync problem; a drop in indexed category URLs is an architecture problem. One giant sitemap.xml hides both.
Two smaller points from Google’s documentation: URL order “doesn’t matter to Google,” and Google “ignores <priority> and <changefreq> values” entirely — so a generator offering to tune them is selling motion, not progress.
Platform mechanics
Shopify
Shopify generates the sitemap for you. Per the Shopify help center: “All Shopify stores automatically generate a sitemap.xml file that contains links to all your products, primary product image, pages, collections, and blog posts.” You will find it at your domain root (example.com/sitemap.xml), and “the generated sitemap files link to separate sitemaps for your products, collections, blogs, and webpages” — the same content-type split recommended above.
Things Shopify merchants should know:
- Sitemap files “are automatically updated when you add a new webpage, product, collection, image, or blog post.” Nothing to regenerate.
- On the Basic plan or higher, international domains get “sitemap files for all of your domains.” Domains that just redirect to your primary are fine; domains serving duplicate content without international targeting are not — make them redirect.
- Private mode makes the store invisible to sitemap readers.
You cannot hand-edit the file, so your levers are upstream: what is published, canonical and unblocked. That is usually the real fix anyway.
WordPress and WooCommerce
Since WordPress 5.5, core ships its own sitemaps: “WordPress will expose a sitemap index at /wp-sitemap.xml. This is the main XML file that contains the listing of all the sitemap pages exposed by a WordPress site.” The details that matter for stores, from the core sitemaps announcement:
- “The sitemap index can hold a maximum of 50000 sitemaps, and a single sitemap can hold a (filterable) maximum of 2000 entries.” A big WooCommerce catalog will exceed 2,000 products and paginate the product sitemap — that is by design, not an error.
- “By default, sitemaps are created for all public and publicly queryable post types and taxonomies, as well as for author archives and of course the homepage.” WooCommerce’s product and product-category structures are public content types, which is how catalog URLs get in.
- “The robots.txt file exposed by WordPress will reference the sitemap index” for discovery.
One collision to check: an SEO plugin that generates its own sitemap can coexist with core’s — one at /sitemap.xml, one at /wp-sitemap.xml. Pick the authoritative one, point robots.txt and Search Console at the same file, and retire the other. Submitting two systems’ output is how contradictory canonicals hide for months.
Submitting and verifying
Submission has three supported routes, per Google:
- Search Console’s Sitemaps report — the primary one, and the only route that shows “when Googlebot accessed the sitemap and also potential processing errors.”
- The Search Console API, for programmatic submission.
- A robots.txt line —
Sitemap: https://example.com/my_sitemap.xml— found “the next time we crawl your robots.txt file.” There is “no limit to the number of sitemaps you can include in your robots.txt file.”
Then verify the loop:
- Open the sitemap URL in a browser — it renders, and it is the file (or index) you expect.
- Spot-check entries: absolute canonical URLs only, no redirects or dead links.
- Fetch it as Google via URL Inspection — the crawler should see the same file.
- In the Sitemaps report, compare discovered URLs against what you published; big gaps mean filtering or a stale file.
- Cross-check sample product URLs with URL Inspection — sitemap presence and indexation are different facts.
- Re-run after every catalog import or platform migration.
FAQ
Do online stores really need an XML sitemap? Strictly, no site needs one — Google finds pages through links. But catalogs outgrow their internal linking: new products on deep shelves, orphaned guides, seasonal pages. Google treats sitemaps as a discovery supplement and a statement of canonical URL preference, and on a large store that supplement pays for itself the first time it rescues a launch page.
How many URLs can one XML sitemap contain? 50,000 URLs or 50MB uncompressed, whichever comes first. Beyond that, split into multiple sitemaps and optionally wrap them in a sitemap index file. Splitting by content type (products, categories, pages, blog) is worthwhile well before the limits.
Which URLs should I leave out of my store’s sitemap? Anything you would not want shown in search results as-is: non-canonical parameter variants, noindexed pages, redirects and dead URLs, robots.txt-blocked URLs, thin placeholders, internal search pages. The sitemap claims every listed URL is canonical and worth ranking.
Does Shopify let me edit my sitemap? No — Shopify generates and updates sitemap files automatically, with separate child sitemaps for products, collections, blogs and webpages. You influence it by controlling what is published and indexable. Submit to Search Console after verifying your domain, and note private mode blocks sitemap readers.
Should I include <lastmod>, <priority> and <changefreq>? Only lastmod, and only when accurate. Google ignores priority and changefreq outright and uses lastmod only if consistently verifiable against real page updates. A wrong lastmod is worse than none.
How often should I resubmit my sitemap? Usually never. Shopify updates its sitemap as content changes, WordPress generates on request, and Google re-reads submitted sitemaps on its own schedule. Resubmit after a migration, domain change or catalog overhaul; daily resubmission is noise.
Conclusion
A good e-commerce sitemap is a short, honest list: every canonical URL you want indexed, none of the variants and dead ends you do not, split by content type so Search Console can tell you which part of the store is sick. Google’s rules are small — 50,000 URLs or 50MB per file, absolute URLs, accurate lastmod, ignore priority — and the platform work is mostly configuration, not code.
If your store’s crawl-and-index layer needs more than a checklist, our technical SEO services cover sitemap architecture alongside the rest of the stack, the sitemap chapter fits into the technical e-commerce SEO guide, and the wider picture is in the complete guide to e-commerce SEO.