Sitemaps are structured lists of all URLs on your website with a list of their parameters. The main function of a sitemap is to make it easier for search engines to understand and index the content of your website. A website sitemap is also a useful tool in case you want to ensure that Googlebot is able to see all the content that you have on your website. Fortunately, the majority of CMS systems enable the site owners to generate one.
There are up to six different types of sitemaps, but HTML and XML are two sitemaps that are commonly used. In this article, we will point out their importances and how to generate them in Magento 2.
HTML sitemap

In simple terms, an HTML sitemap is an outlined text version of the site navigation on one page. This type of sitemap is essential for any kind of website, whether it is eCommerce, non-profit, blog, or entertainment website. HTML sitemap performs an important function in making it easier for some users to navigate through the website since all the resources they might need are quickly accessible.
The importance of HTML sitemap
The greatest HTML sitemap benefit is that it is a great way to have a clear overview of the website and all its pages. This makes the sitemap a reliable navigation tool. It is also available any time at the website footer. In most cases, providing a proper HTML sitemap will improve the user experience. And thus it has an impact on your website’s ranking.
Furthermore, promoting your online presence, this type of sitemap is valuable. Because the page has search engines will read in order to understand and index your website among the others. Search engine optimization is especially helpful for websites with dynamic content. Especially when the information on the website is new and does not have many links to it. Or when some articles contain a lot of content while being not properly linked.
XML sitemap

An XML sitemap is a text file used to detail all URLs on a website. It can include extra data on each URL, including the information addressing its latest update, its priority level, the average frequency of changes that occur, the URLs related to the rest of the site, and whether there are any other versions of the same URL in other languages. According to Google documentation, XML sitemaps are useful for websites with large archives or a large volume of media content, although, in our opinion, even if your website does not match these characteristics, it will still largely benefit from having a sitemap.
The sitemap protocol format contains XML tags and should:
- Begin with <urlset> opening tag and end with </urlset> closing tag.
- Include a <url> entry for URLs as a parent XML tag.
- Specify the namespace (protocol standard) inside the <urlset> tag.
- Include a <loc> child entry for <url> parent tags.
Other tags are optional and their support may vary from search engine to search engine. So, before including any of those optional tags, consult the documentation for each search engine.
Why XML sitemaps are important?
Creating sitemaps is especially useful for SEO. An XML sitemap is designed for search bots, and an updated XML file can be used to ping search engines, alerting them of changes and updates. An XML document lets search engines know that there is fresh new content. Having a well-built XML sitemap substantially increases your chances of having your web pages crawled. It is also indexed by search engines, particularly if the navigation system of the website does not work properly. Or general internal linking strategy doesn’t provide links to all of your pages.
If your website is international or has the same page translated into different languages, the XML sitemap can be used for the purpose of sorting the content for the search engines. The sitemap will be able to signal the crawlers that the page has multiple versions. And they will use this information to make sure that the users will be provided with the correct version of the website, based on their language or location.
What is the difference between an HTML and XML sitemap?

Since the article is dedicated to two sitemaps, it is important to understand clearly the difference between both of them. So, this paragraph is dedicated to the HTML sitemap vs XML sitemap comparison.
HTML and XML sitemaps have different uses and values for search engine optimization. The main difference between HTML and XML sitemaps is that HTML sitemaps are written primarily for the users and are needed most to help them to gain a comprehensive understanding of a website. And XML sitemaps are written first of all for search engines.
HTML sitemap is rather a general overview of the website, the pages, and the information. These could be useful to the user. While being used mostly by the visitors of a website, it can also assist the search engine ranking.
In a nutshell, XML is primarily created to facilitate the functionality of the search engines, providing them with all the necessary information regarding the structure of the website.
How to generate a Magento 2 sitemap
In order to generate a sitemap in Magento 2 you’ll need to go through the following process:
Step 1: Log in to your Admin account and proceed to Stores →Settings→ Configuration → Catalog→ XML Sitemap. Edit the necessary settings for the Categories Options, Product Options, and CMS Pages Options:

Step 2: Open the Generation Settings, change their status to Enable, choose a Start Time you would like search engines to crawl your pages from, select the crawling frequency, and enter the Error Email Recipient and Error Email Sender. The Error Email Template field may be left with its default value:

Step 3: Specify the Maximum Number of URLs Per File and Maximum File Size limits in the section called Sitemap File Limits:

Step 4: After configuring the Sitemap File Limits settings, proceed further by expanding the Search Engine Submission Settings menu and set the corresponding value of Enable Submission to Robots.txt field to Yes. Click the Save Config button to save all the changes we’ve made so far:

How to generate a sitemap in Magento 2 manually
If you don’t have a cron job set up for your site and would like to generate a sitemap for it, consider creating a sitemap in Magento 2 manually.
Go through these steps for a manual set-up process:
Step 1: Open the Sitemap setting page by navigating to Marketing → SEO & Search → Site Map and click the Add Sitemap button:

Step 2: Enter the necessary values for your Filename, specify the Path and choose the most appropriate Store view. Click Save if you would like to only add a new sitemap without generating it. Alternatively, hit the Save & Generate button in case you’ll need a later operation as well:

Step 3: Once you’ve chosen your preferred option, copy the generated Link for Google and submit it to the appropriate section of your Google Webmaster Tools account:

Final Words
XML and HTML sitemaps are useful tools that any Magento 2 store should have. While an XML sitemap can enhance SEO performance, an HTML sitemap can improve user experience. We hope this blog post has supported you to do those. If any part makes you feel not understood, leave your comment on our website, or send your question via our contact form. And if you apply this tool in an easy way for your store, you can visit the Magento Website Development service to know more information.