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

Start free trial

Invalidate Sitemap For One Post

seo/invalidate-sitemap-for-post clears the sitemap cache entry covering one post, rather than the whole sitemap.

It is the call after a single edit made outside the normal path, so a large site does not rebuild every sitemap page.

At a glance

Abilityseo/invalidate-sitemap-for-post
ToolsetYoast SEO — toolset/yoast-seo
GroupYoast SEO › XML Sitemaps
RequiresYoast 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

Sitemaps are paginated, and a post lives on exactly one page of one type’s sitemap. Clearing that page is enough; clearing the rest achieves nothing and costs a regeneration each.

On a site with a few thousand URLs the difference is negligible. On one with hundreds of thousands it is the difference between one query and a hundred.

The situations that call for it are the same as for the broader clear, scoped down: a post updated by a direct database write, an import that touched one item, a script that changed a slug.

A post edited normally in WordPress invalidates its own cache page already, so this is for the writes that bypass that.

Idempotent.

Input

NameTypeRequiredWhat it is
post_idintegerYesThe post.

What comes back

NameTypeWhat it is
clearedbooleanWhether a cache entry was cleared.
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:

We changed post 412 through the database — update the sitemap.

It resolves to one call:

{
  "ability": "seo/invalidate-sitemap-for-post",
  "parameters": {
    "post_id": 412
  }
}

Worth knowing

  • A post lives on one sitemap page. Clearing the rest is wasted work.
  • Normal WordPress edits already invalidate the right page.
  • For direct writes, imports and slug changes made outside WordPress.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading