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

Start free trial

Remove Repeater Row

custom-fields/remove-acf-repeater-row deletes one row from a repeater or flexible-content field by its 1-based index, and renumbers what is left.

It goes through ACF’s own row deletion, so the row’s sub-field meta goes with it rather than being left orphaned under an index that no longer exists.

Before you run it

Removing a row deletes its values outright and cannot be undone. The call refuses without confirm: true. Indexes shift the moment a row goes, so an index you read a minute ago may now point at a different row — re-read the field if anything else could have changed it.

At a glance

Abilitycustom-fields/remove-acf-repeater-row
ToolsetAdvanced Custom Fields — toolset/acf
GroupRepeater & Flexible Content
RequiresAdvanced Custom Fields Pro, plus a repeater 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

Rows after the removed one shift down by one. Removing rows 2 and 4 in that order removes the wrong second row: by the time the second call runs, what used to be row 5 is sitting at index 4.

The fix is to work from the highest index downwards, or to re-read the field between calls. There is no batch form precisely because the renumbering makes a batch ambiguous.

The confirmation gate runs before the field is touched, so a refused call leaves the site exactly as it was.

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:

Delete the third card from the features repeater on page 87.

It resolves to one call:

{
  "ability": "custom-fields/remove-acf-repeater-row",
  "parameters": {
    "target_type": "post",
    "target_id": 87,
    "selector": "features",
    "index": 3,
    "confirm": true
  }
}

Worth knowing

  • Not idempotent — a retry removes a different row, because the one you meant is gone and everything after it has moved up.
  • Clearing every row at once is a different ability: custom-fields/delete-acf-field empties the whole field.
  • Requires ACF Pro.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading