Magento how to generate Sitemap

Building a sitemap is one of the best ways for your web store to communicate with search engines quickly and accurately. It’s not the only way that search engines can detect pages on your site, but it’s your “direct line” to let Google understand the website structure.

1. What is a Sitemap?

The sitemap is a file created for the purpose of providing information about the pages, videos, and other files on your website and the relationship between them. It can have multiple formats such as XML (Extensible Markup Language ), RSS (Really Simple Syndication), and Text. This article only discusses the XML format, which is also the most popular format.

2. Do you Need a Sitemap?

You won’t need a sitemap if you have a small site (<100 URLs) and all the URLs are internally linked. But if you have a fairly large website with thousands or even millions of URLs, having a sitemap will benefit you greatly. With the help of a sitemap, you can point out the important pages for the search engine to crawl.

3. how can generate a Google XML Sitemap in magento

Generate an XML Sitemap with Magento admin

First, login to Admin Panel then go to Marketing > Seo & Search > Site Map and click button Add Sitemap

Magento 2 generate a Google XML Sitemap
Magento 2 generate a Google XML Sitemap form

After filling all the information and then click save then you can see it in the gird.

Magento 2 generate a Google XML Sitemap gird

Now every time, you want to update XML Sitemap you just have to click Generate.

In addition, Magento also allows you to set up the automatic generation of XML Sitemap by Cron.

Now, go to Stores > Configuration > Catalog > XML Sitemap then Enabled Generation Settings

Magento 2 generate a Google XML Sitemap cron

2. Submit XML Sitemap to google search console

Finally, provide your sitemap to Google. To do this, you can add a link to it in your robots.txt file or submit it directly to Google using Search Console.

Note: You only set up auto-generate files if you want all the website’s urls to be indexed by google. Check the file before sending to remove some links such as Privacy Policy, Terms & Conditions…

Ok now you know how to generate a Google XML Sitemap in Magento 2. In the next posts we will learn how can add Google Analytics 4 to Magento 2 website use google tag manager. Contact us if you face any problems during the installation process.