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

Start free trial

Remove Flexible Content Layout

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

Abilitycustom-fields/remove-acf-flex-layout
ToolsetAdvanced Custom Fields — toolset/acf
GroupRepeater & Flexible Content
RequiresAdvanced Custom Fields Pro, plus a flexible-content field registered on the site
Capabilitymanage_options
SafetyDestructive — deletes stored values, and refuses to run without confirm: true
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI 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

NameTypeRequiredWhat it is
target_typestringNo — defaults to postWhat the value is attached to: post, user, term, comment or option. post covers pages and any custom post type.
target_idinteger | stringYes, for post, user, term and commentThe ID of the target. Optional for option, where it names a specific options page; omit it for the default options store.
selectorstringYesRepeater or flexible-content field name (e.g. cards) or field key.
indexintegerYes1-based row index, matching ACF’s own API. The first row is 1, not 0.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
removed_indexintegerThe index that was removed.
row_countintegerHow many rows remain.
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:

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-row there.
  • Requires ACF Pro.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading