Skip to content

Creating an XML sitemap ​

An XML sitemap lists your store's pages so search engines — and AI search crawlers — can discover and index them. Magento can generate one and keep it up to date for you, from the admin.

Add the sitemap ​

In your store's admin:

  1. Go to Marketing → SEO & Search → Site Map, and click Add Sitemap.
  2. Filename: sitemap.xml
  3. Path: /media/ — this matters; see below.
  4. Choose your Store View, click Save, then click Generate.

Your sitemap is then available at https://your-store/media/sitemap.xml.

Why the path must be /media/ ​

Your store runs in a managed hosting environment where, for security, the application can only write to a few designated locations — and the /media/ folder is the one that is both writable and publicly served. If you leave the Path as the default /, Magento will report the sitemap as "generated", but the file isn't placed anywhere the web can serve it, so the URL returns "not found". Setting the Path to /media/ puts it where it can actually be reached. (This is the standard sitemap path for Magento on cloud/managed hosting.)

Keep it fresh and tell search engines ​

  • Stores → Configuration → Catalog → XML Sitemap → Generation Settings: set Enabled = Yes with a daily frequency, so the sitemap rebuilds automatically.
  • In Search Engine Submission Settings, set Enable Submission to Robots.txt = Yes — your robots.txt will then point crawlers at the sitemap for you.
  • Submit the sitemap URL (https://your-store/media/sitemap.xml) in Google Search Console and Bing Webmaster Tools.