Generating XML sitemaps in Magento Open Source

How to generate XML sitemaps per store view in a self-hosted Magento Open Source store, which settings control file size, image entries and refresh timing, and how the sitemap reaches search engines through robots.txt.

On this page

When a Magento Open Source store needs XML sitemaps for generating XML sitemaps

If your self-hosted Magento Open Source store runs several store views or carries a large catalog, search engines need a dependable map of your products, categories and CMS pages, and an XML sitemap is the file that provides it. In Magento Open Source, the sitemap feature generates these files from the catalog and content data for each store view, so each storefront can publish its own sitemap with its own URLs. A single small store with one store view may never need to touch the defaults. A multi-store setup, a catalog with many thousands of SKUs, or a store whose URLs differ by locale usually does, because the default output may not match how search engines should reach each store view.

Before you change anything, confirm the exact menu paths, field names and options against the Magento Open Source version you run. The configuration screens for sitemap generation have shifted between releases, and the release line you choose affects what you can set. The supported platform versions are listed in the Adobe Commerce system requirements, and the release notes for your version are the right place to check for sitemap-related changes. Also confirm the generated file location and the sitemap entry each store view writes, because you will reference these in later steps.

The decisions that matter most are which entity types belong in each store view's sitemap, whether image entries are needed for product discovery, how large the output can grow before you split it, and how often the file is regenerated. Ask your implementation partner or your own team to document the file size limits, refresh interval and cron job that your version uses, and to test them on a staging copy with a catalog of realistic size. Those figures should come from your environment and your version's documentation, not from assumptions. Once they are confirmed, plan the cron schedule alongside your other background jobs so sitemap generation does not compete with indexing on a busy store.

Which sitemap settings fit each store view

This table compares the sitemap settings you configure for each store view and how each choice affects crawl coverage, file count and generation time. Read each row against your catalog size and store structure, then confirm the current values in your own admin configuration, since defaults and limits can differ by release. The main takeaway is that a multi-store setup multiplies every choice, so review each store view on its own.

SettingWhat it controlsSmall single-store catalogLarge multi-store catalog
Product pagesProduct URLs listed for the store viewInclude. One file usually covers the catalog. Confirm disabled products are excluded.Include per view. Confirm each view lists only products assigned to its website and enabled there.
Category pagesCategory URLs listed for the store viewInclude. Few URLs, so coverage is complete with little effort.Include, but confirm filtered or anchor category URLs are not listed as separate entries.
CMS pagesContent pages such as guides and policiesInclude pages that have search value. Skip utility pages.Include selectively. Confirm test, staging or utility pages are disabled before generation.
Image entriesAdds product image URLs to product entriesOptional. Useful if product image search matters to your sales.Adds file size and generation time across many products. Enable only where image search is a goal.
File size and URL limitsMaximum URLs and size per file before the sitemap splitsDefaults are rarely reached. Confirm the values are set in admin.Lower limits create more files per view. Confirm values against the sitemap protocol limits in your version.
Generation time and file countHow long cron takes to rebuild all files for each viewShort run with few files. Check the cron log after the first build.Longer run and more files for each view. Schedule off-peak and monitor cron duration per view.
Sitemap file pathLocation of the generated file for each store viewOne path, referenced in robots.txt. Confirm the path resolves publicly.One file per view. Confirm each file is referenced in the robots.txt for its own website.

How cron, the sitemap generator and robots.txt connect

The diagram starts at a decision: generate sitemaps on schedule through the cron job runner, or on demand from the admin generate action. Both paths reach the sitemap generator, which runs once per store view and writes sitemap files to the configured sitemap directory. The Sitemap line in the robots.txt for that website then points crawlers to those files. Check each step: the cron job must run on the server, each store view must have its own generated file, and the robots.txt Sitemap line must name the correct file for that website.

Scheduled and manual sitemap runs both feed the same files that robots.txt advertises.

How to configure and generate sitemaps per store view

