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
| Ability | seo/invalidate-sitemap-for-post |
| Toolset | Yoast SEO — toolset/yoast-seo |
| Group | Yoast SEO › XML Sitemaps |
| Requires | Yoast SEO, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI 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
| Name | Type | Required | What it is |
|---|---|---|---|
post_id | integer | Yes | The post. |
What comes back
| Name | Type | What it is |
|---|---|---|
cleared | boolean | Whether a cache entry was cleared. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present 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
- Invalidate Sitemap Cache — the broader version
- Get Sitemap Status — check sitemaps are on at all
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category