Patch Elementor Element Text


Makes small exact-text edits inside one Elementor element, such as changing a line of code in a large HTML widget or a sentence in a long text block, without sending the whole content back. Each edit gives the exact text to find and its replacement; the text must appear exactly once unless replace_all is set. All edits are applied together, or none are if any fails, and a failed edit returns the closest matching passages. Saved under the same rules as mosmcp/elementor-element-set-content, including who may store code in an HTML widget. Read the element first with mosmcp/elementor-element-get to copy the exact text.

Also known as: apply patch, elementor-element-apply-patch, find and replace in an Elementor widget, edit part of an HTML widget, change one line of code.

Property Value
Ability slug mosmcp/elementor-element-patch
Wire tool name mosmcp__elementor-element-patch
Category Elementor (mosmcp-elementor)
Plan Free

 

Required access

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

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the post, page or Elementor template whose layout holds the element.
element_id string (min length 1) Yes — The Elementor element ID to edit, as reported when reading the layout.
field string (one of text, body) text Which text to edit: "text" is the primary text or code (an HTML widget's code, a heading's title, a text editor's body); "body" is the secondary text on widgets that have both, such as an icon box's description.
edits object[] Yes — The edits, applied in order, each to the result of the one before.
edits[].find string (min length 1) Yes — The exact text to change, copied from the element. Include enough surrounding text that it appears only once.
edits[].replace string Yes — The new text. An empty string deletes the found text.
edits[].replace_all boolean false Change every occurrence instead of requiring exactly one.
expected_modified string — Optional. The "modified" value from a previous read. The edit is refused if the post changed since then, so a concurrent edit is never overwritten.

 

Output schema

Field Type Required Description
id integer Yes
title string
status string The post status, which this ability never changes.
modified string New modified timestamp, usable as expected_modified on a following edit.
field string
control string The Elementor setting that was edited.
edits object[] Yes
edits[].edit integer Which edit, counting from 1.
edits[].match_mode string How the text was found: exact, or a tolerant rule when quotes, entities or spacing differed.
edits[].replaced integer How many occurrences were changed.
edits[].excerpt string The changed passage with some text either side, as it now reads.
length_before integer
length_after integer
changes object[]
changes[].element_id string
changes[].widget_type string
changes[].role string
changes[].control string
changes[].previous string
changes[].current string
view_url string
elementor_url string
warnings object[] Non-fatal issues encountered while running.
warnings[].code string
warnings[].message string
warnings[].context string

 


<< Previous Next >>
Move Elementor Element Preview Rendered Elementor Layout

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.