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

Start free trial

Update Rank Math Sitemap Settings

rank-math/update-sitemap-settings writes Rank Math sitemap settings: items per page, image inclusion and the post and term exclusion lists under scope=general, or whether a given post type or taxonomy appears in the XML and HTML sitemaps under scope=post-type and scope=taxonomy.

This changes configuration only. Follow it with rank-math/invalidate-sitemap-cache for the change to appear.

At a glance

Abilityrank-math/update-sitemap-settings
ToolsetRank Math — toolset/rank-math
GroupRank Math › Settings
RequiresRank Math SEO, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The cache is the reason for the second step. When sitemap file caching is on, the served sitemap is whatever was generated last, and a configuration change does not regenerate it.

So a post type excluded here keeps appearing in the served sitemap until the cache is cleared — which looks exactly like a setting that did not save.

Excluding a post type from the sitemap is not the same as noindexing it. The sitemap is a suggestion about what to crawl; the robots directives decide what gets indexed. A page removed from the sitemap and still linked from the site will still be found.

Items per page matters on large sites: too many and the sitemap files become slow to generate and large to fetch; too few and there are thousands of them.

The exclusion lists take IDs. A post excluded by ID stays excluded even if it moves post type.

Submitting a field that does not belong to the panel rejects the whole write, so rank-math/get-settings comes first: it lists the field IDs the panel accepts, with their types, allowed values and bounds.

Input

NameTypeRequiredWhat it is
scopestringYesgeneral, post-type or taxonomy.
objectstringRequired for post-type and taxonomy scopesWhich post type or taxonomy.
settingsobjectYesA map of field ID to value.

What comes back

NameTypeWhat it is
updatedarrayThe fields that changed.
settingsobjectThe scope after the write.
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:

Take products out of the sitemap.

It resolves to one call:

{
  "ability": "rank-math/update-sitemap-settings",
  "parameters": {
    "scope": "post-type",
    "object": "product",
    "settings": { "pt_product_sitemap": "off" }
  }
}

Worth knowing

  • Clear the sitemap cache afterwards or the change will not appear.
  • Sitemap exclusion is not noindex. A linked page is still found.
  • Exclusion lists take IDs.
  • Items per page is a real trade-off on large sites.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading