SEO Forge generates a complete XML sitemap system with a sitemap index, per-post-type sitemaps, and an optional video sitemap. This is a FREE feature.
Endpoints
| URL | Description |
|---|---|
/sitemap.xml | Alias that redirects to the sitemap index |
/sitemap_index.xml | Sitemap index listing all sub-sitemaps |
/{posttype}-sitemap.xml | Per-post-type sitemap (e.g. /post-sitemap.xml) |
/video-sitemap.xml | Video sitemap (PRO) |
Features
- Respects
_seoforge_noindex— noindex posts are excluded from all sitemaps - Includes
elements for featured images - Cached via transients with a 1-hour TTL per sitemap
- Pings Google on post publish via
transition_post_statushook - Configurable max URLs per sitemap (default 1000)
Configuration
php
// Customize which post types appear in the sitemap
update_option( 'seoforge_sitemap_settings', [
'enabled_types' => [ 'post', 'page', 'product' ],
'max_urls' => 2000,
] );
// Invalidate sitemap cache programmatically
SEOFORGE_Sitemap::instance()->invalidate_cache();Disabling the Sitemap
php
add_action( 'init', function () {
if ( ! class_exists( 'SEOFORGE_Sitemap' ) ) {
return;
}
$sitemap = SEOFORGE_Sitemap::instance();
remove_action( 'init', [ $sitemap, 'register_rewrites' ] );
remove_action( 'template_redirect', [ $sitemap, 'render_sitemap' ] );
remove_action( 'transition_post_status', [ $sitemap, 'maybe_ping_google' ] );
}, 20 );Flush Rewrite Rules
After activation or if sitemaps return 404:
php
flush_rewrite_rules();
// Or from WP-CLI: wp rewrite flush—