Log in
Model

Sitemap

Magento\Sitemap\Model\Sitemap

What it does

This class handles the generation and management of XML sitemaps for Magento 2 stores.

Developers use it to programmatically create sitemaps containing URLs for products, categories, and CMS pages, which helps search engines crawl and index the site.

It supports splitting large sitemaps into multiple files and creating sitemap index files when needed.

Public Methods

  • addSitemapItem()
  • collectSitemapItems()
  • beforeSave()
  • generateXml()
  • getSitemapUrl()
  • getIdentities()