← All modules

Magento 2 module

Sitemap

Generates XML sitemaps for products (with images), categories and CMS pages per store view, on a schedule or on demand, with exclusion options and large-catalog splitting.

An up-to-date XML sitemap helps search engines find all products, categories and content pages of a store. This module provides its own sitemap generator as an alternative to the standard Magento sitemap. It creates the sitemap files automatically every night, can be started by hand at any time, and gives you control over what is included.

Features

  • Creates XML sitemaps with products, categories and CMS pages for each store view.
  • Product entries include the product images, so they can also appear in image search.
  • Include or leave out products, categories and CMS pages as a whole, each with its own change frequency and priority.
  • New “Exclude from Sitemap” option on products, categories and CMS pages to keep single entries out of the sitemap.
  • One file name per website or store view: store views can share a sitemap file or get their own.
  • If several files are generated, an additional main sitemap (“sitemap.xml”) can list them all.
  • Very large sitemaps are split automatically into several files of up to 50,000 addresses, with an index file pointing to them.
  • Duplicate addresses are removed.
  • Runs automatically every night; the schedule can be changed.
  • Admin overview of all sitemap files with their store views, creation date and a link to the file, plus buttons to generate a single file or all files right away.
  • Other Infrangible modules can add their own pages, for example the attribute landing pages.

Configuration

  • Stores > Configuration > Infrangible Solutions > Sitemap: in “General” switch the export on or off, set the “File Name” (per website or store view) and decide whether to “Generate Main Sitemap”. In “Product”, “Category” and “CMS” choose “Export”, “Change Frequency” and “Priority”. Defaults: products daily, categories monthly (both priority 1.0), CMS pages yearly (priority 0.5).
  • Stores > Configuration > Tasks > Sitemap > Execution: change the schedule (“Cron Expression”); by default the sitemap is generated daily at 4:10.
  • Infrangible > Sitemap > Manage: view the generated files and start the generation by hand.

Good to know

The generation runs as a task of the Infrangible task system, which is installed automatically and logs each run. Agencies can also start it from the command line. When several sitemap files are created, none of them may be named “sitemap.xml”, because the main sitemap uses this name. Use “Catalog Attribute Landing Page Sitemap” to add attribute landing pages to the sitemap.

Installation

Install the module with Composer in your Magento root directory:

composer require infrangible/m2-sitemap

Then enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.