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

Start free trial

Update Rank Math robots.txt

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

Abilityrank-math/update-robots-txt
ToolsetRank Math — toolset/rank-math
GroupRank Math › Settings
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

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

NameTypeRequiredWhat it is
contentstringYesThe complete robots.txt content. Replaces what is stored.

What comes back

NameTypeWhat it is
contentstringThe stored content 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:

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 the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading