Bulk-update user profile fields

UsersIntermediate~15 min

Before you start

A connected site with user reads on, plus the update-user and update-user-meta write abilities enabled. Take a database backup before a large run.

After a few years and a few contributors, the author profiles on a site drift. Display names that are really email prefixes, empty bios where an author box expects one, a profile field half your team filled in and half ignored. Fixing it one profile at a time is the kind of chore that never reaches the top of the list.

This hands the reading and the drafting to the agent and keeps the approving with you.

The prompt
I want to tidy up the profiles for [the authors in the Editor and Author
roles]. Change nothing without my say-so.
First pass: list those users and read their current display name, email, bio,
and [the "job title" profile field]. For the first [10], hand me a table with
the current values beside a suggested cleanup, following [First Last for display
names]. Leave anything that already looks right alone.
I will tell you which to keep. Only after I say so, write the approved changes
back, display name and email through the user update and the profile fields
through user meta, in small batches, showing me each batch before it saves. Do
not change anyone's role. At the end, list every account you touched.

Why this is safe to run

The whole first pass is reads. Listing the users and reading their profiles writes nothing, so you see every proposed change as a table before a single value is saved.

The write half is deliberately narrow. Editing a profile reaches display name, name, and email, and the profile-meta write only touches allowlisted scalar keys. Authentication, capability, and two-factor keys are blocked outright, so this cannot alter anyone’s access, and changing a role is a separate ability gated behind the promote-users capability that this recipe never calls. Every write ability here stays off until you enable it, each call is checked against the capability of the user you bound the agent to, and every write lands in the Activity Log with the account it changed. If a bio reads wrong, the log tells you exactly which profile to open.

Already connected? You do not have to paste this at all. Ask your agent for the “bulk-update user profile fields” recipe, or just describe the cleanup, and it runs the same two-pass flow on your own accounts.

How it works

  1. List the users in the group you name and read their current profile fields.
  2. Show a before-and-after table for a small sample and wait for your approval.
  3. Write the approved display name and email changes through the update-user ability.
  4. Write the approved profile meta values through the update-user-meta ability, one allowlisted key at a time.
  5. Work through the rest in small batches, pausing to show each batch, and return every account it changed.

Questions

Can this change someone's role or password?
No. Editing profile fields here covers display name, name, and email, plus allowlisted profile meta. Changing a role is a separate ability behind the promote-users capability, and no ability here can read or set a password or any authentication secret.
Which profile meta can it write?
Only allowlisted, scalar profile meta, and never authentication, capability, or two-factor keys. Those are blocked outright, so a bulk profile tidy-up cannot reach anything that governs access.