An XML sitemap is a file with a list of addresses you want the search engine to crawl and index. It helps the search engine discover your pages faster - especially for larger stores, new pages, deeply nested pages, and pages with few internal links. A sitemap is not a guarantee of indexing, but it is one of the main ways to tell the search engine which pages matter. Below is what to include, which tags matter, and how to set it up in Magento.
Include only the right addresses
Only canonical, indexable addresses that you want to rank belong in the sitemap - those marked index and without a canonical tag pointing elsewhere. Leave out pages marked noindex, redirects, non-canonical variants, and addresses blocked in robots.txt. Quality over quantity applies: a clean sitemap with the right addresses is worth more than one bloated with duplicates, since it clearly shows the search engine what to crawl as a priority.
Which tags count
A sitemap can state several details for each address, but the search engine ignores most of them:
- lastmod (the date of the last change) is the only field Google actually uses - but only if it is credible. It should reflect a real, content change to the page (content, structured data, links), not minor changes such as updating the year.
- priority and changefreq are ignored by Google, because owners self-report them and are unreliable. Do not worry about them.
Images in the sitemap
You can also include the addresses of product images in the sitemap. This helps the search engine discover and index your images, which benefits display in image search - an additional source of traffic for the store.
Large stores: splitting and the sitemap index
A single sitemap may contain at most 50,000 addresses and at most 50 MB (uncompressed). When the store exceeds this, split the addresses into several smaller sitemaps and connect them through a sitemap index (a sitemap of sitemaps) that points to the individual files. It makes sense to separate sitemaps by content type (products, categories, content pages) so you can trace errors faster.
Multiple languages: hreflang in the sitemap
If you run the store in several languages (for example a Slovenian and an English version of the same products), hreflang tags tell the search engine which language version to show to which visitor. These links between versions can be added right into the sitemap, which helps the search engine discover all language versions faster and connect them correctly. Create a separate sitemap for each store or language.
How to set it up in Magento
Magento has built-in sitemap generation: in Stores > Configuration > Catalog > XML Sitemap, set the frequency and time of the refresh, the maximum number of addresses per file (for automatic splitting), the inclusion of product images, and the automatic addition of the link in robots.txt. The sitemap covers products, categories, and content (CMS) pages. Magento generates it per store view, so create separate sitemaps for the Slovenian and English stores. For hreflang links within the sitemap a dedicated SEO module is often required, since core Magento does not offer this option.
Submitting and measuring
When the sitemap is ready, submit it to Google Search Console (the Sitemaps report) and include a link to it in robots.txt. In the report track the status: how many addresses are submitted and how many are actually indexed, and any errors (for example addresses with an error or redirects in the sitemap). The goal is not just that the sitemap exists, but that it contains only the right addresses and that those get indexed.
