Update Block Text


Changes the text of one block, such as a heading, paragraph, list item, button label, quote citation or image caption, keeping its styling, classes and settings exactly as they are. Inline formatting is allowed (bold, italic, links, line breaks); separate paragraphs need separate blocks. Every other block on the page is left byte for byte as it was, and WordPress keeps a revision of the previous version. Use the path from mosmcp/block-list or mosmcp/block-find. It changes words only: to change where a button or link goes, a heading's size, alignment or colour, rewrite the block with mosmcp/block-replace.

Also known as: change heading, edit paragraph, rename button, change button text, edit text on page, update caption.

Property Value
Ability slug mosmcp/block-update-text
Wire tool name mosmcp__block-update-text
Category Block Editor (mosmcp-blocks)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — ID of the post, page, custom post item or synced pattern.
path string Yes — The block's path, such as "0" (first block) or "2.1" (second block inside the third), from mosmcp/block-list or mosmcp/block-find.
text string Yes — The new text. Inline HTML such as <strong>, <em>, <a href> and <br> is allowed. HTML is saved the way the WordPress editor saves it: a user with the unfiltered_html capability can save any markup, including forms, scripts and styles, and markup a user is not allowed to save is refused with the reason rather than silently removed. Backslashes are kept.
field string (one of text, caption, citation) text Which text to change: "text" (the main text), "caption" (images, video, audio, embeds, tables) or "citation" (quotes). mosmcp/block-list shows each block's fields.
expected_modified string — The "modified" value from your last read. When given, the change is refused if the content has changed since, so a stale path can never hit the wrong block.
expected_block string — The block type you expect at the path, such as "heading". When given, the change is refused if a different block is there.

 

Output schema

Field Type Required Description
id integer Yes
post_type string
title string
status string
modified string Yes Last-modified time. Pass it as expected_modified on your next change.
view_url string Public address, when published.
preview_url string Preview address for unpublished content, for signed-in editors.
edit_url string
path string Yes
block string Yes
field string
previous string Yes The text before the change.
current string Yes
changed boolean Yes False when the content already matched and nothing was saved.
revision_id integer Revision holding the previous version, for mosmcp/revision-restore; 0 when none was made.
warnings object[] Non-fatal issues encountered while running.
warnings[].code string
warnings[].message string
warnings[].context string
notes string[]

 


<< Previous Next >>
Update Block Settings Add Additional Role to User

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.