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

Start free trial

Update ACF Block Data

blocks/update-acf-block-data patches the field values of one ACF block already sitting in a post, addressed by its position in the block tree.

It merges by default: the fields you name change, the ones you do not keep their values. Pass replace: true when you genuinely want to overwrite the whole payload.

At a glance

Abilityblocks/update-acf-block-data
ToolsetAdvanced Custom Fields — toolset/acf
GroupACF Blocks
RequiresAdvanced Custom Fields Pro
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

Blocks are addressed by path — an array of 0-based indexes walking down the tree. [2] is the third top-level block; [1, 0] is the first block nested inside the second. Get the path from blocks/outline-post-blocks, which stays cheap even on a long post.

A path that does not point at an ACF block is refused, with the error naming blocks/update-post-block for ordinary ones. That refusal is deliberate: writing an ACF payload onto a core block would produce markup neither one can read.

Merging is what makes the call idempotent. Sending the same patch twice leaves the same state, so a retry is safe.

Input

NameTypeRequiredWhat it is
post_idintegerYesThe post holding the block.
patharray of integersYesBlock path as reported by blocks/outline-post-blocks, e.g. [2] or [1, 0].
dataobjectYesField name => new value.
replacebooleanNoReplace the whole data payload rather than merging into it. Defaults to false.
apply_wp_slashbooleanNo — defaults to trueRuns wp_slash() over your strings before writing, so literal backslashes survive. Set it false only when you have already slashed the payload yourself.

What comes back

NameTypeWhat it is
post_idintegerThe post that was written.
dataobjectThe block’s data payload 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:

Update the quote on the testimonial block that’s third from the top of post 412.

It resolves to one call:

{
  "ability": "blocks/update-acf-block-data",
  "parameters": {
    "post_id": 412,
    "path": [2],
    "data": {
      "quote": "We shipped in a week instead of a quarter — twice."
    }
  }
}

Worth knowing

  • Find the path first. Guessing at an index edits the wrong block, and the call cannot tell the difference.
  • replace: true clears every field you do not name. Use it when you want a known state, not as a default.
  • Requires ACF Pro.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading