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

Start free trial

Set Rank Math Module State

rank-math/set-module-state enables or disables one Rank Math module.

It also refreshes rewrite rules and fires Rank Math’s module-changed action, which is what makes it a repair as well as a toggle.

At a glance

Abilityrank-math/set-module-state
ToolsetRank Math — toolset/rank-math
GroupRank Math › Modules & Permissions
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

The two steps a plain toggle skips

Flipping the module option is the easy part. The sitemap and llms.txt modules register rewrite rules, and those rules only exist once they have been flushed into the persisted rules — so a module switched on without that step reports itself active and its route returns 404.

The module-changed action is the other step. Several parts of Rank Math listen for it to set up or tear down their own state, and a module toggled without firing it ends up half configured.

Both together are why toggling the sitemap module off and on is the standard fix for a sitemap that 404s. It is not superstition — it is the flush.

Discover the available slugs with rank-math/list-modules, which also marks the modules that cannot be enabled on this install.

Disabling a module does not delete its data. Redirections survive the redirections module being switched off; they simply stop being applied.

Idempotent.

Input

NameTypeRequiredWhat it is
modulestringYesThe module slug, from rank-math/list-modules.
enabledbooleanYesWhether the module is on.

What comes back

NameTypeWhat it is
modulestringThe module changed.
enabledbooleanIts state afterwards.
rewrite_rules_refreshedbooleanWhether rules were flushed.
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:

Turn the sitemap module off and on to fix the 404.

It resolves to one call:

{
  "ability": "rank-math/set-module-state",
  "parameters": {
    "module": "sitemap",
    "enabled": true
  }
}

Worth knowing

  • Refreshes rewrite rules, which is why it fixes sitemap and llms.txt 404s.
  • A plain option toggle would not do either extra step.
  • Disabling keeps the module’s data.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading