WordPress User, Role, and Capability Actions

Understand all 24 WordPress user, role, and capability actions, including the fields to provide and precautions for changing account access.

This group contains 24 user, role, and capability actions in the supplied plugin source. These actions can find WordPress users, create or update accounts, read or update custom user metadata, and inspect or change roles and capabilities. Because role and capability changes affect what people can do on the site, confirm the target user and intended permission change before running an action.

Screenshot to add: [Workflow editor WordPress user, role, and capability actions with configuration fields]

Create, update, or delete a user

  • Create New User — creates a WordPress account with an automatically generated password. Provide Email and Username; you can also set nickname, display name, first and last name, website, bio, role, email-notification choice, and safe custom metadata. Confirm the intended role before creating the account.
  • Update User — changes details on an existing account. Provide User ID and the fields you want to change, such as email, display name, name, website, bio, role, or safe custom metadata. Leave the role field blank to keep the user’s current role.
  • Delete User — deletes a WordPress account. Identify the user with User ID, or enable the email lookup option and provide User Email. Reassign Content To (User ID) lets you select another user to receive the deleted user’s content. Verify the account and reassignment target before deleting.

Find users

  • Get All Users — returns a limited list of users. Use Limit to control how many are returned. If you already know the target user, use a specific lookup instead of retrieving a broad list.
  • Get All Users by Role — finds users who have a specified role. Provide User Role, such as the role slug used by WordPress.
  • Get User by Id — retrieves one account using its User ID.
  • Get User by Email — retrieves one account using its User Email.
  • Get User by Field — looks up a user using a selected field: ID, slug, email, or login. Choose Field and provide its matching Field Value.

Read or update user metadata

  • Get User Metadata (All) — returns all metadata entries for a user. Provide User ID. Metadata can contain plugin-specific values, so treat the result as potentially private.
  • Get User Metadata (Single) — returns one metadata value. Provide User ID and Meta Key.
  • Update User Metadata — adds or updates safe custom metadata. Provide User ID and either the Metadata key/value list or a single Meta Key and Meta Value. The action rejects privileged keys such as capabilities, keys beginning with wp_, and session-token data; do not try to use metadata updates to bypass WordPress access controls.

Manage user roles

  • Create Role — adds a new role. Provide a role slug in Role Name, a readable Role Display Name, and the capabilities to grant. Grant only the permissions the role actually needs.
  • Delete Role — removes a role by Role Name. Check whether users or workflows depend on the role before removing it.
  • Add User Role — adds one or more roles to a user while keeping their existing roles. Provide User ID and one or more role slugs in User Role(s).
  • Remove User Role — removes selected roles from a user. Provide User ID and the roles to remove. Check that the user will retain the access they need.
  • Update User Role — replaces the user’s role assignment with the new role you provide. Use User ID and New User Role. Unlike adding a role, this action replaces the existing role assignment, so verify the desired access first.
  • Get All Roles — lists registered roles and the capabilities assigned to them. Use this to inspect available role names before configuring a role action.

Inspect and manage capabilities

  • Get All Capabilities — lists capabilities defined across the site’s roles. Capabilities are permission names such as the ability to edit posts or manage users.
  • Get Role Capabilities — lists permissions assigned to a selected role. Provide Role Name.
  • Add Role Capabilities — grants one or more capabilities to every user who has the selected role. Provide Role Name and the capabilities to add. This can affect many accounts at once.
  • Remove Role Capabilities — removes selected capabilities from a role. Provide Role Name and the capabilities to remove; confirm that essential site functions will still work.
  • Get User Capabilities — lists the capabilities a user has through their roles. Provide User ID.
  • Add User Capabilities — grants capabilities directly to one user. Provide User ID and the capability names. Direct grants can give a user access beyond their normal role, so use the smallest set needed.
  • Remove User Capabilities — removes capabilities granted directly to a user. Provide User ID and the capabilities to remove. Check the user’s resulting access before applying this to a live account.

Understand the important fields

  • User ID: the numeric identifier for the exact account. Use a previous lookup’s result where possible.
  • User Role / Role Name: the role’s machine-readable name, not necessarily the label shown to a site visitor.
  • Capabilities: specific permissions assigned to a role or directly to a user. A capability is more precise than a role and can have a broad impact.
  • Metadata: extra information stored for a user. Use only custom keys intended for your integration and do not store passwords, tokens, or other secrets in ordinary metadata.

Permissions, privacy, and safe testing

Use the least-privileged workflow access available and test on a non-critical account before changing roles or capabilities. Deleting an account, changing a role, or granting a capability can affect account access or ownership of content. Verify the user, requested change, and resulting access before running the workflow in production.

User data and metadata may contain private information. Send only the necessary fields to external services, avoid including secrets in notifications or run logs, and review each action’s permissions and inputs before enabling it.