Sitemaps & Crawler Manifests
SitemapGenerator registers virtual ProcessWire URL hooks for XML sitemaps and plain-text crawler manifests, caching rendered output in WireCache (CACHE_TTL = 3600 seconds) and invalidating automatically when pages or SEO settings change.
Virtual Endpoints
Section titled “Virtual Endpoints”| Endpoint | Purpose | Availability Condition |
|---|---|---|
/sitemap.xml |
Root sitemap index listing paginated child sitemaps per eligible template. | Active when sitemap_enabled = true. |
/sitemap.xsl |
Built-in XSL stylesheet so browsers render /sitemap.xml as a readable table. |
Always active when sitemaps are enabled. |
/sitemap-pages-{template}-{pageNum}.xml |
Paginated URL set for one ProcessWire template (chunked by sitemap_page_size, default 1000). |
Active for templates with sitemap_enabled = 1 and robots_noindex = 0. |
/robots.txt |
Crawler directives with automatic Sitemap: https://.../sitemap.xml footer. |
Always active; emits Disallow: / in non-live environments. |
/humans.txt |
Team and studio attribution. | Custom humans_txt_content, or auto-generated from Identity Creator fields when creator_name is set. |
/.well-known/security.txt and /security.txt |
Security disclosure policy (RFC 9116). | Served when security_txt_content is non-empty (returns 404 when empty). |
/ads.txt |
Authorized Digital Sellers declaration. | Served when ads_txt_content is non-empty (returns 404 when empty). |
/llms.txt |
Structured Markdown guide for AI assistants and crawlers. | Custom llms_txt_content or auto-summary when enabled. |
Indexing & Exclusion Rules
Section titled “Indexing & Exclusion Rules”SeoResolver::isIndexableForSitemap() automatically excludes pages that should never appear in search results:
- Unpublished, hidden, trashed, or non-guest-viewable pages.
- Admin, system, and protected templates (
admin,user,role,permission,language). - Pages with
robots_noindex = 1(either per-page or inherited from their Template Rule). - Pages with
sitemap_include = 'exclude'. - Pages whose custom canonical URL points to a different URL than the page itself.
Image Sitemaps & Multi-Language hreflang
Section titled “Image Sitemaps & Multi-Language hreflang”- Image Sitemaps (
<image:image>): Whensitemap_images = 1on a Template Rule,SitemapGeneratorattaches<image:loc>tags fromog_imageand the template’s configuredimage_field(including publicMediaassets when theMediamodule is installed). - Multi-Language Alternates (
xhtml:link): On sites withLanguageSupportandLanguageSupportPageNames, each<url>entry emits<xhtml:link rel="alternate" hreflang="..." href="...">tags for every active guest-viewable language plusx-default.
Regenerating or Inspecting Sitemaps in PHP
Section titled “Regenerating or Inspecting Sitemaps in PHP”<?php
declare(strict_types=1);
namespace ProcessWire;
/** @var Seo $seo */$seo = wire()->seo;$sitemap = $seo->sitemap();
// Invalidate cached XML after bulk migrations$sitemap->invalidateCache();
// Inspect which templates are included in /sitemap.xml$templates = $sitemap->discoverSitemapPageTemplates();