wp role <command>

Manage user roles.

EXAMPLES EXAMPLES

# List roles.
$ wp role list --fields=role --format=csv
role
administrator
editor
author
contributor
subscriber

# Check to see if a role exists.
$ wp role exists editor
Success: Role with ID 'editor' exists.

# Create a new role.
$ wp role create approver Approver
Success: Role with key 'approver' created.

# Delete an existing role.
$ wp role delete approver
Success: Role with key 'approver' deleted.

# Reset existing roles to their default capabilities.
$ wp role reset administrator author contributor
Success: Reset 3/3 roles.

Top ↑

SUBCOMMANDS SUBCOMMANDS

Name Description
wp role create

Create a new role.

wp role delete

Delete an existing role.

wp role exists

Check if a role exists.

wp role list

List all roles.

wp role reset

Reset any default role to default capabilities.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.