XML Sitemaps

Configure XML sitemaps with caching, content freshness filtering, and post type exclusions.

Overview

RationalSEO generates XML sitemaps that help search engines discover and crawl your content. The sitemap index is available at /sitemap.xml and contains links to per-post-type sitemaps.

Sitemaps are enabled by default. You can disable them under Settings → RationalWP → SEO → Sitemaps.

Sitemap Structure

The sitemap follows a two-level structure:

  • /sitemap.xml — Index file listing all post type sitemaps
  • /sitemap-post.xml — URLs for posts
  • /sitemap-page.xml — URLs for pages
  • /sitemap-{post_type}.xml — URLs for custom post types

Each sitemap is paginated at 1,000 URLs per page. When a post type exceeds 1,000 published posts, additional sitemaps are generated (e.g., /sitemap-post-2.xml).

Caching

Sitemaps are cached using WordPress transients with a 1-hour expiration. The plugin uses a stale-while-revalidate strategy:

  1. If a fresh cache exists, serve it immediately
  2. If the cache has expired, serve the stale version and schedule a background rebuild
  3. If no cache exists, generate fresh and cache the result

Caches are automatically cleared when posts are created, updated, or deleted.

Content Freshness

The Content Freshness setting lets you exclude older content from sitemaps. Options:

  • Include all content (default) — No age filtering
  • Last 6 months — Only content modified within the last 6 months
  • Last 12 months
  • Last 24 months
  • Last 36 months

Freshness is based on the post_modified date, not the publish date. Updating an old post brings it back into the sitemap.

Excluding Post Types

You can exclude entire post types from the sitemap under Settings → RationalWP → SEO → Sitemaps → Exclude Post Types. Attachments are always excluded.

Excluding Individual Posts

Posts with the noindex toggle enabled in the editor meta box are automatically excluded from sitemaps. There is no separate sitemap exclusion — noindex and sitemap exclusion are always linked.