An XML sitemap guides search engines like Google and Bing to crawl your website efficiently. It also helps them understand the structure and connections between your Magento store pages.
This guide teaches you to create a sitemap in Magento 2 (version 2.4.3) to make your store more visible on SERPs.
How to Configure a Sitemap in Magento 2
- Log in to the Magento admin panel and navigate to Stores > Settings > Configuration.
- Expand “Catalog” in the left panel and choose XML Sitemap.
- Expand the “Categories Options” section and follow these steps:
i. Untick the Use system value checkbox.
ii. Select one of the values from the Frequency dropdown.
iii. Add a valid value between 0.0 and 1.0 in the Priority text area. Note that zero has the lowest priority.
- Expand the “Products Options” section and follow these steps:
i. Uncheck the Use system value checkbox.
ii. Configure Frequency and Priority settings.
iii. Determine if you want to add images to the sitemap by selecting None, Base Only, or All from the Add Images into Sitemap dropdown.
- Configure the Frequency and Priority settings in the “CMS Pages Options” section.
- Set up the Frequency and Priority settings in the “Store Url Options” section.
- Configure the “Generation Settings” as below:
Enabled: Select Yes.
Start Time: Set the start time when you want the XML sitemap to be updated.
Frequency: Select either Daily, Weekly, or Monthly to set frequency.
Error Email Recipient: Add an email address to receive notifications in case of an error during an update.
Error Email Sender: Select who is displayed as the sender of the update error notification.
Error Email Template: Select which template will be used for the update error notification.
- Expand the “Sitemap File Limits” section and set up the following details:
Maximum No of URLs per File: Insert the upper limit of URLs allowed to be included in the XML sitemap. The default value is 50,000.
Maximum File Size: Add the largest file size for the XML sitemap. The default size is 10,485,760 bytes.
- Under “Search Engine Submission Settings” section, set Enable Submission to Robots.txt to Yes.
How to Add a Sitemap in Magento 2
- Navigate to Marketing > SEO & Search > Site Map.
- Click Add Sitemap on the top right.
- On the “New Site Map” page, configure the following:
Filename: Insert the name of the sitemap.
Path: Add the URL path of the site map file on the server.
- Once complete, click Save & Generate. It might take some time to generate the sitemap.