Generate XML and HTML Sitemaps in Magento 2

How to Generate HTML and XML Sitemaps in Magento 2?

Today, we’re going to teach you guys how to generate HTML and XML sitemaps in Magento 2.

Sitemaps are one of the most essential elements for every website. They help to achieve great visibility in the search engines.

And in this article, we will show you guys how to generate both HTML & XML sitemaps in your Magento 2 store.

What is a Sitemap?

A sitemap is basically a navigation tool containing links to all resources on a website or blog. In simple words, it gives an overview of a website’s structure as well as the content.

And just like any other platform-based websites, Magento 2 websites can generate both HTML & XML sitemaps.

What is HTML Sitemap?

HTML sitemaps basically help users easily explore a website and find the desired content more effectively.

It is generally placed in the footer of the website and displays the entire navigation of your website in an outline text version. In other words, it serves as a geographical map for users and helps them quickly find what they’re looking for.

Now, if you have an extensive website with thousands of pages, products, categories, HTML sitemap will be overloaded and confusing.

So, in this case, you should restrict the sitemap of your website to only the most important pages like main pages, categories and relevant subpages.

And if you’re planning to create an HTML sitemap of your website, make sure that it is neatly-organized, user-friendly, and quickly loaded without any complications.

What is XML Sitemap?

XML Sitemaps help search engines understand a website’s structure and index its web pages better.

An XML-based sitemap is basically a plain-text file that contains all URLs along with additional metadata of each URL.

XML sitemaps are generally submitted to search engines like Google to guide its crawlers what pages are available for indexing and how to reach them on a specific website.

Now, if you’re planning to create an XML sitemap for your website, make sure that it does not contain more than 50,000 URLs and its uncompressed file size does not exceed 50 MB.

Magento 2 Development Services

How to Generate HTML Sitemap in Magento 2

Follow below steps to generate HTML sitemap in Magento 2.

Step 1. First of all, open the admin panel and go to the Configuration section.

Step 2. Next, click on the SEO tab from the list.

Step 3. Now, you’ll see a screen as shown in the screenshot below.

HTML Sitemap Save Config

Here, you can create three types of HTML sitemaps:

  • Categories Sitemap
  • Pages Sitemap
  • Products Sitemap

Step 4. Now, follow the below given steps to generate HTML sitemap for your Magento 2 website.

  • Select Yes in the Enable HTML Sitemap field.
  • Select Yes in the Enable Categories Sitemap field to display all category pages.
  • Select Yes in the Enable Products Sitemap field to display all product pages.

Step 5. If you have lots of links that cannot be inserted automatically in the HTML file, select Yes in the Enable Additional Links field.

Step 6. Next, add all your additional links in the Additional Links field.

Step 7. After that, select Yes in the Add Sitemap Link to Footer field.

Step 8. Lastly, once you’re done with all these configurations, click on the Save Config button and check the output.

HTML Sitemap Save Config

Now, when your website visitors will click on the Sitemap link in the footer of your website, they’ll be able to see the entire overview of your website like below.

HTML Sitemap in Front-end

How to Generate XML Sitemap in Magento 2

Apart from HTML sitemap, Magento 2 also comes with built-in feature to generate XML sitemap.

Follow below steps to generate XML sitemap in Magento 2.

Step 1. First of all, open the admin panel and navigate to MageDelight > Sitemap > Sitemap Configuration.

Navigate to Sitemap Configuration

Step 2. Next, in General Settings Select “Yes” to enable Google XML sitemap generation

Step 3. After that, write a path in the Path field to define where it will be located.

Step 4. Then, Select frequency to generate XML sitemap. You can select either daily, weekly, or monthly from given options.

Step 5. Next, Select time to generate XML sitemap automatically.

Step 6. After that, click to generate XML sitemap manually to create your XML sitemap.

Step 5. Then, click to download XML sitemap manually to download your XML sitemap.

XML Sitemap Configurations

Once you’ve finished the above steps, you can see the generated sitemap.


That’s about it!

This is how you can generate HTML and XML sitemaps in your Magento 2 store.

We hope that you found this tutorial helpful. If you have any queries, please ask them in the comments below.

You can get our Magento 2 XML & HTML Sitemap Extension to add sitemaps in your Magento 2 store with ease.

Check our Front and back-end demos to explore more exciting features of our Magento 2 XML & HTML Sitemap Extension.

Also, you can refer this Magento 2 XML & HTML Sitemap Extension’s FAQ Page for most common questions and it’s answers.

And if you need our professional assistance, feel free to contact us anytime.