Search by

infrangible / m2-sitemap

infrangible

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.

Package info

github.com/infrangible-dev/m2-sitemap

Homepage

Type:magento2-module

pkg:composer/infrangible/m2-sitemap

Statistics

Installs: 51

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

3.0.1 2026-11-26 17:45 UTC

This package is auto-updated.

Last update: 2026-11-26 17:47:03 UTC


README

Generates XML sitemaps of the products (with their images), categories and CMS pages of every store, as task of Infrangible Task: every night by cron, from the admin or on the console. An alternative to the sitemap of Magento.

Sitemaps

  • Every store has a file (Stores > Configuration > Infrangible Solutions > Sitemap > General > File Name, relative to the document root, for example sitemap.xml or sitemap/de.xml); stores with the same file share it.
  • If the stores have several files, sitemap.xml becomes the index of their files ("Generate Main Sitemap"); no store may then use sitemap.xml itself.
  • A file with more than 50,000 URLs is split into numbered files (sitemap_001.xml, ...), and the file becomes their index.
  • Every URL is written once. URLs use the base URL of their store, with HTTPS if the store uses it in the frontend, also when the sitemap is generated by cron or on the console.

Sources

Source Content
Product visible, enabled products of the website, in stock unless out of stock products are shown; with their images and the first image as thumbnail of the PageMap
Category active categories
CMS active CMS pages; the home page of the store with its base URL and priority 1.0, without the 404 page
  • Each source can be switched off, with its own change frequency and priority (from 0.0 to 1.0), per store.
  • Products, categories and CMS pages have the attribute "Exclude from Sitemap".
  • Other modules add sources in their config.xml: infrangible_sitemap/source/<name> is the name of a class that implements Infrangible\Sitemap\Model\Source\ISource (getStoreData() and transformStoreData(), which returns Infrangible\Sitemap\Model\ISitemapUrl objects from Infrangible\Sitemap\Model\SitemapUrlFactory). Infrangible\Sitemap\Helper\Data provides URLs, dates, change frequency and priority like the sources of this module.

Events:

Event Data
infrangible_sitemap_attributes_product attributes: attribute codes to load
infrangible_sitemap_attributes_category attributes: attribute codes to load
infrangible_sitemap_transform_product sitemap_url, product_data
infrangible_sitemap_transform_category sitemap_url, category_data
infrangible_sitemap_transform_cms sitemap_url, cms_page

Generating

  • Cron: the job task_sitemap runs at 4:10; Stores > Configuration > Tasks > Sitemap > Execution changes the cron expression.
  • Admin: Infrangible Solutions > Sitemap > Manage lists the files with their stores, date and link; "Generate" generates a file, "Generate All" all files. Admin users need the resource "Sitemap" and the resource of Infrangible Task.
  • Console: bin/magento task:sitemap (options of Infrangible Task, for example --store_code=default).

The task logs every run and sends summaries like every task of Infrangible Task.

Magento's own sitemap (Marketing > SEO & Search > Site Map) writes sitemap.xml as well; do not let both write the same file.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.6 or newer
  • PHP 8.1 or newer

Installation

composer require infrangible/m2-sitemap
bin/magento module:enable Infrangible_Sitemap
bin/magento setup:upgrade

In production mode, also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy.

License

Infrangible Sitemap is licensed under the MIT License - see the LICENSE file for details.