Import users from a spreadsheet with the right roles

UsersIntermediate~15 min

Before you start

A connected site whose bound user holds the create-users and promote-users capabilities, with the create-user, update-user, and user-meta write abilities enabled. All three are off by default.

Onboarding a batch of people usually means clicking through the Add User form once per person, then going back to fix everyone’s role and profile fields. By the tenth row you have lost the thread. This hands the typing to the agent and keeps every account it opens under your eye.

The prompt
I'm going to paste a spreadsheet of people who need accounts on this site.
Change nothing until I approve the plan.
First, parse what I paste into a clean table: one row per person, with the
name, email, the role I asked for in the [Role] column, and any extra fields
I mapped like [company] or [job title]. Show me that table and flag anything
that looks off, a missing email or a duplicate, before you create anyone.
Once I say go, create the accounts a few at a time. Every new account starts
on the site's default role, so nobody lands with more access than that. For
the people I marked for a higher role, raise them in a separate step that I
approve, and never touch the last administrator. Then write the extra profile
fields as user meta.
When you're done, give me back the full list: who you created, their final
role, and anything you skipped.

Why this is safe to run

The first pass is all parsing and shows you a table, so you see exactly who would be created before a single account exists. Then the creating and the role-raising are two different abilities with two different switches. Creating a user always uses the site default role, so even if your spreadsheet says “administrator” in a column, the account does not come out as one. Promoting someone to a higher role is a second, promote-gated step you approve per person, and the plugin will not let it demote the last administrator. Every account and every role change is checked against the capability of the user you bound the agent to, and each one lands in the Activity Log.

Already connected? You do not have to paste this at all. Ask your agent for the “import users from a spreadsheet” recipe, hand it your sheet, and it runs the same approve-first flow on your own site.

How it works

  1. Parse the spreadsheet you paste into a clean table of the people to create.
  2. Show you that table and flag missing emails or duplicates before creating anyone.
  3. Create the accounts a few at a time, each on the site default role.
  4. For anyone marked for a higher role, raise it as a separate step you approve.
  5. Write the extra profile fields you mapped as user meta.
  6. Return the full list of who was created and their final role.

Questions

Can the agent create an administrator this way?
No. Every account is created on the site default role, never a role the prompt asks for. Raising someone higher is a separate step that needs the promote-users capability, your approval, and it can never demote the last administrator.
Are these abilities on out of the box?
No. Creating a user, changing a role, and writing user meta are separate abilities, each off until you switch it on. If you never enabled create-user, the agent cannot make an account even if you paste the sheet.