This sequence takes a Magento Open Source store from a cron check through per-store-view sitemap settings, a first generation, file and URL checks, and a robots.txt entry for each website. The result is a set of sitemap files that match the catalog and are reachable by search engines.

  1. Confirm cron is running before generating

    Start by checking that the cron jobs Magento Open Source depends on are scheduled and executing on the server that hosts the store, because scheduled sitemap regeneration runs through cron. Whoever administers the server or hosting platform should confirm the cron entry for the Magento user and review the cron log for recent runs. Confirm the exact commands and log locations for your version in the Adobe documentation, since they change between releases. The step is done when a scheduled job has run recently and left no errors in the log.

  2. Set sitemap options for each store view

    In the Admin, the store owner or developer opens the sitemap configuration and sets values for each store view that will publish a sitemap, including the file path, file name pattern and any limits on file size or number of URLs. Decide whether image entries and product and category inclusion should be enabled for each view, since each store view can have different catalog visibility and language. Record the chosen values in the change log so the settings can be reviewed later. The step is done when every store view you plan to publish has its own saved settings.

  3. Run the first sitemap generation

    Generate the sitemap manually from the Admin for each store view, or run the scheduled job once, so that a first set of files exists on disk. Watch the Admin message area and the log for errors, since a timeout on a large catalog usually shows up here first. Note the generation time and the number of files created for each view. The step is done when every configured store view reports a successful generation and its files appear in the configured directory.

  4. Compare generated URLs with the catalog

    Open the generated sitemap index and the files it lists, then compare the URL count against the number of enabled, visible products and categories in the catalog for that store view. Expect differences where disabled items, out-of-stock items or items hidden from the catalog are excluded by your settings, and investigate any gap that your settings do not explain. Sample several URLs from each file and confirm they open the correct product or category page in the right store view. The step is done when the counts reconcile to a documented explanation and the sampled URLs resolve.

  5. Confirm files return HTTP success

    Request the sitemap index and each sitemap file directly in a browser or with a command-line HTTP client, and confirm each returns a successful response with the expected XML content type. Check that no file is blocked by a web server rule, a redirect loop or an authentication layer, since search engines will fail on any of these. Repeat the check for every store view, because each view can publish a different path. The step is done when every file returns a success response and parses as valid XML.

  6. Confirm robots.txt points to the correct file

    Open the robots.txt served for each website and confirm it contains a sitemap line that points to the index file for the store views on that website. A common mistake is pointing every website at one sitemap or leaving the line out after a theme or domain change. Request the referenced URL and confirm it returns the same content you checked in the previous step. The step is done when each website's robots.txt references the correct sitemap and that URL resolves.

  7. Submit sitemaps and schedule regular checks

    Submit the sitemap index for each domain in the search engine webmaster tools that your team uses, and record the submission date and owner. Set a recurring review that re-runs the URL count comparison and HTTP checks after catalog imports, domain changes or major releases. Ask your hosting or implementation partner to confirm the review interval and ownership in writing as part of the operations plan. The step is done when each domain has a submitted index and a named owner for the recurring check.

Limits to confirm before relying on generated sitemaps

Generated sitemaps look finished once the file appears, but their limits depend on your Magento version, catalog size, theme and hosting layout. The cards below list the questions to answer with Adobe's documentation or a test store before you rely on the output for search engines.

File size and URL count ceilings

Ask what maximum file size and URL count your version applies to a single sitemap file, and whether Magento splits larger catalogs into a sitemap index. Confirm the exact ceilings for your release line in the vendor documentation rather than assuming the search engine limits apply unchanged. Then generate a sitemap from a copy of your full catalog and count the entries in each file to confirm the split behaves as expected.

Released versions

Generation time as the catalog grows

Ask how long sitemap generation runs on a catalog of your size, and whether it blocks other cron jobs or competes with indexers on the same host. Generation time rises with product count, store view count and image entries, so a test run on a realistic catalog is more useful than a demo store. Record the duration and schedule the job outside peak traffic.

Disabled and out-of-stock products

Ask whether the generator includes disabled products, products not visible in the catalog, and out-of-stock items, and whether that depends on your stock display settings. Including unavailable products sends crawlers to pages that do not sell, which can waste crawl budget. Compare a generated file against your enabled, in-stock product list to see exactly what is included.

Shared domains across websites

Ask how a sitemap behaves when several websites or store views share one domain, and whether each store view writes its own file under a path that does not overwrite another. Confirm that the robots.txt reference points to the right file for each store view. A mismatch here can submit one store's URLs under another store's host.

Image entries and theme support

Ask whether image entries are written for your theme, since image output depends on how product media is rendered on the storefront. Custom themes may change image paths or omit the gallery markup the generator reads. Check a generated file against live product pages and confirm the image URLs resolve publicly, not only on an internal address.

Multi-node storage behavior

Ask where generated files are written on a multi-node layout and whether every web node sees the same file through shared storage. If each node writes its own copy, the sitemap served to crawlers can differ between requests, and a cron job on one node may leave others stale. Confirm the write location, the cron host, and the file path served by your load balancer before launch.

Choosing a sitemap approach by store setup

