30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Invalidate Rank Math Sitemap Cache

rank-math/invalidate-sitemap-cache clears Rank Math’s cached sitemap files so the next request regenerates them.

Use scope=all after a settings change, scope=type for one sitemap type, or scope=post with a post ID for a single entry.

At a glance

Abilityrank-math/invalidate-sitemap-cache
ToolsetRank Math — toolset/rank-math
GroupRank Math › Sitemaps & llms.txt
RequiresRank Math SEO, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The response reports cache_enabled, and that field is the one to read first. When caching is off, the sitemap is generated on every request and this call did nothing — which is a useful thing to know before spending time wondering why clearing the cache did not fix anything.

The scopes exist because regeneration is not free. A full sitemap regeneration on a site with a hundred thousand posts is real work, and clearing everything to fix one post is wasteful in the same way a full cache purge is.

After a settings change, scope=all is correct — the change affects which files exist, not just their contents.

Idempotent, and cheap when nothing is cached.

Input

NameTypeRequiredWhat it is
scopestringNo — defaults to allall, type or post.
post_idintegerRequired for scope=postThe post to clear.
typestringRequired for scope=typeThe sitemap type to clear.

What comes back

NameTypeWhat it is
clearedbooleanWhether anything was cleared.
cache_enabledbooleanWhether sitemap caching is on. When false, this call was a no-op.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

I changed the sitemap settings — make them take effect.

It resolves to one call:

{
  "ability": "rank-math/invalidate-sitemap-cache",
  "parameters": {
    "scope": "all"
  }
}

Worth knowing

  • Read cache_enabled. When it is false this call did nothing, correctly.
  • Use the narrowest scope that fixes the problem.
  • A settings change needs scope=all.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading