Magento Sitemap XML
A Magento Sitemap XML is an XML file that lists your store's URLs so search engines can discover and crawl them more efficiently.
Key facts
- In Magento 2, sitemap creation is managed from the Admin under Marketing > SEO & Search > Site Map.
- Adobe Commerce documentation says the sitemap file is commonly created with filename sitemap.xml and path /media/.
- Sitemap generation settings can control what content types are included and how often the sitemap updates.
- Sitemaps are especially useful for large catalogs, stores with frequent product changes, and multi-store setups.
Also called
XML Sitemap Magento, Magento 2 Sitemap, Store sitemap
Use it for
Improving crawler discovery of store pages
Applies to
Google, Bing, and other search engines that support sitemaps
Creating a Sitemap in Magento 2
In Magento 2, you can generate a sitemap from the Admin panel. Navigate to Marketing > SEO & Search > Site Map. Click Add Sitemap and enter a filename like sitemap.xml. Then Save & Generate.
The file is typically saved in the /media/ directory, but you can customize the path. After generation, the sitemap URL will be something like yourdomain.com/media/sitemap.xml. Remember to link to the sitemap in your Robots.txt file.
Configuring Sitemap Settings
From Stores > Configuration > Catalog > XML Sitemap, you can control which content types appear. You can include products, categories, and CMS pages. You can also set the frequency and priority for each type.
For multi-store setups, you may need separate sitemaps per store view. Set the correct store scope in configuration. Sitemaps help manage crawl budget. They also help avoid issues with faceted navigation SEO.
Submitting the Sitemap to Search Engines
Once generated, submit the sitemap to Google Search Console. Add your sitemap URL under the Sitemaps section. Google will show if any errors exist.
For Bing, use Bing Search Console to submit the same URL. Keep the sitemap updated automatically by scheduling regeneration in Magento.
Common Mistakes and Best Practices
A common mistake is failing to submit the sitemap to Google Search Console. Without submission, the file may not be discovered. Another mistake is using the wrong path for multi-store views, leading to missing URLs.
Avoid assuming a sitemap guarantees indexing. It is a hint, not a command. You can use tools like Moz Sitemap to validate your file. Always test your sitemap.xml for errors.
Common mistakes
- Not submitting the sitemap to Google Search Console Search engines may not discover the file, reducing crawl efficiency.
- Using the wrong path or store view The sitemap may serve incorrect or incomplete URLs in multi-store setups.
- Assuming a sitemap guarantees indexing Pages can still be left out of the index if other factors block them.
Questions
How to generate a sitemap in Magento 2?
Go to Marketing > SEO & Search > Site Map, click Add Sitemap, enter a filename like sitemap.xml, choose a path, and click Save & Generate.
Why is my Magento sitemap not showing in Google?
Make sure you have submitted the sitemap URL in Google Search Console. Also check that the file is accessible and contains no errors.
Where is the sitemap file located in Magento?
By default, Magento saves the sitemap in the /media/ directory. The exact URL depends on your configuration and domain.
See also
- Crawlability IssuesCrawlability issues are technical problems that stop search engine bots from finding and readin…
- SEO IndexingSEO indexing is the process where a search engine stores and organises a crawled page in its da…
- Canonical TagA canonical tag is an HTML element that tells search engines which URL is the master version wh…
- Submit Website to Search EnginesSubmitting a website to search engines means telling them your site exists, usually by verifyin…
- Canonical ErrorA canonical error happens when search engines cannot tell which URL is the preferred version of…
- Canonical URLA canonical URL is the preferred web address you want search engines to treat as the main versi…
Sources
- Adobe Commerce documentation experienceleague.adobe.com
- Google Search Central - Sitemaps overview developers.google.com
- Google Search Console Help - Submit sitemap support.google.com
- MageWorx - Magento 2 Sitemap Setup mageworx.com
Outbound links are unpaid and nofollow. If one has gone stale, tell me.