One store view on one server is the simplest case. The sitemap covers a single scope, and the generated files are written to a directory on the same host that serves the storefront. Cron runs on that host alongside the web process, so generation and serving depend on one machine.

  • Generation scope: Enable the sitemap for the single store view and confirm the base URL in the store configuration is correct before generating, because the URLs written into the file come from that configuration.
  • File location: Set the output path in the sitemap settings and confirm the web server serves the file at the address that robots.txt will reference.
  • Cron placement: The scheduled generation job must run on the host that holds the store's cron schedule, and the system user running cron needs write access to the target directory.
  • File ownership: After a manual run, check the owner and permissions of the generated file, since a file written under a different user can block the next scheduled run.

Before launch, trigger a manual generation, open the file in a browser, spot-check product, category and CMS page URLs, then wait for one scheduled run and confirm the file's timestamp changed.

Submitting sitemaps through robots.txt

robots.txt is the one file every compliant crawler checks before it fetches anything else, which makes it the natural place to advertise where the generated sitemap lives. Adding a Sitemap: line pointing at the sitemap URL lets crawlers discover the file without anyone registering it manually. In Magento Open Source, the sitemap is generated per store view, so each sitemap URL should be the absolute address of the file as it is served from the storefront domain, not a path on a development or staging host. Confirm the exact file name and path that your configuration produces after generation, because a sitemap that is written to disk but served from a different path will be advertised incorrectly.

The Sitemap: directive belongs to the robots.txt file of the website that serves the URLs listed in the sitemap. Magento Open Source keeps robots.txt configuration per website, so a store with several websites, each on its own domain, needs a robots.txt per domain with a directive that points only to sitemaps for that domain. Crawlers treat sitemap URLs on another host with suspicion, and a directive that names a foreign domain may be ignored. Map your domains, websites and store views to sitemap files before launch, then check each domain's served robots.txt in a browser. Store views that share a domain and differ only by path or code need an agreed list of which sitemap files the shared robots.txt should advertise.

Relying on robots.txt alone is cheap and keeps the discovery path in version-controlled configuration, but it gives you no confirmation that a search engine has read the file, fetched the sitemap or reported errors. Submitting the same sitemap URLs in each search engine's webmaster tools adds that feedback loop, including fetch status and URL counts, and it lets you resubmit after a large regeneration. The cost is ongoing: someone must own the search console accounts, verify each domain, and check the reports after releases. Ask your team or partner to name who holds those accounts and how verification is kept when domains or store views change.

Security and operational risks of exposing sitemaps

A sitemap is a public, machine-readable list of the URLs you want search engines to find, so every entry and every file write matters. The cards below cover what can leak through the sitemap, what happens when generation stops, and what the web server and host must allow and track.

Unpublished URLs in the sitemap

A sitemap lists whatever the generator includes, so disabled products, hidden categories, and out-of-stock or staging-only pages can appear in a public file if their status is not checked. Anyone can read the file, so it reveals catalog structure to competitors even when the pages themselves are not linked. Before launch, confirm that the store view you generate for includes only enabled, visible entities, and compare a sample of the output against the admin catalog. This check should be repeated after catalog imports.

Admin and staging paths in output

Misconfigured store views, base URLs, or a staging copy of the site can cause admin or non-production hostnames to be written into the sitemap. Search engines may then crawl and index paths you meant to keep private. Check each generated file for admin route segments, test domains, and unexpected hostnames, and confirm that the base URL for every store view matches its public domain. Treat any mismatch as a release blocker.

Stale files after cron failure

Sitemap generation runs on a schedule, so a failed or paused cron job leaves the previous file in place while the catalog keeps changing. New products will not be discoverable, and deleted products will still be listed. Confirm that the cron group that generates sitemaps is in the schedule of the web and CLI user, and record the last generation time for each file. Review your cron setup with the documented commands in the Magento operations guidance before go-live.

Write permissions on the sitemap directory

Generation writes files into a directory the web server serves, so that directory needs write access for the process that runs generation and read-only access for the web server. Broad permissions such as world-writable directories let other processes or users replace the sitemap with arbitrary content. Verify ownership and mode on the sitemap directory after each deployment, and confirm that the deployment pipeline does not reset them. Restrict write access to the single account that runs cron.

Disk growth from repeated generation

Each generation run can create new files, and sitemaps for large catalogs are split into multiple files, so repeated runs without cleanup grow the sitemap directory over time. The directory then competes with logs and media on the same volume. Measure the size and file count of the sitemap directory after the first full run, set a monitoring threshold on that volume, and confirm that old files are replaced rather than accumulated in your configuration.

Monitoring that confirms cron ran

