GoBuildWP

Custom dataPro

ACF MCP: read schemas, write field values, edit field groups

This ACF MCP workflow and requirements guide covers how an AI client works with Advanced Custom Fields through GoBuildWP Pro: it fetches a field group in ACF's own export shape, writes values through update_field, and manages the post types, taxonomies and options pages ACF registers. It also covers the two things that trip agents up most often: repeaters that replace their whole value, and groups that live in PHP where nothing at runtime may touch them.

AI clientyour-site.comVerify site policy

Add a Chapters repeater (title and page count) to the Book Details group, then fill three chapters on book 812.

  1. wppilot/acf-check-setupRead

    Confirms edition pro: repeater is one of the types ACF Free refuses with invalid_payload.

  2. wppilot/acf-get-fieldgroup-schemaRead

    Returns the group in native export format, keys included, to use as the edit template.

  3. wppilot/acf-edit-fieldgroupConfirm first

    Sends the full fields array with the new repeater appended; a field missing from that array would be removed.

  4. wppilot/acf-write-valuesConfirm first

    Writes chapters as {value: [...], mode: "replace"} on target post 812; each top-level value passes acf_validate_value first.

  5. wppilot/acf-read-valuesRead

    Reads the rows back, formatted, to confirm three chapters are stored.

Proposed sequence from source declarations; not a recorded task or proof of client compatibility. Inspect saved state and browser or provider results separately.
Edition
Pro
Abilities
23
Requires
WordPress 6.9+, PHP 8.0+, Advanced Custom Fields 6.5.0+

Data model

Where ACF keeps definitions and values

A field group in the database is not one record. ACF saves an acf-field-group post plus one acf-field post per field, and the post types, taxonomies and options pages it manages are internal posts too (acf-post-type, acf-taxonomy, acf-ui-options-page). When the theme has an acf-json folder, ACF also writes a JSON copy every time one of those is saved. A group registered with acf_add_local_field_group() exists only in code. The list abilities label each item db, json or php, and mark the php ones editable: false.

Values sit wherever WordPress keeps metadata for the object: post meta for a post, term meta for a term, user meta for a user. Options pages are the odd case. Their values go to wp_options under the page's post_id, and ACF gives every options page the shared id "options" unless one was set, so the menu slug is usually the wrong address.

For an agent this means reading the source before touching a schema. A PHP group has to be changed in its file (read-file and edit-file), a JSON group can be edited because ACF re-syncs the file, and changing a field's key leaves the old values in the database where the ACF API no longer finds them.

Worked example

Adding a repeater to a live field group

Expected outcome to verify on the installed stack; this sequence has not been recorded as a runtime test.

Book 812 shows three chapters in the editor. The value write can be rolled back from the change log because the target is a post; the group edit cannot, since restoring one post would not bring back the per-field posts. A group that turns out to be PHP-registered stops the task at the edit with field_group_not_editable.

No ACF-native enable toggle is needed for this workflow, but WordPress capabilities and GoBuildWP policy still apply. Inspect the template rendering and any hook-dependent effects after value readback.

  1. acf-check-setup

    Confirms edition pro: repeater is one of the types ACF Free refuses with invalid_payload.

  2. acf-get-fieldgroup-schema

    Returns the group in native export format, keys included, to use as the edit template.

  3. acf-edit-fieldgroup

    Sends the full fields array with the new repeater appended; a field missing from that array would be removed.

  4. acf-write-values

    Writes chapters as {value: [...], mode: "replace"} on target post 812; each top-level value passes acf_validate_value first.

  5. acf-read-values

    Reads the rows back, formatted, to confirm three chapters are stored.

Limits

What ACF writes refuse, and what stays undoable

  • Repeater, flexible content, gallery, clone and group values must be wrapped as {value, mode: "replace"}. One unwrapped complex value rejects the whole batch before anything is written.
  • Only value writes addressed to a post can be restored with rollback-change. Term, user, comment and options values, field group edits and every delete are logged without a before-image.
  • Pre-flight validation checks top-level fields only; a required sub-field inside a repeater row is not checked until someone submits the ACF form.
  • Direct update_field calls do not fire acf/save_post, so anything that listens there (cache busting, sync, audit logs) does not run after an agent write.
  • ACF Blocks are not a supported target, and deleting a post type or taxonomy that still has content needs force: true, leaving those posts or terms orphaned rather than deleted.

Other plugins

