Sitemap Engine
Sitemap Engine
URL Structure
The sitemap base slug is configurable. The default is sitemap, producing:
/sitemap.xml → index sitemap
/sitemap-post-1.xml → post sitemap, page 1
/sitemap-category-1.xml → category sitemap, page 1
/sitemap-news.xml → Google News sitemap (if enabled)
If you change the base to content-map:
/content-map.xml
/content-map-post-1.xml
This is useful for avoiding conflicts with other sitemap plugins, CDN routing rules, or simply for branding.
Chunking
Sitemaps are split at 2,000 URLs per file. The index sitemap lists all chunks:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-post-1.xml</loc>
<lastmod>2026-05-26T17:17:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-post-2.xml</loc>
<lastmod>2026-05-26T17:17:00+00:00</lastmod>
</sitemap>
</sitemapindex>
Provider Architecture
Each sitemap type is handled by a provider implementing ProviderInterface:
interface ProviderInterface {
public function get_urls(int $page): array; // returns SitemapItem[]
public function get_count(): int; // total items
public function get_lastmod(): string; // most recent modification
}
Built-in providers:
| Provider | Handles |
|---|---|
PostTypeProvider |
Any registered public post type |
TaxonomyProvider |
Any registered public taxonomy |
AuthorProvider |
Author archive pages |
ArchiveProvider |
Monthly date archives |
NewsProvider |
Google News (last 48 hours) |
MiscProvider |
Homepage and uncategorized pages |
New providers can be registered:
add_action('init', function() {
\Cybermaps\Sitemap\Orchestrator::register_provider('custom', new MyCustomProvider());
});
Priority Engine
URL priorities are calculated through a three-tier system:
Tier 1: Manual Overrides Set per-type priorities in the Discovery Center admin UI. These take absolute precedence.
Tier 2: Archetype Baseline
Choose a site archetype (blog, ecommerce, enterprise, news, etc.). Each archetype has preset priorities mapped to post types and taxonomies. The defaults are defined in DiscoveryAuditor::get_archetype_defaults().
Tier 3: Intent Offsets
The IntentEngine analyzes content and applies modifiers:
- Freshness: post published within 30 days → +0.1
- Social proof: post has comments → +0.1
- Media reach: post has attachments → +0.1
The final value is clamped to [0.1, 1.0].
Legacy Sitemap Redirects
WordPress core generates sitemaps at /wp-sitemap.xml by default. Cybermaps can:
- Redirect core sitemaps to your custom sitemap (recommended)
- 404 core sitemaps to prevent duplicate indexing
The same options exist for /sitemap.xml when your custom base slug differs.
Caching
Sitemap XML output is cached in transients:
- Key:
cybermaps_v6_{md5(type_page)} - TTL: 12 hours
- Invalidation:
save_post,delete_post,edited_term,create_term,delete_term
Exclusion SQL (the WHERE clause filtering out excluded posts, categories, and tags) is computed once per provider instance and cached as a class property for the remainder of the request.
ETag Support
Every sitemap response includes an ETag header (SHA-256 of the XML content). When a bot sends If-None-Match with a matching ETag, the plugin returns 304 Not Modified with no body: saving bandwidth and CPU.
GZIP Compression
Sitemaps are compressed via ob_start('ob_gzhandler'). Browsers and bots that send Accept-Encoding: gzip receive compressed output automatically.
RSS 2.0 Sitemap
A dedicated RSS-formatted sitemap is available at /sitemap-rss.xml (configurable base). It serves as an alternative to XML sitemaps and is accepted by Google, Bing, and other search engines.
Configuration:
enable_rss_sitemap: toggle the RSS sitemap endpointrss_sitemap_types: which post types to include (default:post)rss_sitemap_limit: max items (default: 100)rss_sitemap_url_base: URL slug (default:sitemap-rss)
Output: RSS 2.0 format with <channel>, <item>, <title>, <link>, <pubDate>, <guid>, <description>. Uses manual excerpts when available, falls back to auto-generated excerpts. Password-protected posts are automatically excluded. Respects cross-plugin noindex from Yoast, RankMath, and AIO-SEO. Cached for 12 hours via transient.
HTML Sitemap Shortcode
The [cybermap] shortcode generates a human-readable HTML sitemap on any page or post. Configure it through the Settings → HTML Sitemap tab with an interactive builder that provides a live shortcode preview.
Attributes:
| Attribute | Values | Default | Description |
|---|---|---|---|
only |
post types/taxonomies | All public | Comma-separated list of content types to include |
exclude |
IDs, slugs, wildcards | : | Exclude specific items; supports * wildcards |
limit |
1–500 | 50 | Maximum items to display |
depth |
-1, 0, 1–10 | 0 | -1 = flat list, 0 = unlimited depth, 1+ = level cap |
sort |
asc, desc | asc | Sort order (A→Z or Z→A) |
nofollow |
true, false | false | Add rel="nofollow" to all links |
display_title |
true, false | true | Show section heading above the sitemap |
Display modes:
- Hierarchical tree (default): nested
<ul>structure with CSS-styled indentation and left-border guides - Flat list (
depth="-1"): all items at the same level with dividers between entries
CSS classes: .cybermap-shortcode, .cybermap-sitemap-title, .cybermap-list, .cybermap-tree, .cybermap-sublist, .cybermap-flat, .cybermap-item, .cybermap-empty.
Per-Post Sitemap Controls
The Gutenberg editor includes a Sitemap sidebar panel with three controls:
- Exclude from XML Sitemap: Toggle stored in
_cybermaps_exclude_sitemappost meta. When enabled, the post is excluded from all sitemap types (XML, HTML, RSS, AI). - Manual Priority Override: Range slider (0.0–1.0, step 0.1). Zero means “auto”: the priority engine calculates the value from archetype presets and content signals. Any non-zero value overrides the calculation.
- Change Frequency Override: Dropdown with all valid values (always, hourly, daily, weekly, monthly, yearly, never). Empty means “auto”: the content type default is used.
Cross-Plugin Noindex Respect
Cybermaps automatically detects and respects noindex settings from the three major SEO plugins:
| Plugin | Meta Key | Detection |
|---|---|---|
| Yoast SEO | _yoast_wpseo_meta-robots-noindex |
meta_value = '1' (noindex) |
| RankMath | rank_math_robots |
meta_value LIKE '%noindex%' |
| AIO-SEO | _aioseo_noindex |
meta_value = '1' |
Posts marked as noindex in any of these plugins are automatically excluded from Cybermaps XML sitemaps, HTML sitemap, RSS sitemap, and AI discovery content maps. No duplicate metabox or conflicting settings.