How to Create Magento 2 XML Sitemap

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, sitemap immediately informs search engines about any update or changes in the website.

Now you know the advantages of Magento 2 XML Sitemap, also learn how to create it!

Configure Magento 2 XML Sitemap

  1. Configure the Frequency and Priority Values
  2. Configure the Generation Settings
  3. Configure the Sitemap File Limits
  4. Complete the Search Engine Submission Settings

Now I will explain each of the above steps elaborately.

Steps to Create Magento 2 XML Sitemap

    1. Login to your Admin Panel
    2. Go to Stores-> Configuration
    3. Select ‘XML Sitemap‘ under Catalog
    4. Choose ‘Categories options
    5. Configure the value of ‘Frequency‘  from the drop-down menu and ‘Priority‘ from 0.0 to 1.0.
    6. Under the ‘Products Options,’ configure the frequency and priority values same as above.
    7. Choose Add Images to Sitemap -> All from the drop-down menu to attach an image to the Sitemap
    8. Configure the frequency and priority values once again in the ‘CMS Pages Option.’
    9. Click ‘Save ConfigHow to Create Magento 2 XML Sitemap 1
  1. Under the ‘Generation Settings‘ section, configure the below fields:
    1. Enabled: Set “yes.”
    2. Start Time: Input the hour, minute and second that update the sitemap.
    3. Frequency: Set to daily, weekly or monthly from the drop-down menu.
    4. Error Email Recipient: input the email address that is supposed for receiving the notification emails regarding the errors at the time of sitemap update.
    5. Error Email Sender: Choose the email sender from the drop-down menu.
    6. Error Email Template: Select the template for the error notification from the drop-down menu.How to Create Magento 2 XML Sitemap 2
  2. Under the ‘Sitemap File Limits‘ and configure the below fields,
    1. Maximum No of URLs Per File: Enter the limit of the number of URLs per file
    2. Maximum File Size: Enter the limit of file size in bytesHow to Create Magento 2 XML Sitemap 3
  3. Under the ‘Search Engine Submission‘ section,
    1. Enable Submission to Robots.txt: Set “YES”  to provide instructions to search engines that crawl your site by using a robots.txt file.
    2. Save Config: Click to save your configuration.How to Create Magento 2 XML Sitemap 4

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 Webmaster Tools. For example, https://meetanshi.com/sitemap.xml

Having a thorough sitemap is the key to the maintaining 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 🙂

5
(based on 2 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply