WordPress SEO & search visibility

A sitemap that covers every corner of the site, automatically

XML Sitemap builds a complete sitemap index covering every registered post type, taxonomy, and author archive, respects noindex settings from Yoast or RankMath, and keeps itself current the moment content changes — without waiting for a manual regeneration.

  • Covers any registered post type and taxonomy, not just the defaults.
  • Automatically excludes posts marked noindex by Yoast or RankMath.
  • Cache clears itself precisely when the relevant content changes.
  • Auto-splits into multiple files once a section passes 500 URLs.
Sitemap ConfigurationXML Sitemap
Sitemap URL:yoursite.com/sitemap_index.xmlFlush Cache

Include Post Types

Postpost
Pagepage
Mediaattachment

Options

Ping Google when publishing
Disable WordPress built-in sitemap
Every URL covered, self-updatingExcludes noindex content automatically.
Active
Quick answer

What does XML Sitemap do?

When the xml_sitemap module is active, TOWP_Xml_Sitemap serves a sitemap index at /sitemap_index.xml, with individual sitemap files for every configured post type, taxonomy, and author archive at addresses like /sitemap-page.xml. A post marked noindex by Yoast SEO or RankMath is automatically excluded, and a post can be excluded individually through a checkbox on its own editor screen. Since output is cached for twelve hours and invalidated precisely when the relevant content actually changes, search engines never fetch a sitemap that's genuinely stale.

The "search engines don't know what to crawl" problem

Without a sitemap, discovery is left to chance

Since nothing tells a search engine exactly what exists on a site, new or updated content can take far longer to get noticed.

A generic sitemap misses what makes a site actually different

Custom post types, custom taxonomies, and author pages are exactly the content a default or bare-bones sitemap tends to leave out, even though they're often central to what a site is actually built around.

A stale sitemap actively works against fresh content

A sitemap that isn't updated the moment content changes can point search engines at outdated information, or simply miss what was published most recently.

Here's the fix

Every URL covered, kept current automatically

The module builds a genuinely complete sitemap and keeps it accurate without any manual regeneration step.

Every post type and taxonomy, not just the defaults

Custom post types and custom taxonomies, including ones registered by other plugins, appear as their own configurable options.

Respects noindex from other SEO plugins

A post marked noindex in Yoast or RankMath gets excluded automatically, so the sitemap never contradicts another plugin's own settings.

Self-updating, down to what actually changed

Editing a post clears only that post type's cache, not the entire sitemap, so search engines see fresh content without unnecessary regeneration elsewhere.

Verified feature set

Complete coverage, engineered carefully

Every capability below is present in the supplied PHP class and its settings registration.

Automatic sitemap splitting

500 URLs per file, indexed together

Once a post type or taxonomy passes 500 entries, the module automatically splits it into multiple numbered sitemap files, all listed in the index.

500-URL paginationMatches sitemap protocol limits
Yoast and RankMath noindex respected

Never contradicts another plugin's SEO settings

A post flagged noindex through either plugin's own postmeta is excluded from the sitemap query directly, at the database level.

_yoast_wpseo_meta-robots-noindexrank_math_robots
Per-post exclusion control

A checkbox right on the editor screen

Any individual post or page can be excluded from the sitemap through a dedicated meta box, without affecting anything else in that post type.

_towp_sitemap_excludeNonce-verified save
Granular, targeted cache invalidation

Only what actually changed gets cleared

Saving a post clears that post type's cache, its taxonomies' caches if term counts might have shifted, and author caches only if that setting is active, rather than wiping everything.

Scoped transient clearingsave_post, saved_term hooks
A single canonical robots.txt directive

Existing Sitemap lines removed first

Any prior Sitemap directive in robots.txt, including WordPress core's own default, gets removed before this module's own line is added, avoiding duplicate or conflicting entries.

robots_txt filterSingle canonical Sitemap line
Practical use cases

Where a complete sitemap helps most

The module supports any site whose content goes beyond a handful of standard pages and posts.

Sites built on custom post types and taxonomies

Get a sitemap that actually reflects what the site is built around, not just its posts and pages.

Sites that publish frequently and want fast discovery

Keep search engines pointed at current content without waiting for a manually triggered sitemap rebuild.

Large sites with content spread across many URLs

Let the sitemap split itself automatically as the site grows, instead of hitting an unexpected limit in a single file.

Operational benefits

Accurate, complete, and genuinely current

The module combines broad content coverage with cache behavior built specifically around correctness.

Nothing important left outCustom post types, custom taxonomies, and author archives all get their own sitemap entries, not just the WordPress defaults.
Cache invalidation that's actually preciseA change to one post type doesn't force a rebuild of every other sitemap file, keeping the system efficient at scale.
No conflict with existing SEO settingsRespecting Yoast and RankMath's own noindex flags means this sitemap never publishes a URL another plugin has deliberately hidden.
Built to hold up at scaleBulk cache priming and batched database lookups keep sitemap generation efficient even with thousands of URLs.
Performance behaviour

Built to avoid the N+1 query trap

The verified implementation goes out of its way to batch database work rather than repeating it per item.

Bulk cache priming before the loop

Post and attachment caches get primed for an entire page of results in one or two bulk queries, avoiding a separate database hit for every single URL and image.

Batched lastmod lookups for terms and authors

The most recent modification date for every term or author on a page is fetched in one grouped query, rather than one query per entry.

Generated only when actually requested

Sitemap XML is built only when a sitemap URL is visited, cached for twelve hours, and never generated as part of a normal page load.

Security implementation

Read-only output, carefully authorized controls

The code publishes existing public content and protects the few actions that can change it.

01

A discovery mechanism, not an access control

