Bulk-populate an ACF field from a spreadsheet

ContentAdvanced~30 min

Before you start

Advanced Custom Fields active, content reads on, and the ACF write ability enabled for the write pass. The agent needs edit access to the posts it changes. Have your values ready with a post ID for each row.

Custom field data tends to live in a spreadsheet long before it lives on the site. Someone keeps a tidy sheet of subtitles, prices, or reference codes, and then the job of typing each one into its ACF box gets put off because it means opening every post.

This hands the typing to the agent and keeps the deciding with you. Because the recipe works by post ID, your sheet just needs a column with the ID and a column with the value.

The prompt
I keep [a spreadsheet of subtitles] for my [team member] profiles and I want to
load them into the ACF field on each one. I will paste the rows below, and every
row has the post ID in the first column and the value in the second.
Do the reading first and change nothing yet. Show me the ACF field groups so we
agree on the exact field, then read the current value of [subtitle] on each post
ID in my list and give me a table: post ID, current value, and the value I gave
you. Flag any row where a value already exists so I do not clobber something by
accident.
I will tell you which rows to write. Only after I say go, write the approved
values in small batches and show me each batch before it saves. Keep a running
list of every post ID you changed and what it went from and to, so I can undo any
single one by writing the old value back.

Why this is safe to run

Everything up to your approval is reads. Listing the field groups and reading each post’s current value writes nothing, so the whole plan arrives as a table before a single field is saved, with the already-filled rows called out so you never overwrite by surprise.

The write half touches only the one ACF field you named, on only the post IDs in your list, and never the post body, its status, or any other field. The ACF write ability stays off until you turn it on, every call is checked against the capability of the user you bound the agent to, and every write lands in the Activity Log with the post it changed. Because the read pass captured the old values, undoing any row is just writing that old value back.

Already connected? You do not have to paste this. Ask your agent for the “bulk-populate an ACF field from a spreadsheet” recipe, or just describe the job, and it runs the same read-first flow on your own site.

How it works

  1. List the ACF field groups so you and the agent agree on the exact field.
  2. Read the current value of that field on each post ID in your list.
  3. Show a table of post ID, current value, and your new value, flagging any cell that is already filled.
  4. Wait for your approval, then write the values in small batches, pausing to show each batch.
  5. Return every post ID it changed with the old and new value so any single one can be undone.

Questions

Can this create the ACF field or field group for me?
No. It reads the field groups you already built in ACF and writes values into an existing field. It never creates or edits a field group, only the stored values.
What if a post already has a value in that field?
The read pass flags every row where a value already exists, so you see the clash before anything saves and decide whether to overwrite it.