How to Create Magento 2 XML Sitemap
XML Sitemap is a text file that contains the list of URLs, their metadata, and website structure.
XML Sitemap is helpful to Google and other search engines to easily understand the website structure and find the pages of your website. In Magento 2, XML Sitemap is an enhanced feature! Improve your website’s SEO with Magento 2 XML Sitemap. Moreover, ease the navigation of your website for new visitors and improve the user experience. Also, a sitemap immediately informs search engines about any updates or changes on the website.
Now you know the advantages of Magento 2 XML Sitemap, also learn how to create it!
Or, you can even install Magento 2 Google Sitemap extension that generates the XML and HTML sitemaps and leverage its benefits.
Configure Magento 2 XML Sitemap
- Configure the Frequency and Priority Values
- Configure the Generation Settings
- Configure the Sitemap File Limits
- Complete the Search Engine Submission Settings
Now I will explain each of the above steps elaborately.
Steps to Create Magento 2 XML Sitemap
- Configure the Frequency and Priority Values
- Login to your Admin Panel
- Go to Stores-> Configuration
- Select ‘XML Sitemap‘ under Catalog
- Choose ‘Categories options‘
- Configure the value of ‘Frequency‘ from the drop-down menu and ‘Priority‘ from 0.0 to 1.0.
- Under the ‘Products Options,’ configure the frequency and priority values the same as above.
- Choose Add Images to Sitemap -> All from the drop-down menu to attach an image to the Sitemap
- Configure the frequency and priority values once again in the ‘CMS Pages Option.’
- Click ‘Save Config‘
- Configure the Generation SettingsUnder the ‘Generation Settings‘ section, configure the below fields:
- Enabled: Set “yes.”
- Start Time: Input the hour, minute and second that update the sitemap.
- Frequency: Set to daily, weekly or monthly from the drop-down menu.
- Error Email Recipient: input the email address that is supposed for receiving the notification emails regarding the errors at the time of sitemap update.
- Error Email Sender: Choose the email sender from the drop-down menu.
- Error Email Template: Select the template for the error notification from the drop-down menu.
- Configure the Sitemap File LimitsUnder the ‘Sitemap File Limits‘ and configure the below fields,
- Complete the Search Engine Submission SettingsUnder the ‘Search Engine Submission‘ section,
- Enable Submission to Robots.txt: Set “YES” to provide instructions to search engines that crawl your site by using a robots.txt file. If your site is missing a robot.txt file create one now and configure this setting.
- Save Config: Click to save your configuration.
Once you have created Magento 2 XML Sitemap, you can retrieve it using example.com/sitemap.xml URL and verify it with the search engine using Google Search Console. For example, https://meetanshi.com/sitemap.xml
Having a thorough sitemap is the key to maintaining a successful website. So, Improve the SEO and let Google crawl your pages faster!
I’d be pleased to solve any doubts you face in creating Magento 2 XML Sitemap for your Magento 2 store. Do let me know in the comments section.
Enjoy better rankings 🙂
Related Post: Magento 2 SEO Guide
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
2 Comments
Hello,
I have setup the site map in M2 as described above.
Am i to see the date change every day in M2 Marketing > Sitemap “Last generated” as i see the same date and time every day.
What am i missing?
Brian
Hello,
You may have missed setting up the cron.
Thanks.