A scheduled job can exit with errors, be skipped during a maintenance window, or stop when the host is replaced, and nothing will alert you unless you watch for it. Monitor the modification time of each sitemap file and the cron job's log output, and alert when a file is older than your expected regeneration interval. Include a check that the sitemap URL returns the expected status code and a current file, since a file can exist but be out of date.

What buyers ask before setting up sitemaps

How much effort does a Magento sitemap setup take?

Effort depends mostly on how many store views and websites the store runs, how large the catalog is, and whether custom URLs or non-catalog pages must appear in the sitemap. A single store view with a modest catalog is a short configuration task. Each additional store view needs its own sitemap path, base URL check and test, and a large catalog raises the cost of generation and verification. Multi-node layouts add work because cron and file storage must behave consistently across nodes. Ask any partner to list each store view, each custom URL source and each node before quoting.

Can an in-house team set up Magento XML sitemaps alone?

Yes, a team with Magento administration experience can configure sitemap generation per store view, set file limits and enable image entries using the admin panel. The harder parts are verifying the output against the live URLs, confirming that the cron jobs that build the files actually run, and checking that robots.txt points to the right file for each store view. If your team has no one who can read cron logs or inspect generated XML, plan for outside help on verification even if configuration stays in-house.

What access and environments does a sitemap project need?

The work needs admin rights to the Magento Stores configuration, shell or scheduler access to run and monitor the cron group that generates sitemaps, and write access to the web root or the storage location used for the files. A staging store that mirrors production configuration lets you test file limits and image settings without publishing unverified sitemaps. You also need a verification plan that names the URLs to check, the tools used to read the XML and the people who approve the change.

How long does it take to confirm sitemap results?

Confirmation has two stages. First, you confirm internally that the sitemap files were generated, that each store view points to the correct files, and that the URLs inside match live pages. Second, you confirm that search engines have fetched and processed the submitted sitemaps, which depends on their crawl schedules and cannot be set by the store. Check your search console tools after launch and record the dates of fetches. Ask any partner to state which of these checks it covers and what evidence it will hand over.

What recurs after a sitemap goes live?

Sitemaps need ongoing attention. Cron must keep running, because a missed generation run leaves stale files that list removed products or omit new ones. Catalog growth, new store views and changed URL formats all require regenerating and rechecking the files. Platform upgrades and patch releases can change configuration paths or cron behavior, so re-verify after each upgrade. Budget for monitoring of the cron group and periodic spot checks of the XML.

Which Magento versions and Adobe support dates should I check?

Confirm your store runs a 2.4.x release that is still within Adobe's standard support window before you invest in SEO configuration, because sitemap behavior is part of the platform you must keep patched. Adobe's lifecycle policy lists end-of-regular-support dates for each release line, and the released versions page lists current patch releases. Check the lifecycle policy and the upgrade guide, then decide whether an upgrade should come before or after sitemap work.

What should I ask a partner for in a fixed-scope quote?

Ask for a written scope that lists every store view and website in scope, the catalog size used for planning, each custom URL source, the cron and hosting topology, and the staging and verification steps. The quote should name the deliverables, such as configuration records, test results and a handover note for cron monitoring, and state what happens after launch. Ask how changes to scope are priced and who performs retesting after upgrades. A fixed-scope agreement makes these items reviewable before work starts.

How DeployOpen works on this

DeployOpen plans and implements sitemap generation for your Magento Open Source store inside your own infrastructure. We begin with a written scope that fixes the store views, catalog sources and cron setup before any configuration changes are made.

How we scope

  • Inventory every store view and the sitemap entries each one needs, including product, category, CMS page and image entries.
  • Confirm file size and URL count limits, the public path for each sitemap file, and where the files will be served from.
  • Agree in writing how cron runs the sitemap generation job, who owns the schedule, and how failed runs are reported.

How we build

  • Configure sitemap settings per store view in the admin, then test generated files against the robots.txt entries for each domain.
  • Check that generated sitemap URLs match canonical product and category URLs and do not point to filtered or excluded pages.
  • Verify image entries and sitemap sizes on a staging copy of your catalog before the first production generation.

How we hand over

  • Deliver a configuration record listing each store view setting, cron entry, file path and robots.txt reference used in production.
  • Provide a runbook for regenerating sitemaps, reading cron logs and resubmitting files after a catalog or domain change.
  • Walk your SEO and operations staff through the checks so they can confirm each sitemap after future theme or catalog changes.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer that covers sitemap checks after Magento patch releases.
  • Retainer scope, response expectations and review frequency are agreed in writing before the retainer starts.
  • Ask us to confirm the retainer terms and what a sitemap review includes before you sign any statement of work.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.