custom-fields/remove-acf-flex-layout removes one layout from a flexible-content field by its 1-based index, taking the layout’s sub-field values with it.
It is the flexible-content counterpart to removing a repeater row, and it is deliberately a separate ability: pointed at a plain repeater it refuses, rather than doing something almost right.
Before you run it
Removing a layout deletes every value inside it and cannot be undone. The call refuses without confirm: true, and later layouts shift down by one as soon as it goes.
At a glance
| Ability | custom-fields/remove-acf-flex-layout |
| Toolset | Advanced Custom Fields — toolset/acf |
| Group | Repeater & Flexible Content |
| Requires | Advanced Custom Fields Pro, plus a flexible-content field registered on the site |
| Capability | manage_options |
| Safety | Destructive — deletes stored values, and refuses to run without confirm: true |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
How it works
Indexes are 1-based and layouts after the removed one shift down. Removing several means working from the highest index downwards, or re-reading between calls.
Because a flexible-content field mixes layout types, an index alone does not tell you what you are about to delete. Read the field first and match the index to the layout name.
The confirmation gate runs before the field is touched, so a refused call changes nothing.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
target_type | string | No — defaults to post | What the value is attached to: post, user, term, comment or option. post covers pages and any custom post type. |
target_id | integer | string | Yes, for post, user, term and comment | The ID of the target. Optional for option, where it names a specific options page; omit it for the default options store. |
selector | string | Yes | Repeater or flexible-content field name (e.g. cards) or field key. |
index | integer | Yes | 1-based row index, matching ACF’s own API. The first row is 1, not 0. |
confirm | boolean | Yes — must be true | The irreversibility gate. Without it the call is refused before anything is touched. |
What comes back
| Name | Type | What it is |
|---|---|---|
removed_index | integer | The index that was removed. |
row_count | integer | How many rows remain. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present 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:
Remove the second section from page_sections on page 87 — the old pricing block.
It resolves to one call:
{
"ability": "custom-fields/remove-acf-flex-layout",
"parameters": {
"target_type": "post",
"target_id": 87,
"selector": "page_sections",
"index": 2,
"confirm": true
}
}Worth knowing
- Not idempotent — after the shift, a retry removes a different layout.
- On a plain repeater this is refused by design. Use
custom-fields/remove-acf-repeater-rowthere. - Requires ACF Pro.
Related abilities
- Get ACF Field Value — match the index to a layout name first
- Add Flexible Content Layout — put one back
- Remove Repeater Row — for a plain repeater
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category