rank-math/update-robots-txt replaces the contents of Rank Math’s virtual robots.txt.
It refuses the write, with the reason, when a physical robots.txt exists on disk or when the site is not public.
At a glance
| Ability | rank-math/update-robots-txt |
| Toolset | Rank Math — toolset/rank-math |
| Group | Rank Math › Settings |
| Requires | Rank Math 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 |
Two conditions that make the write pointless
A physical robots.txt at the web root is served by the web server and never reaches WordPress. The virtual one Rank Math generates is simply not consulted.
So writing it while a physical file exists produces a stored value that nothing serves — a successful write with no effect, and one that is genuinely hard to spot, because reading the setting back shows exactly what you wrote.
The second condition is the search-engine visibility setting. With the site marked non-public, WordPress serves a robots.txt that disallows everything, regardless of what Rank Math holds. Again the write succeeds and again nothing changes.
Both are refusals rather than warnings, because in both cases the write is not merely risky — it does nothing at all, and reporting success would be a lie.
Read the current content and state with rank-math/get-settings and panel=general-robots-txt.
The content replaces what is there. There is no append.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
content | string | Yes | The complete robots.txt content. Replaces what is stored. |
What comes back
| Name | Type | What it is |
|---|---|---|
content | string | The stored content after the write. |
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:
Add a crawl-delay to our robots.txt.
It resolves to one call:
{
"ability": "rank-math/update-robots-txt",
"parameters": {
"content": "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php"
}
}Worth knowing
- A physical file on disk wins. The write is refused rather than silently ignored.
- A non-public site serves a disallow-everything file regardless.
- Replaces the content entirely — read it first if you mean to append.
- Idempotent.
Related abilities
- Get Rank Math Settings — read the current content and state
- Get Rank Math Status — the wider diagnostic picture
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category