Rating 5 stars - 1 votes

Magento 2 XML sitemap

What Is sitemap.xml in Magento 2?

Magento 2 XML sitemap is a file containing a structured list of all URLs of your website. Besides, it provides Google bots with some additional metadata about each page like its priority towards other pages, frequency of being updated etc.

Having access to such information web crawlers can correctly understand your website organization and index its content faster.

How to Generate Magento 2 XML Sitemap?

  1. Go to Admin >> 'Marketing' and under 'SEO&Search' select 'Site Map'. Press 'Add Sitemap' and fill in the required information:

  2. magento-2-xml-sitemap-admin
    Magento 2 XML Sitemap

    • Enter the sitemap name in 'Filename' field;

    • magento-2-xml-sitemap-name
      Magento 2 XML Sitemap

    • Input the sitemap path to specify where it will be placed on the server. Check if the path is writable. You can use '/sitemap/' for placing it in 'sitemap' directory or '/' for placing it in the root of your Magento;

    • Please, note: It is recommended to choose the second variant (root of your Magento installation) and here is the reason: putting the sitemap to let's say www.mag-manager.com/media/sitemap will direct web crawlers only to pages starting with www.mag-manager.com/media.

    • Select Magento storeview.
  3. To complete the generation, press 'Save & Generate' button. It might take a few minutes for the sitemap to show up in the grid.

How to Configure Magento 2 XML Sitemap?

Magento 2 supports XML sitemap auto-generation on daily, weekly or monthly basis. But this possibility is available only if you have already created an XML sitemap manually.

Use this guide to configure sitemap.xml in Magento 2:

  1. From admin panel go to 'Stores' >> 'Configuration' >> 'Catalog' >> 'XML Sitemap'.

  2. magento-2-xml-sitemap-configuration
    Magento 2 XML Sitemap

  3. Use 'Categories Options', 'Product Options' and 'CMS Page Options' to configure the frequency and priority of these pages. For enabling the fields, uncheck Use system value box.
  4. You can also enable adding all, base only or none product images to sitemap by selecting corresponding options in 'Product Options'.

    Magento 2 XML Sitemap

    Please, note: It would be reasonable to add only base images for the sitemap not to be overfull.

  5. Generation options allow you to enable sitemap generation and configure this procedure by:
    • setting its start time (Start Time);
    • setting its frequency (Frequency);
    • specifying the recipient of notification if an error occurs during the sitemap update (Error Email Recipient);
    • specifying the sender of error notification (Error Email Sender);
    • selecting the template for error e-mail (Error Email Template).

    Magento 2 XML Sitemap

    It is also possible to specify the maximum number of URLs per file (the default limit is 50, 000) and maximum file size (the default size is 10, 485, 760 bytes). These options are especially useful for websites with large sitemaps, as they allow to track what pages were not indexed and make sure your sitemap is not slowing down the site.

    Magento 2 XML Sitemap

    In order to submit the sitemap to robots.txt file, select Yes in Enable submission to robots.txt file drop-down. Activating this option you will allow to automatically submit every generated sitemap to the robots.txt file.

    Submitting your sitemap to robots.txt file you will instruct web crawlers on what content must not be processed.

    Magento 2 XML Sitemap

  6. Having completed the configuration, press 'Save Config' to save the settings.

By creating Magento 2 XML sitemap you increase the chances to move your SEO positions higher in a big way. This tool serves as a guide for both users and search engine crawlers and seems to be a must-have for every Magento-owner.

Be the first to comment.
Live Chat