Add a WordPress User to Multiple Roles
By default, there are five users roles in WordPress. Everyone with an account on your site will be placed into one of these five roles:
However, it is possible to add more user roles and to place users into multiple roles.
In this tutorial, I'll explain how and why you can place WordPress users into multiple roles.
A good example for multiple roles is WooCommerce. In the image below, you can see two new roles: “Shop manager” and “Customer”.
The “Customer” role in WooCommerce has almost no permissions. Users in this role can buy products, but normally they can't even access the WordPress admin area.
What happens if you want to give some customers extra permissions? One approach is to create a whole new user role. However, you can also give users an additional role.
For example, you can make some users a “Customer” but also give them the “Author” role so they can create content.
I'm going to show you two ways to add extra roles:
Method #1. Add an extra role for the whole site
This first method allows you to give users an extra role across all areas of your WordPress site.
- Install the PublishPress plugin.
- Go to the “Users” link in your WordPress admin menu.
- Either edit an existing users or create new user.
- The “Role” field will now be able to accept more than one choice:
Method #2. Add an extra role for certain situations
This second method allows you to give users an extra role in only some restricted areas of your WordPress site. For example, they could be an “Author” only for one post type.
- Install the PublishPress Permissions plugin.
- Go to the “Users” menu link.
- Click to edit a customer account:
- Scroll down and click the “customize this user directly” link:
On this page you can add supplemental roles for this user. For example:
- Choose “Post” from the “Post Type” dropdown.
- Choose “Author” from the “Role” dropdown.
- Click “Add Role” and “Save Role” to finish.
This “customer” will now also be able to act as as Author for all the Posts on your site.
Go back to the “Users” screen and you will be able to see the multiple roles listed next to the user account:
How do permissions work with multiple roles?
If you give multiple roles to a user, this does add some complexity. Please test the user account carefully after giving them access to multiple roles.
In most cases, the permissions are additional. Let's see a practical example of this:
- Subscriber: This role DOES NOT have the ability to create new Posts.
- Author: This role DOES have the ability to create new Posts.
In this case, a user with both the “Subscriber” and “Author” roles DOES have the ability to create posts. The user gets the permissions of both roles.
The only exception to this if a role has permissions that are explicitly denied. This screenshot below shows an example from the PublishPress Capabilities plugin. In this image, the permissions for Posts are all explicitly denied with the red X.