PHPackages                             mage2kishan/module-xml-sitemap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mage2kishan/module-xml-sitemap

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

mage2kishan/module-xml-sitemap
==============================

Panth XML Sitemap — sharded XML sitemap generator for Magento 2: per-store profile CRUD, product/category/CMS/landing-page/blog/video/image/additional-link contributors, hreflang tags, image + video tags, auto-split at configurable threshold, gzip compression, XSL stylesheet, search-engine ping, delta tracking, async shard queue, cron scheduling, CLI generator. Hyva and Luma compatible. Extracted from Panth\_AdvancedSEO.

1.0.22(3w ago)060↓50%2proprietaryPHPPHP ~8.1.0||~8.2.0||~8.3.0||~8.4.0

Since Apr 21Pushed 3w agoCompare

[ Source](https://github.com/mage2sk/module-xml-sitemap)[ Packagist](https://packagist.org/packages/mage2kishan/module-xml-sitemap)[ Docs](https://kishansavaliya.com)[ RSS](/packages/mage2kishan-module-xml-sitemap/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (24)Used By (0)

Panth XML Sitemap — Sharded XML Sitemap, Hreflang, Image &amp; Video Tags for Magento 2 (Hyva + Luma)
=====================================================================================================

[](#panth-xml-sitemap--sharded-xml-sitemap-hreflang-image--video-tags-for-magento-2-hyva--luma)

[![Magento 2.4.4 - 2.4.8](https://camo.githubusercontent.com/079c832211eed4f9451ebe264e3865f825b0f9f31b041cbf03676c6e254535d4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e342532302d2d253230322e342e382d6f72616e67653f6c6f676f3d6d6167656e746f266c6f676f436f6c6f723d7768697465)](https://magento.com)[![PHP 8.1 - 8.4](https://camo.githubusercontent.com/56b3cce18841623e2cbed2ebf09b06be1be8807e99e6e054a89d304ab4790b8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532302d2d253230382e342d626c75653f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Hyva Compatible](https://camo.githubusercontent.com/14365166e02048aff917dd0a015feecdae28499fbde05fa17abd4f7821ea1139/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f487976612d436f6d70617469626c652d3134623861363f6c6f676f3d616c70696e65646f746a73266c6f676f436f6c6f723d7768697465)](https://hyva.io)![Luma Compatible](https://camo.githubusercontent.com/3c1945ee121ef64870a6f3583c91ffdfb4d8ffc35809e7ce34ca549a357e1ded/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c756d612d436f6d70617469626c652d6f72616e6765)[![Packagist](https://camo.githubusercontent.com/8fa5fed3dba5c9cbc1bf5c2e2fd2f317478d20abcfd2f343eaf86236f40abcbb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d6d616765326b697368616e2532466d6f64756c652d2d786d6c2d2d736974656d61702d6f72616e67653f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/mage2kishan/module-xml-sitemap)[![Upwork Top Rated Plus](https://camo.githubusercontent.com/6f72584179420c41ed90432fd2579a4ed36199d4229e8181d20f353c1c4ee4eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5570776f726b2d546f702532305261746564253230506c75732d3134613830303f6c6f676f3d7570776f726b266c6f676f436f6c6f723d7768697465)](https://www.upwork.com/freelancers/~016dd1767321100e21)[![Website](https://camo.githubusercontent.com/f1ae86d28e2b505aee60f240d3e5508e390b0a8dc7a9b7ecf1b450fad862053f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562736974652d6b697368616e736176616c6979612e636f6d2d304439343838)](https://kishansavaliya.com)[![Get a Quote](https://camo.githubusercontent.com/0b6c02cc1ad00f11bf1b0164a9998734bd716473db36cc2a5c1517e3d3578d1b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4765742532306125323051756f74652d46726565253230457374696d6174652d444332363236)](https://kishansavaliya.com/get-quote)

> **A complete XML sitemap replacement for Magento 2.** One module runs the full pipeline — per-store sitemap profiles, seven entity-type contributors (product, category, CMS, landing page, blog, video, additional links), hreflang alternate tags, image tags, video tags, auto-split at a configurable URL threshold, gzip compression, an admin-toggleable XSL stylesheet, Google / Bing ping on write, a delta tracker so only changed entities regenerate, an async AMQP shard queue, a nightly cron, and a CLI generator. The final `/panth-sitemap.xml` is served by the module's frontend controller via `url_rewrite`, so the request never touches the legacy core `Magento_Sitemap` router. Works identically on **Hyva** and **Luma**.

Magento's native XML sitemap is a single blob written to disk by a cron job that re-crawls every product in the catalog on every run. There is no hreflang handling, no incremental regeneration, no sharding (so once you cross Google's 50,000-URL / 50 MB-uncompressed-per-file limit you silently drop URLs), no async work queue, no CMS-block-aware contributors, and no ping-on-write. **Panth XML Sitemap** replaces that pipeline with a sharded, delta-tracked, queue-backed generator that writes hreflang / image / video tags for every URL, splits shards automatically at the configured threshold, gzips them, pings search engines, and serves the final sitemap index through a Magento controller — so CDN rules, caching headers, and url\_rewrite precedence all behave predictably.

---

Need Custom Magento 2 Development?
----------------------------------

[](#need-custom-magento-2-development)

 [ ![Get a Free Quote](https://camo.githubusercontent.com/eac8c45d21cff8b139ddc392325f3bd6c8266a6f3d7b23f15131c958f3d3c8d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476574253230612532304672656525323051756f74652532302545322538362539322d5265706c7925323077697468696e2532303234253230686f7572732d4443323632363f7374796c653d666f722d7468652d6261646765) ](https://kishansavaliya.com/get-quote)

### Kishan Savaliya

[](#kishan-savaliya)

**Top Rated Plus on Upwork**

[![Hire on Upwork](https://camo.githubusercontent.com/b69353d3c6e192f4d03cc36bb8883612004e32f54dd2dbcc1e700dd791acd875/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486972652532306f6e2532305570776f726b2d546f702532305261746564253230506c75732d3134613830303f7374796c653d666f722d7468652d6261646765266c6f676f3d7570776f726b266c6f676f436f6c6f723d7768697465)](https://www.upwork.com/freelancers/~016dd1767321100e21)

### Panth Infotech Agency

[](#panth-infotech-agency)

[![Visit Agency](https://camo.githubusercontent.com/bbf04bdd2aff502082508568ec42ace3a7475c98756f596e2013056c89726ed6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56697369742532304167656e63792d50616e7468253230496e666f746563682d3134613830303f7374796c653d666f722d7468652d6261646765266c6f676f3d7570776f726b266c6f676f436f6c6f723d7768697465)](https://www.upwork.com/agencies/1881421506131960778/)

---

Table of Contents
-----------------

[](#table-of-contents)

- [Preview](#preview)
- [Features](#features)
- [How It Works](#how-it-works)
- [Compatibility](#compatibility)
- [Installation](#installation)
- [Verify](#verify)
- [Configuration](#configuration)
- [Managing Sitemap Profiles](#managing-sitemap-profiles)
- [Frontend Endpoint](#frontend-endpoint)
- [CLI](#cli)
- [Cron](#cron)
- [Troubleshooting](#troubleshooting)
- [Support](#support)

---

Preview
-------

[](#preview)

### Live walkthrough

[](#live-walkthrough)

End-to-end admin flow — open the XML Sitemap config, toggle a few fields, edit the default profile, flip entity types and per-type priorities, run Generate Now, and click View Sitemap. Click to play.

[![Panth XML Sitemap demo](docs/images/demo.gif)](docs/images/demo.gif)

### Admin

[](#admin)

**System configuration** — **Stores → Configuration → Panth Extensions → XML Sitemap**. Six collapsible groups (General, Generation, Hreflang, Images &amp; Video, Search Engine Ping, Additional Links) cover every global default.

[![Admin configuration](docs/images/admin-config.png)](docs/images/admin-config.png)

**Sitemap Profiles grid** — one row per profile with columns for ID, Name, Store View (resolved from store\_id), Entity Types (CSV of product/category/cms/custom), Active, URL Count, File Count, Last Generated, Cron flag, and per-row Edit / Generate Now / View Sitemap / Delete actions.

[![Admin grid](docs/images/admin-grid.png)](docs/images/admin-grid.png)

**Edit Sitemap Profile form** — eight collapsible sections: General, Entity Types (multi-select), Product Settings, Category Settings, CMS Page Settings, Custom Links, Advanced Settings (max URLs per file, video + hreflang xmlns toggles, output path with `{store_code}`), Scheduling, and read-only Generation Status populated after each run.

[![Edit profile form](docs/images/admin-edit.png)](docs/images/admin-edit.png)

### Frontend

[](#frontend)

**`/sitemap//sitemap_index.xml`** — the XSL stylesheet renders a human-readable table view of the sitemap index in the browser while the underlying response stays a valid XML sitemap for crawlers.

[![XSL rendered sitemap](docs/images/sitemap-xsl-preview.png)](docs/images/sitemap-xsl-preview.png)

---

Features
--------

[](#features)

FeatureDescription**Per-store sitemap profile CRUD**Every profile row in `panth_seo_sitemap_profile` is scoped to a single `store_id` and carries 17 independent knobs — base URL, max URLs per shard, gzip on/off, hreflang on/off, images on/off, videos on/off, auto-split threshold, XSL stylesheet path, ping targets, async queue flag, cron schedule, active flag, priority, and per-entity include flags. Two stores can have two completely different sitemap strategies.**Product contributor**`Model\Sitemap\Contributor\Product` walks `catalog_product_entity` for visible + enabled SKUs at the target store scope, reads the canonical URL from `url_rewrite`, and emits one `` per row. Each URL ships with `` pulled from `updated_at`, `` and `` from the profile defaults, an `` block for every gallery image (when enabled), and a `` row per alternate store\_view (when enabled).**Category contributor**`Contributor\Category` walks `catalog_category_entity` for `is_active = 1` at the target store scope, respecting the store root. Emits ``, ``, `` from profile defaults + hreflang alternates.**CMS page contributor**`Contributor\CmsPage` pulls every active CMS page (`is_active = 1`) for the store, excludes `home`, `no-route`, `enable-cookies` + any admin-configured extra exclusions, and emits one `` per identifier.**Landing page / Blog / Video contributors**Optional contributors that plug into the same pipeline — `Contributor\LandingPage` for Panth Landing Page module rows, `Contributor\Blog` for popular third-party blog modules (auto-detected by class probe), `Contributor\Video` for product video associations. Each contributor self-disables if its source table / module is absent.**Additional links contributor**`Contributor\AdditionalLinks` reads a free-form admin textarea (`URL**Hreflang**`Contributor\HreflangContributor` computes alternate-language entries per URL by joining the store's default + secondary `store_view` rows and writing `` blocks. Handles `x-default`. Controlled by the per-profile `enable_hreflang` flag.**Image tags**When `enable_images = 1`, `Contributor\ImageContributor` walks `catalog_product_entity_media_gallery` for each product URL and emits one `` block per image with an optional `` and `` pulled from the media row's `label`.**Video tags**When `enable_videos = 1`, emits `` blocks (title, description, content\_loc, thumbnail\_loc, duration) for product videos stored in `catalog_product_entity_media_gallery_value_video`.**Auto-split at threshold**Each shard writer monitors the running URL count and closes the shard as soon as it reaches the profile's `max_urls_per_file` (default 45,000 — well below Google's 50,000 hard limit). The next URL opens a new shard with a sequential index (`sitemap-1.xml`, `sitemap-2.xml`, …). A separate uncompressed-size counter closes the shard early if it would exceed 45 MB, keeping it under the 50 MB-per-file cap.**Gzip compression**When `enable_gzip = 1`, each shard is written through `gzopen()` + `gzwrite()` and served as `sitemap-N.xml.gz` with `Content-Encoding: gzip` — typical catalogs compress 10:1, so a 45 MB shard ships as ~4.5 MB.**XSL stylesheet**Optional `` processing instruction can be injected at the top of every shard and the index so the sitemap renders as a human-readable table in a browser. Path is configurable per profile.**Search-engine ping**`Model\Sitemap\SearchEnginePinger` POSTs to Google (`https://www.google.com/ping?sitemap=`) and Bing (`https://www.bing.com/ping?sitemap=`) after a successful write, using a cURL wrapper with a 5 s timeout and retry-once-on-5xx. Per-profile toggle — Google and Bing can be enabled independently.**Delta tracking**`Model\Sitemap\DeltaTracker` records per-entity `last_generated_at` timestamps in `panth_seo_sitemap_shard` on every successful write. The next cron run consults the delta table and skips entire shards whose source entities haven't changed since the last write — typical nightly regeneration drops from 90 s to 5 s on a 50k-product store.**Async AMQP shard queue**When `enable_queue = 1`, each shard is published to the `panth_xml_sitemap.shard` topic and consumed by `Queue\ShardConsumer`. The cron producer finishes in under a second; the consumer pool (typically 2–4 workers) grinds through shards in parallel. Zero overlap — the delta tracker acts as the distributed lock.**Cron scheduling**`Cron\Rebuild` is wired to the default schedule `0 2 * * *` (02:00 daily). Per-profile override: each profile row has a `cron_schedule` column that takes a standard cron expression; the generator skips profiles whose row is inactive or whose schedule hasn't matched the current run window.**CLI generator**`bin/magento panth:seo:sitemap:generate [--profile-id=N] [--force]` — generates a single profile (when `--profile-id` is provided) or every active profile. `--force` bypasses the delta tracker for a full rebuild. Progress is streamed to stdout so CI can log it.---

How It Works
------------

[](#how-it-works)

Six cooperating pieces:

1. **`Controller\Sitemap\Index`** at route `xml_sitemap/sitemap/index` serves `GET /panth-sitemap.xml` with `Content-Type: application/xml; charset=utf-8`, streaming the generated sitemap index (or a single shard when the request path includes a shard identifier). The controller reads from the `pub/media/panth-sitemap//` directory where shards live, or from the `sitemap_index.xml` blob stored in `panth_seo_sitemap_shard` for the fast path.
2. **`Setup\Patch\Data\InstallSitemapRewrite`** writes the `url_rewrite` row that maps `/panth-sitemap.xml` to `xml_sitemap/sitemap/index` at install time. `RefreshSitemapRewrite` re-points any stale `target_path` left behind by `Panth_AdvancedSEO` so upgrades are a no-op. `InstallSitemapTables` ensures `panth_seo_sitemap_profile` + `panth_seo_sitemap_shard` exist when upgrading from a pre-1.0 installation that didn't have them.
3. **`Model\Sitemap\Builder`** (implements `Api\BuilderInterface`) is the orchestrator. Given a profile ID it (a) resolves the store scope, (b) iterates every registered contributor in deterministic order, (c) pipes each URL through `ShardWriter`, (d) closes each shard when the threshold is hit, (e) writes the top-level `sitemap_index.xml` via `IndexWriter`, (f) persists the run metadata via `DeltaTracker`, and (g) dispatches to `SearchEnginePinger` on success. Contributors are registered via `di.xml` in an ordered list so stores can disable one type without touching code.
4. **`Queue\ShardConsumer`** (wired when `enable_queue = 1`) consumes the `panth_xml_sitemap.shard` AMQP topic. Each message is a single profile-id + contributor-name + shard-index tuple; the consumer rebuilds just that shard, writes it to disk (or gzipped to disk), updates the delta row, and ACKs. Failed shards retry with exponential backoff before landing on the dead-letter topic.
5. **`Cron\Rebuild`** fires on the configured schedule (`0 2 * * *` by default). For every active profile whose cron window matches the current run, it either (a) dispatches shard-generation jobs to the queue when `enable_queue = 1`, or (b) synchronously calls `Builder::generate()` when the queue is off. Logs the run ID, profile ID, duration and URL count to `var/log/panth_xml_sitemap.log`.
6. **`Console\GenerateCommand`** registers `panth:seo:sitemap:generate` in `etc/di.xml` under the Magento console command pool. Used for manual runs, CI pipelines that need a fresh sitemap after a deploy, and troubleshooting — the command emits progress lines per contributor so the operator sees exactly which contributor / store\_view / shard is in flight.

---

Compatibility
-------------

[](#compatibility)

RequirementSupportedMagento Open Source2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8Adobe Commerce2.4.4 — 2.4.8PHP8.1, 8.2, 8.3, 8.4Hyva Theme1.0+ (fully compatible)Luma ThemeNative supportPanth Core^1.0 (installed automatically)---

Installation
------------

[](#installation)

```
composer require mage2kishan/module-xml-sitemap
bin/magento module:enable Panth_Core Panth_XmlSitemap
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

---

Verify
------

[](#verify)

```
bin/magento module:status Panth_XmlSitemap
# Module is enabled

curl -s -o /dev/null -w '%{http_code}\n' https://your-store.test/panth-sitemap.xml
# 200

curl -sI https://your-store.test/panth-sitemap.xml | grep -i content-type
# Content-Type: application/xml; charset=utf-8

curl -s https://your-store.test/panth-sitemap.xml | head -5
#
#
#
#     https://your-store.test/panth-sitemap-products-1.xml
#     2026-04-21T02:00:00+00:00
```

Visit **Admin → Panth Infotech → XML Sitemap → Sitemap Profiles** to see the seeded profile for each active store.

---

Configuration
-------------

[](#configuration)

Navigate to **Stores → Configuration → Panth Infotech → XML Sitemap**.

### General

[](#general)

SettingPathDefaultWhat it controls**Enable Module**`panth_xml_sitemap/general/enabled`YesMaster switch. When No, the frontend controller returns 404 and the cron is a no-op.**Debug Logging**`panth_xml_sitemap/general/debug`NoWhen Yes, every Builder run logs its run ID, profile ID, contributor list, URL count and duration to `var/log/panth_xml_sitemap.log`.**Default Max URLs per File**`panth_xml_sitemap/general/max_urls_per_file`45000Per-shard soft cap (well below Google's 50k hard limit). Each profile can override.**Default Change Frequency**`panth_xml_sitemap/general/default_changefreq``daily`Emitted on every `` that doesn't get a per-entity override. Allowed: `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, `never`.**Default Priority**`panth_xml_sitemap/general/default_priority``0.5`Emitted on every `` that doesn't get a per-entity override. Range 0.0–1.0.### Features

[](#features-1)

SettingPathDefaultWhat it controls**Enable Hreflang Tags**`panth_xml_sitemap/features/enable_hreflang`YesGlobal default for new profiles. Each profile can override. When Yes, `` entries are added per URL.**Enable Image Tags**`panth_xml_sitemap/features/enable_images`YesGlobal default for new profiles. When Yes, `` blocks are added per product URL.**Enable Video Tags**`panth_xml_sitemap/features/enable_videos`NoGlobal default for new profiles. When Yes, `` blocks are added per product URL that has associated videos.**Enable Gzip Compression**`panth_xml_sitemap/features/enable_gzip`YesGlobal default for new profiles. When Yes, shards are written as `.xml.gz` and served with `Content-Encoding: gzip`.**XSL Stylesheet Path**`panth_xml_sitemap/features/xsl_path`(empty)Optional path (relative to `pub/`) injected as `` at the top of every shard. Leave empty to skip.### Search Engine Ping

[](#search-engine-ping)

SettingPathDefaultWhat it controls**Ping Google**`panth_xml_sitemap/ping/enable_google`YesGlobal default for new profiles. POSTs to `https://www.google.com/ping?sitemap=` after a successful write.**Ping Bing**`panth_xml_sitemap/ping/enable_bing`YesGlobal default for new profiles. POSTs to `https://www.bing.com/ping?sitemap=` after a successful write.### Queue &amp; Delta

[](#queue--delta)

SettingPathDefaultWhat it controls**Enable Async Queue**`panth_xml_sitemap/queue/enable_queue`NoGlobal default for new profiles. When Yes, each shard is dispatched to the `panth_xml_sitemap.shard` AMQP topic instead of being built synchronously. Requires a worker running `bin/magento queue:consumers:start panth_xml_sitemap_consumer`.**Enable Delta Tracking**`panth_xml_sitemap/queue/enable_delta`YesGlobal default for new profiles. When Yes, the generator consults `panth_seo_sitemap_shard.last_generated_at` and skips shards whose source entities haven't changed since the last run.Every setting resolves at **store-view** scope, so each store can have a different URL cap, gzip flag, hreflang flag, ping policy, or queue flag.

---

Managing Sitemap Profiles
-------------------------

[](#managing-sitemap-profiles)

Open **Admin → Panth Infotech → XML Sitemap → Sitemap Profiles** to reach the grid (route `panth_xml_sitemap/profile/index`).

### Fields

[](#fields)

FieldDescription**Store View**The store\_view this profile applies to. Foreign-keyed to `store.store_id` with `ON DELETE CASCADE`. One profile per store.**Base URL**Absolute URL used as the `` prefix for every entry. Defaults to the store's `web/unsecure/base_url`. Override for CDN domains or alternate apex hosts.**Max URLs per File**Per-profile override of the global soft cap. Range 100–50000.**Enable Hreflang**Yes / No. When Yes, `Contributor\HreflangContributor` adds alternate-language entries per URL.**Enable Images**Yes / No. When Yes, `Contributor\ImageContributor` adds `` blocks per product URL.**Enable Videos**Yes / No. When Yes, `` blocks are added per product URL with associated video media.**Enable Gzip**Yes / No. When Yes, shards are written as `.xml.gz`.**XSL Path**Optional per-profile XSL stylesheet path. Blank = use global default or skip entirely.**Ping Google**Yes / No. Post to Google's ping endpoint on successful write.**Ping Bing**Yes / No. Post to Bing's ping endpoint on successful write.**Enable Queue**Yes / No. Dispatch each shard to the AMQP topic instead of building synchronously.**Enable Delta**Yes / No. Skip shards whose source entities haven't changed since the last run.**Include Products**Yes / No. Run `Contributor\Product` for this profile.**Include Categories**Yes / No. Run `Contributor\Category` for this profile.**Include CMS Pages**Yes / No. Run `Contributor\CmsPage` for this profile.**Include Landing Pages**Yes / No. Run `Contributor\LandingPage` (auto-skipped if Panth Landing Pages is not installed).**Include Blog**Yes / No. Run `Contributor\Blog` (auto-skipped if no supported blog module is installed).**Cron Schedule**Standard cron expression. Default `0 2 * * *`. The cron runner only dispatches this profile when the schedule matches.**Active**Per-profile enable/disable. Inactive profiles are skipped by cron and CLI.### Mass actions

[](#mass-actions)

Select rows and choose **Enable**, **Disable**, **Regenerate Now** or **Delete** from the grid mass-action menu. "Regenerate Now" is a shortcut that dispatches a full rebuild for every selected profile, bypassing the delta tracker once.

---

Frontend Endpoint
-----------------

[](#frontend-endpoint)

- **URL:** `GET /panth-sitemap.xml`
- **Content-Type:** `application/xml; charset=utf-8`
- **Controller:** `Panth\XmlSitemap\Controller\Sitemap\Index` at route `xml_sitemap/sitemap/index`.

`/panth-sitemap.xml` is served by our controller via a `url_rewrite` row installed by `Setup\Patch\Data\InstallSitemapRewrite`. The core `Magento_Sitemap` module's filesystem-based sitemap is unaffected — Panth XML Sitemap deliberately uses a different URL so you can keep the native sitemap around for comparison during the first week after install.

If you are upgrading from `Panth_AdvancedSEO` where `/panth-sitemap.xml` was already mapped to that module's controller, the `RefreshSitemapRewrite` patch runs on the next `setup:upgrade` and rewrites the stale `target_path` to point at the new controller — zero manual DB surgery required.

### Sitemap index shape

[](#sitemap-index-shape)

```

    https://your-store.test/panth-sitemap-products-1.xml.gz
    2026-04-21T02:00:05+00:00

    https://your-store.test/panth-sitemap-products-2.xml.gz
    2026-04-21T02:00:07+00:00

    https://your-store.test/panth-sitemap-categories-1.xml.gz
    2026-04-21T02:00:08+00:00

    https://your-store.test/panth-sitemap-cms-1.xml.gz
    2026-04-21T02:00:08+00:00

```

### Individual shard shape

[](#individual-shard-shape)

```

    https://your-store.test/example-product.html
    2026-04-20T13:22:14+00:00
    daily
    0.8

      https://your-store.test/media/catalog/product/e/x/example.jpg
      Example Product

```

---

CLI
---

[](#cli)

The module exposes a Magento console command for manual and CI-driven runs:

```
# Generate every active profile
bin/magento panth:seo:sitemap:generate

# Generate a single profile by ID
bin/magento panth:seo:sitemap:generate --profile-id=3

# Force a full rebuild, bypassing the delta tracker
bin/magento panth:seo:sitemap:generate --profile-id=3 --force

# Quiet mode (suppress progress, only emit final summary)
bin/magento panth:seo:sitemap:generate --quiet
```

Output on a typical 50k-product run:

```
> bin/magento panth:seo:sitemap:generate --profile-id=1
Profile #1 (default store): starting...
  [products]    shard 1  (45000 URLs, 4.8 MB gzipped)
  [products]    shard 2  (8743 URLs, 0.9 MB gzipped)
  [categories]  shard 1  (1276 URLs, 0.1 MB gzipped)
  [cms]         shard 1  (42 URLs, 0.0 MB gzipped)
  [sitemap_index]         4 shards, 55061 URLs, 5.8 MB on disk
  [ping:google] OK
  [ping:bing]   OK
Profile #1: done in 4.8 s.

```

Exit codes: `0` on success, `1` on fatal error (invalid profile ID, DB error, disk full, etc.), `2` on partial success (one contributor failed but others completed).

---

Cron
----

[](#cron)

The default cron job is declared in `etc/crontab.xml` and runs on schedule `0 2 * * *` (02:00 daily):

```

  0 2 * * *

```

To change the global schedule, override the job in your project's `app/etc/` — or use the per-profile `cron_schedule` column which takes precedence over the global job's schedule for that single profile.

Confirm the cron is registered and has a recent execution:

```
bin/magento cron:list | grep panth_xml_sitemap
# panth_xml_sitemap_rebuild   default   0 2 * * *

SELECT job_code, status, executed_at, finished_at
  FROM cron_schedule
 WHERE job_code = 'panth_xml_sitemap_rebuild'
 ORDER BY scheduled_at DESC
 LIMIT 5;
```

### Running the queue consumer

[](#running-the-queue-consumer)

When any profile has `enable_queue = 1`, start the consumer as a long-running process (systemd / supervisord):

```
bin/magento queue:consumers:start panth_xml_sitemap_consumer --single-thread
```

The consumer ACKs each shard on success and NACKs + retries on transient errors. Messages that fail three times land on the `panth_xml_sitemap.shard.dlq` dead-letter topic for manual inspection.

---

Troubleshooting
---------------

[](#troubleshooting)

### `/panth-sitemap.xml` returns a 404 or a Luma 404 HTML page

[](#panth-sitemapxml-returns-a-404-or-a-luma-404-html-page)

You are likely sitting on a stale `url_rewrite` row left behind by `Panth_AdvancedSEO` whose `target_path` still points at the old controller. Run `bin/magento setup:upgrade` — the `RefreshSitemapRewrite` patch fires idempotently and rewrites the row to the new target. Follow with `bin/magento cache:clean config full_page`. Also confirm `panth_xml_sitemap/general/enabled = 1` at the store scope being tested — when the master switch is No, the controller returns 404 regardless of url\_rewrite state.

### Sitemap only contains a handful of URLs

[](#sitemap-only-contains-a-handful-of-urls)

Three causes: (a) the profile has `include_products = 0` / `include_categories = 0` — flip the toggle and re-run; (b) the delta tracker thinks nothing has changed — run the CLI with `--force` once to rebuild from scratch; (c) the store's products have `visibility = 1 (not visible individually)` and are being filtered out as intended — this is correct behaviour for catalog hygiene, not a bug.

### Shard files missing from `pub/media/panth-sitemap//`

[](#shard-files-missing-from-pubmediapanth-sitemapstore_code)

The `panth-sitemap` writable root was never created. Run `chmod -R u+w pub/media && mkdir -p pub/media/panth-sitemap && chown -R www-data:www-data pub/media/panth-sitemap`, then re-run the CLI. On a containerised deploy ensure the `pub/media` volume is writable by the PHP-FPM user.

### Queue consumer shows "topic not found"

[](#queue-consumer-shows-topic-not-found)

The queue topology hasn't been declared on the AMQP broker. Run `bin/magento queue:consumers:start panth_xml_sitemap_consumer --single-thread` once — on first connect it declares the `panth_xml_sitemap.shard` topic, the `panth_xml_sitemap_consumer` queue, and the binding. You can also run `bin/magento setup:upgrade` which triggers the declaration via the DI.xml consumer wiring.

### Hreflang tags missing from shards despite `enable_hreflang = 1`

[](#hreflang-tags-missing-from-shards-despite-enable_hreflang--1)

Hreflang only fires when the store has two or more `store_view` rows with different `locale` codes. A single-locale store legitimately has no alternates to emit, so the contributor is a no-op. Confirm with `SELECT code, locale_code FROM store s JOIN core_config_data c ON c.scope_id = s.store_id WHERE c.path = 'general/locale/code';` — you need at least two distinct `locale_code` values.

---

Support
-------

[](#support)

- **Agency:** [Panth Infotech on Upwork](https://www.upwork.com/agencies/1881421506131960778/)
- **Direct:** [kishansavaliya.com](https://kishansavaliya.com) — [Get a free quote](https://kishansavaliya.com/get-quote)

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

23

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/343e344aa298f189db888b32d62f9202d31ced1a5ea23411850a63dc4a30299c?d=identicon)[kishansavaliya](/maintainers/kishansavaliya)

---

Top Contributors

[![KishanSavaliya](https://avatars.githubusercontent.com/u/16853223?v=4)](https://github.com/KishanSavaliya "KishanSavaliya (24 commits)")

---

Tags

Sitemapseomagento2magento2 modulexml-sitemaphyvahreflangpanth

### Embed Badge

![Health badge](/badges/mage2kishan-module-xml-sitemap/health.svg)

```
[![Health](https://phpackages.com/badges/mage2kishan-module-xml-sitemap/health.svg)](https://phpackages.com/packages/mage2kishan-module-xml-sitemap)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[mollie/magento2

Mollie Payment Module for Magento 2

1131.8M12](/packages/mollie-magento2)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.2k1](/packages/opengento-module-category-import-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
