Configuring a Sitemap in Magento 2
A Sitemap is a plain text XML file that contains link to all of the pages on your website. It is used by the Search Engines to properly crawl and index your website. In Magento 1.x this option was called Google Sitemaps and was located in the Catalog menu. However, things have changed in Magento 2.
To generate a sitemap in Magento 2:
- Go to Marketing > Site Map in the backend of your Magento 2 store.
- If you don't already have a sitemap showing in the list, click Add Sitemap.
- Enter the filename you wish to use (e.g. "sitemap.xml").
- Enter the file path from the root of the Magento install you wish to have Magento generate the sitemap. Most will simply enter in "/" for the root directory.
- Click Save & Generate to have Magento create your initial sitemap.
To configure the parameters of the sitemap:
- Go to Stores > Configuration > Catalog > XML Sitemap in the backend of your Magento 2 store.
- Review the settings for each subpanel.
- Select "Yes" for Generation Settings > Enabled to have Magento regularly create an updated sitemap. Once you do, you'll see additional settings to configure for start time, frequency, and whether to email an error report to someone.
- The final panel you will most likely wish to attend to is the Search Engine Submission Settings subpanel. By selecting "Yes" for Enable Submission to Robots.txt Magento will insert a link to the sitemap to the site's robots.txt file which instructs search engines what they should and should not index in your site. By linking the sitemap file, you are giving the search engine quick notice of all the pages in your Magento store.