How to Create a Sitemap in Magento 2

How-to-Create-a-Sitemap-in-Magento-2

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

  1. Log in to the Magento admin panel and navigate to Stores > Settings > Configuration.

    Configuration in the sidebar
  2. Expand “Catalog” in the left panel and choose XML Sitemap.

    XML Sitemap on Configuration page
    XML Sitemap on Configuration page
  3. 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.

    Categories Options
    Expand the Categories Options section
  4. 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.

    Products Options on Configuration page
    Expand the Products Options section
  5. Configure the Frequency and Priority settings in the “CMS Pages Options” section.

    CMS Pages Options on Configuration page
    Expand the CMS Pages Options section
  6. Set up the Frequency and Priority settings in the “Store Url Options” section.

    Store Url Options on Configuration page
    Expand the Store Url Options section
  7. 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.

    Generation Settings
    Expand the Generation Settings section
  8. 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.

    Sitemap File Limits section
    Expand the Sitemap File Limits section
  9. Under “Search Engine Submission Settings” section, set Enable Submission to Robots.txt to Yes.

    Search Engine Submission Settings section
    Expand the Search Engine Submission Settings section

How to Add a Sitemap in Magento 2

  1. Navigate to Marketing > SEO & Search > Site Map.

    Site Map in the sidebar
    Site Map in the sidebar
  2. Click Add Sitemap on the top right.

    Add Sitemap button
    Click Add Sitemap button
  3. 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.

    New Site Map
    Sitemap section on the New Site Map page
  4. Once complete, click Save & Generate. It might take some time to generate the sitemap.

    Save and Generate button
    Click Save & Generate

Leave a comment