The sitemap only lists URLs that are already publicly reachable; it doesn't expose anything a visitor couldn't already find.

02

The manual cache-clear action is properly authorized

The Flush Cache button is protected by both a nonce check and a manage_options capability check before anything gets cleared.

03

The per-post exclude checkbox is nonce-verified

Saving the exclusion setting on a post checks a nonce and the current user's edit_post capability before making any change.

04

Configuration requires the same access as any other setting

Choosing which post types and taxonomies to include happens through the standard TheOneWP settings screen, available only to an administrator.

Verified compatibility

Built directly around WordPress's own rewrite and post APIs

The supplied code integrates through APIs present in WordPress core; this page makes no compatibility claim beyond the verified implementation.

Custom rewrite rules

add_rewrite_rule()

The native WordPress function used to register the sitemap_index.xml and per-type sitemap addresses as real, routable URLs.

add_rewrite_ruleNative URL routing
Native sitemap toggle

wp_sitemaps_enabled filter

The native WordPress filter used to disable WordPress's own built-in sitemap when this module's replacement is preferred.

wp_sitemaps_enabledNative filter
Robots.txt integration

robots_txt filter

The native WordPress filter used to add a single Sitemap directive to robots.txt, after removing any existing ones.

robots_txtNative filter
Solution comparison

TheOneWP versus common alternatives

Compare the verified XML Sitemap implementation with a typical default-only sitemap.

CapabilityTheOneWP XML SitemapOther common solutions
Post type and taxonomy coverage Any registered type, including custom onesOften limited to WordPress's own default posts, pages, categories and tags
Other SEO plugin compatibility Respects Yoast and RankMath noindex automaticallySome approaches can list a URL another plugin has deliberately hidden
Cache invalidation Precisely scoped to whatever actually changedOften a full rebuild on any content change, regardless of what changed
Large-site handling Automatic splitting at 500 URLs per fileSome approaches generate one unbounded file, risking size or timeout issues
robots.txt integration A single canonical directive, duplicates removedDuplicate or conflicting Sitemap lines are a common oversight
Recommended workflow

Set up a complete sitemap in four steps

Confirm the sitemap URL loads correctly before considering the setup finished.

01

Enable XML Sitemap

Activate the module from the TheOneWP SEO settings tab.

02

Choose post types, taxonomies, and options

Select which content types, taxonomies, and extras like featured images or author archives should be included.

03

Disable the WordPress default sitemap, if replacing it

Turn on Disable WordPress built-in sitemap to avoid publishing two competing sets of addresses.

04

Visit the sitemap URL to confirm

Open the Sitemap URL shown in settings and confirm it lists the expected content, split into files as needed.

Best practices

Include only what search engines should actually find

A sitemap works best when it reflects exactly the content meant to be discovered.

01

Only include post types genuinely meant to be discovered

A post type used purely for internal data, like templates or components, may be worth leaving out of the sitemap entirely.

02

Use the per-post exclude checkbox for occasional exceptions

Rather than removing an entire post type, exclude a single page or post directly when only that one item shouldn't appear.

03

Disable the WordPress default sitemap once this one is configured

Running both at once means two different sets of addresses get published for the same content.

04

Use the manual Flush Cache button after a bulk content change

A large import or bulk edit is a reasonable moment to clear the cache immediately rather than waiting for the normal invalidation to catch up.

Common mistakes

Avoid a couple of details worth getting right

A few behaviors are easy to misunderstand the first time through.

Running two sitemaps at once without realizing it

Leaving WordPress's built-in sitemap active alongside this one publishes two different addresses for the same content; disable the default if this module is meant to replace it.

Expecting a noindexed post to reappear immediately after removing the flag

Since results are cached, a post that just had noindex removed may take up to the cache duration to appear, unless the cache is flushed manually.

Leaving every available post type checked without reviewing them

Not every registered post type is meant for public discovery; review the list rather than enabling everything by default.

Frequently asked questions

XML Sitemap FAQ

These answers come directly from the verified class and its settings registration.

What does XML Sitemap do?

It builds a sitemap index at /sitemap_index.xml with a separate sitemap for each post type, taxonomy, and author archive, kept current automatically as content changes.

Which post types and taxonomies get included?

Any registered post type or taxonomy can be included, not just posts, pages, categories, and tags; the list adapts to whatever the site actually has registered, including custom ones.

Does this respect noindex settings from Yoast or RankMath?

Yes. A post marked noindex in either plugin is automatically excluded, so the sitemap never contradicts another plugin's SEO settings.

Can I exclude a single post or page from the sitemap?

Yes. A checkbox on the post or page editor screen excludes that specific item without affecting anything else.

How is the sitemap kept up to date?

Cached output clears automatically and specifically for whatever changed, whenever a post is saved, deleted, or a term is created, edited, or deleted.

Does this work alongside WordPress's own built-in sitemap?

It can replace it. A separate toggle disables WordPress's native sitemap to avoid publishing two competing sets of addresses.

What happens with very large sites?

Sitemaps are automatically split into multiple files of up to 500 URLs each, listed together in the sitemap index, matching standard sitemap protocol limits.

Does this affect page load performance for visitors?

No. Sitemap generation only runs when a sitemap URL is actually requested, and the result is cached for twelve hours.

Can I manually clear the sitemap cache?

Yes. A Flush Cache button on the settings screen clears all cached sitemap data immediately.

Who can configure the XML Sitemap settings?

Only an administrator with access to the TheOneWP settings screen.

Stop leaving search engines to guess what's on the site.Give them a complete, self-updating sitemap.

Use XML Sitemap to cover every post type, taxonomy, and author archive, with automatic cache invalidation and compatibility with existing SEO plugin settings.