The structure of an XML sitemap

The minimum viable sitemap contains only the <loc> element with a URL. Additional fields make it more informative for the search engine:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/product/sneakers-123</loc>
    <lastmod>2025-05-15</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

The lastmod field is the only one search engines actively use. Set it dynamically from the real date the page last changed.

Sitemaps for e-commerce: split by content type

A large online store normally uses a sitemap index split across several files:

File Content type Update priority
sitemap-products.xml Product pages High (prices, stock)
sitemap-categories.xml Categories / PLPs Medium
sitemap-articles.xml Blog articles Low
sitemap-images.xml Product images On change

Important: do not include pages blocked in robots.txt, duplicate pages with parameters (filters, pagination) or pages carrying noindex. A badly built sitemap is a signal of problems in the site architecture.

When a sitemap matters most

New pages — without a sitemap the search engine learns about them only through links. For fresh landing pages or new product categories a sitemap is a direct route to fast indexation.

Deep URLs — pages three to five levels down can wait a long time to be crawled. A sitemap tells the search engine they exist.

Frequently updated catalogues — an accurate lastmod on product pages signals that the page should be recrawled, for example after a price or description change.

Submission and monitoring

A sitemap is submitted through the Google Search Console interface (the Sitemaps section) and, for Yandex, through Yandex Webmaster (Indexing, then Sitemap files). Once submitted, Search Console shows how many of the sitemap’s URLs the engine has discovered and indexed — a gap between “submitted” and “indexed” points at problems with page quality or availability.