Skip to content

HTML Sitemap

An XML sitemap is for search engines; an HTML sitemap is for people (and a nice secondary crawl path for bots). This module builds one: a single page that lists your products, categories, CMS pages and blog posts in ordered, titled sections — and exposes the same data over GraphQL so a headless Astro storefront can render its own. It only ever lists active, visible content, with configurable limits and exclusions.

HTML Sitemap configuration

Magento

Open Source 2.4.9 GA (and later 2.4.x).

PHP

Tested on 8.4 and 8.5.

Headless

Same sitemap over GraphQL, with headless URL building.

Clean

Only active/visible content; disabled items never appear.

Each content type is its own section with a title, a sort order and a link limit:

SectionSourceFiltered to
Productscatalogenabled + visible-in-site products
Categoriescatalogactive categories, to a configurable depth
CMS pagesCMSactive pages
Blog posts / categoriesBlogPro (if installed)active only
Additional linksyour confighand-added safe links

The sitemap renders as a normal storefront page; product/category/CMS URLs use Magento’s native URLs.

Only what's public

Products are filtered to enabled + visible-in-site, categories to active, CMS and blog to active — so a disabled or hidden item can never surface on the sitemap.

XSS-safe extra links

Hand-added “additional links” are validated — only site-relative paths and http(s) URLs are allowed, so a javascript: or data: URL can’t be injected into the rendered sitemap.

Will disabled products or unpublished pages show up?

No — every section filters to active/visible content (enabled + visible-in-site products, active categories, active CMS and blog items), so nothing that’s hidden from the storefront appears on the sitemap.

Can I reorder the sections or cap how many links show?

Yes — each section has its own title, sort order and link limit, and you can exclude specific URL keys, so the sitemap stays useful rather than an unbounded wall of links.

Does it work on a headless storefront?

Yes — the htmlSitemap GraphQL query returns the same sections with URLs built for your headless routes, so your Astro storefront can render its own sitemap page from one call.

Is it secure?

Admin-added extra links are scheme-validated (relative or http/https only), so no script URL can slip into the sitemap, and only public, active content is ever listed. Verified clean on PHP 8.4 and 8.5.