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 in Magento 2?
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 XML Sitemap in Magento 2?
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.
What is HTML Sitemap in Magento 2?
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.
How to Generate XML Sitemap in Magento 2?
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.
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, it will automatically add the xml sitemap in your Magento 2 store.
Once you’ve finished the above steps, you can see the generated sitemap.
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.
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.
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. Here is the MageDelight’s HTML Sitemap. As you can see how we have included our pages in it which serves as a user-friendly directory for visitors.
Also read: How to Set Up & Configure Robots.txt in Magento 2?
Conclusion
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.