ACF's own AI abilities and bulk writes

  • Recent ACF releases add their own acf/* abilities, which need a filter plus an "Allow AI Access" toggle on each item and create one set of content abilities per post type. They do not cover options pages. The GoBuildWP abilities need no opt-in and use one target shape for every object type; both can be active together.
  • Setting the same field on many posts goes through fields-bulk-update-values with provider acf: up to 100 posts per call, a dry run showing current and planned values, then confirm: true. Each post gets its own undo entry.
  • Dynamic tags inside Elementor or Bricks templates belong to those builders' abilities, not to the ACF module.

Running ACF with an agent

Before the ACF MCP connection writes anything

The ACF module ships in GoBuildWP Pro and loads only when Advanced Custom Fields 6.5.0 or newer is active. Nothing in it is mirrored into GoBuildWP Free, so a Free-only site sees none of the acf- abilities in its tool list. Start the first session with acf-check-setup: it tells the agent whether the site runs ACF or ACF Pro, which version, and how many ACF-managed post types, taxonomies and options pages already exist. That one answer decides what the rest of the session may attempt, because a payload containing a repeater, flexible content, gallery or clone field is refused with invalid_payload when ACF Pro is not the active edition.

Then decide where schema changes belong. If the theme ships an acf-json folder that lives in version control, a field group edited on production rewrites a JSON file the repository does not know about, and the next deploy can put the old definition back. On those sites, run acf-create-fieldgroup and acf-edit-fieldgroup on staging, commit the JSON ACF writes there, and keep production work to value reads and writes. The create ability reports whether ACF synced the group to local JSON, which is the quickest way to learn which kind of site you are on.

  • Read Only profile: setup check, every list and get ability, and acf-read-values. Enough for an audit.
  • Production Safe (the default): adds value writes and definition edits; the destructive ones still ask for confirmation.
  • Use a dedicated WordPress identity with manage_options, or a super admin on multisite, for the ACF connection. An ordinary editor role is insufficient; narrow the credential scope and enabled abilities to the work agreed.

Raw values, formatted values and the empty-field trap

acf-read-values formats by default, so an image field comes back as an array of sizes and a post object field as the expanded post. That is right for describing content and wrong for copying it: when an agent reads one post to write another, it should read with format_values set to false and send back the stored form, which for relational and media fields is usually an ID.

The second trap is ACF's default value. get_field returns a field's default for a post that has never been saved with it, so a brand-new post can look fully populated. When the task is finding gaps, such as products missing a spec sheet or team members without a job title, read with only_with_values: true and treat anything absent as genuinely empty. That pairing is the basis of most clean-up jobs on ACF sites.

Jobs ACF site owners hand to an agent

Most requests are about values on content that already exists, with a field group change now and then. These are the shapes that fit the abilities as built:

  • Fill a missing field across a post type: read with only_with_values to list the gaps, then fields-bulk-update-values with provider acf and dry_run true, review current and planned values, and confirm. Each post gets its own undo entry.
  • Copy a field group to another site: acf-get-fieldgroup-schema on the source returns the export shape with keys, and acf-create-fieldgroup on the target accepts it unchanged. Keeping the keys means content imported later still lines up; the create refuses if that key already exists there.
  • Move company details into an options page: acf-create-options-page, then write the phone number and address with target type options and the page's post_id, not its menu slug.
  • Retire a post type: list its posts first and decide what happens to them, because acf-delete-post-type with force leaves them in the database under a type nothing registers.

Prompts that map cleanly onto ACF

Name the field group and the target object, and say whether existing rows must survive. 'Add a Download URL field after Spec Sheet in the Product Details group, keep every existing field and key' gives the agent what acf-edit-fieldgroup needs: the full fields array with one addition. 'Clear the testimonials' is the kind of request to rephrase, since on a repeater it becomes a replace write that removes every row; ask for the rows to be listed first and say which to keep.

After any group edit, open one affected post in the editor and one front-end template that prints the field. The ability confirms what ACF stored; only the template shows whether the theme reads it the way you expect.

Questions

Advanced Custom Fields questions

Can an AI agent edit ACF field groups that were registered in PHP?

No. Those groups come back with source php and editable: false, and the edit and delete abilities refuse them with field_group_not_editable. The agent can read them, but a change means editing the file that calls acf_add_local_field_group().

Why did my repeater write fail with every field untouched?

A complex field was sent without the {value, mode: "replace"} wrapper. Because a repeater write replaces every row, the ability rejects the whole batch rather than silently deleting rows. Read the current rows, change your copy, and send the full array back.

Which id do I use for an ACF options page?

Its post_id, not its menu slug. Unless the page set its own, that is the shared "options" store; acf-get-options-page shows which one is configured.

Should I switch on ACF's built-in AI access instead?

Use it if you want per-item opt-in or one content ability per post type. Use the GoBuildWP abilities for options pages, for the same value shape across ACF, Meta Box, Pods and the others, or on an ACF release that predates the native integration.

ACF documents its own Abilities API integration. In GoBuildWP, field definitions and field values have separate operations; preserve field keys and inspect replacement semantics before changing complex values. ACF Abilities API documentation

Where these facts come from

GoBuildWP behaviour is taken from the plugin source and the ability reference; third-party details from the vendor documentation below, checked by the GoBuildWP team.

Advanced Custom Fields is a separate product; no partnership or endorsement is implied.

Try it on Advanced Custom Fields in Read Only first