How to generate XML and HTML Sitemaps in Magento 2

In Magento 2, you can generate XML and HTML sitemaps using the built-in functionality. Here are the steps to generate XML and HTML sitemaps in Magento 2:

  1. Log in to the Magento 2 admin panel.
  2. From the admin panel, go to Content > Elements > Sitemap.
  3. To generate an XML sitemap, click on the “Add Sitemap” button.
  4. In the “Add Sitemap” page, enter the name and description of the sitemap. Then, select “XML” as the type.
  5. In the “Store View” section, select the store view for which you want to generate the sitemap.
  6. In the “Generation Settings” section, select the frequency and priority for the sitemap. You can also select the categories, products, and CMS pages to include in the sitemap.
  7. Once you have set up the sitemap options, click on the “Save & Generate” button to generate the XML sitemap.
  8. To generate an HTML sitemap, click on the “Add Sitemap” button again.
  9. In the “Add Sitemap” page, enter the name and description of the sitemap. Then, select “HTML” as the type.
  10. In the “Store View” section, select the store view for which you want to generate the sitemap.
  11. In the “Generation Settings” section, select the categories, products, and CMS pages to include in the sitemap.
  12. Once you have set up the sitemap options, click on the “Save & Generate” button to generate the HTML sitemap.
  13. After the sitemaps have been generated, you can view and download them by clicking on the “Manage Sitemap” button.

That’s it! You have successfully generated XML and HTML sitemaps in Magento 2. These sitemaps can help improve your website’s search engine optimization (SEO) by providing search engines with a clear and organized view of your website’s content.