Governed ability

Replace in post

aafm/replace-in-postGuarded write

Replace in post is a governed ability in Agent Abilities for MCP, a free WordPress plugin that runs an MCP server on your site.

Literal find-and-replace inside a post's content. Sanitizes the replacement text and edits only the replaced spans of the body; untouched content is left byte-for-byte as it was, and status is never touched. Matches literal text only: markdown such as [text](url) is inserted as typed, not turned into a link, and text inside markup (an href, src or other attribute) is refused, so use replace-block or update-post for links, src and markup. Reaches a page, product, event, venue, organizer or listing only while that type's own tool is on. With WordPress revisions enabled, later edits can be compared and restored from revision history; a post with no earlier revisions has no earlier copy to restore, so keep the old text. While change history is on, undo-change or the Changes tab can also revert this change. Refuses when the post is owned by a foreign page builder (Elementor, Divi, Beaver Builder, Avada, Visual Composer, Oxygen, Breakdance, Brizy, Bricks, and WPBakery), since a write here would either have no visible effect or corrupt its own stored markup.

How it is governed

The same model as every ability in the plugin, stated for this one.

  • Off until you enable it

    Like every ability, Replace in post ships switched off. You turn it on one at a time, and an update never switches on a tool it serves.

  • Guarded write

    Writes stay conservative, and the plugin re-checks the capability before the call runs.

  • Capability gated

    A connection only sees Replace in post if the user you connected can run it, and the plugin checks that capability again before it executes.

  • Every call audited

    The call is written to the log in your own database, denials included, with the argument keys and the identifiers it touched, never free-text content.

Replace in post is one of the 30 governed Content abilities. Browse the other Content abilities in the catalog.

See it in action

An illustrative run. Your real calls and data stay on your own site.

agent-abilities · auditGoverned
YouReplace in post on this site.
RunRunning aafm/replace-in-post
GateAllowedcapability re-checked before running
Auditaafm/replace-in-post · principal: editor · args: post_id
ResultApplies the change, then writes the call to the audit log.

Try it with a prompt

Example requests you could paste to your agent.

  1. In post 142, replace every 2024 with 2025.
  2. Swap the phrase old company name for new name in post 88.
  3. Find and replace beta with general availability in that post's body.

These are illustrative example prompts. The agent runs them as the user you connected, checked against that user's capabilities and written to your audit log.

Frequently asked

Short answers for Replace in post.

Does it touch anything besides the body?

No, Replace in post edits only the content and never changes status. The result is sanitized.

Can I undo it?

Yes, while change history is on. The Changes tab reverts the edit if the post has not been edited since. WordPress also saves revisions, but a first edit to a post with no earlier revisions leaves only the new text. It is off by default, requires edit access, and is logged.

Replace in post is one of the 25 tools the Changes tab records. Undo what an AI agent changed lists them all, and what cannot be undone.

Back to all abilities

Governed by default, from the first call.

Replace in post is off until you enable it, scoped to the user you connect, and logged like everything else. Turn on only what you need.

Every ability off until you enable it, capability-gated on every call.