How to Configure User Roles in WordPress Using Plugin
Tags: wordpress
Published: 2020-12-14 03:20:00

In the <a href="https://gretathemes.com/the-user-roles-in-wordpress/">previous article</a>, we've learned about user roles and how to add new users in WordPress. However, when dealing with user roles, you may find that WordPress has some limitations to add and remove the capabilities of user roles. For instance, by default, the Editor role in WordPress isn't allowed to manipulate themes and plugins. But what if you want to give him / her these capabilities?

<!--more-->

To solve this issue, you can <strong>use a plugin to customize user roles in WordPress</strong>. I'm going to use User Role Editor plugin to deal with the above case. However, keep in mind that your account must be <strong>Administrator</strong> or granted the capability for customizing user roles to work with this feature!

<h2>User Role Editor Plugin</h2>

There are a lot of plugins to customize user roles in the WordPress repository such as Members, Advanced Access Manager, Nav Menu Roles, WPFront User Role Editor, Capability Manager Enhanced, Role Scoper, ... But the most popular and outstanding one is <strong>User Role Editor</strong> plugin.

<img class="aligncenter" src="https://i.imgur.com/PDd3wD8.png" />

This is a convenient and useful freemium plugin that is extremely easy to use. Note that <strong>I only use the free version in this article</strong>!

<h2>Configure User Roles in WordPress using Plugin</h2>

<h3>Step 1: Install and Activate the Plugin</h3>

User Role Editor plugin is free and available on <a href="https://wordpress.org/plugins/user-role-editor/">wordpress.org</a>, so just <a href="https://gretathemes.com/install-wordpress-plugin/">install and activate the plugin</a> as usual. Go to <strong>Plugins</strong> &gt; <strong>Add New</strong> on the <strong>Admin Dashboard</strong>, find the desired plugin, and then click <strong>Install Now</strong>.

<img class="aligncenter" src="https://i.imgur.com/o9h5Xfb.png" alt="Install and Activate the USer Role Editor Plugin" width="1351" height="657" />

<h3>Step 2: Set up the plugin</h3>

After you installed and activated the plugin, go to <strong>Settings</strong> &gt; <strong>User Role Editor</strong> and set up the plugin before using it.

<img class="aligncenter" src="https://i.imgur.com/r5B3GNc.png" alt="Set up the WordPress plugin User Role Editor" width="760" height="594" />

The settings interface will show up with five tabs below:

<h4>General Tab</h4>

The <strong>General</strong> tab includes five options:

<ul>

   <li><strong>Show Administrator role at User Role Editor</strong>: Changing the capabilities of this important role can cause <a href="https://gretathemes.com/protect-wordpress-sites-security/">security issues</a>. Therefore, excerpt for really necessary cases, you should turn this feature off.</li>

   <li><strong>Show capabilities in the human readable form</strong>: Typically, capabilities are displayed as code (for example, <code>edit_published_posts</code>). This option renames the capabilities to make it easier for readers to understand (for example, <code>Edit published posts</code>). Therefore, you should always check this box.</li>

   <li><strong>Show deprecated capabilities</strong>: Previously, user roles in WordPress were named as levels 0 - 10. Nowadays, this naming method is no longer available. It only exists in some old themes and plugins. If you're using such themes and plugins, enable this option to ensure User Role Editor plugin is compatible with them.</li>

   <li><strong>Confirm role update</strong>: The plugin will require you to confirm before updating changes.</li>

   <li><strong>Edit user capabilities</strong>: You should tick it by default to edit the capabilities.</li>

</ul>

<img class="aligncenter" src="https://i.imgur.com/SaeB75L.png" alt="Options in the General Tab to configure the user roles" width="620" height="569" />

<h4>Additional Modules Tab</h4>

This tab has only one item: <strong>Count users without role</strong>. In case there are users who haven't received or registered a role yet, this option will help you find and manage these users easily.

<img class="aligncenter" src="https://i.imgur.com/joOcOF8.png" alt="Configure the Additional Modules Tab of the WordPress plugin" width="602" height="512" />

<h4>Default Role Tab</h4>

When a new user registers an account, you can give him / her one (or some) default role in this tab.

<img class="aligncenter" src="https://i.imgur.com/thXh1Uw.png" alt="Configure the Default Role Tab of the WordPress plugin" width="625" height="522" />

<h4>Tools Tab</h4>

In this tab, you can restore user roles to WordPress defaults. You should consider it carefully before clicking <strong>Reset</strong> because all the user data will be lost.

<img class="aligncenter" src="https://i.imgur.com/zfpCHfH.png" alt="Configure the Tool Tab of the WordPress plugin" width="1336" height="516" />

<h4>About Tab</h4>

This tab contains some other information such as plugin version, author website link, <a href="https://metabox.io/create-faqs-page-by-meta-box/" rel="follow">FAQ page</a> link, donate link, changelog, ... If you have any questions about the plugin, contact the author or go to the FAQ page here.

<img class="aligncenter" src="https://i.imgur.com/xZjJpHE.png" alt="Configure the About Tab of the WordPress plugin" width="849" height="517" />

<h3>Step 3: Configure the User Roles</h3>

To configure the user roles in WordPress, go to <strong>Users</strong> &gt;<strong> User Role Editor</strong>. The plugin interface will show up like the below picture:

<img class="aligncenter" src="https://i.imgur.com/9osV1x3.png" alt="Configure the User Roles in WordPress" width="1153" height="526" />

<h3>Select a User Role</h3>

In this section, choose the user role you want to customize. The list includes the WordPress default roles (Administrator, Editor, Author, Contributor, Subscriber) and other user roles added by users or plugins. For example, I choose the <strong>Editor</strong> role.

<img class="aligncenter" src="https://i.imgur.com/XZtn3Yg.png" alt="Select a User Role" width="1081" height="562" />

Additionally, on the right panel, you can also add new user roles (<strong>Add Role</strong>), rename the currently selected role (<strong>Rename Role</strong>), or delete user roles (<strong>Delete Role</strong>) - except for the WordPress default user roles.

<img class="aligncenter" src="https://i.imgur.com/GgF3rlA.png" alt="add new user roles" width="1200" height="527" />

Besides, after clicking <strong>Add Role</strong>, you can make a copy of the current user role.

<img class="aligncenter" src="https://i.imgur.com/GgF3rlA.png" alt="make a copy of the current user role." width="1200" height="527" />

<h3>Edit Capabilities of the Selected User Role</h3>

In the <strong>Group</strong> section, you can add / remove the capabilities of the selected user role. For example, I want to allow Editors to manipulate plugins, so I select <strong>Plugins</strong> in the <strong>All</strong> column on the left and tick the desired capabilities (install, delete, update plugins, ...) in the right column.

<img class="aligncenter" src="https://i.imgur.com/JM0fhHJ.png" alt="Edit Capabilities of the Selected User Role" width="1151" height="597" />

There are two useful features that you can utilize to search for capabilities more quickly:
<ul>
   <li><strong>Quickfilter</strong>: Use this feature to search for capabilities by their names.</li>
   <li><strong>Granted</strong> <strong>Only</strong>: Each user role is granted different capabilities. This feature will filter out the capabilities that are currently granted for the selected user role.</li>
</ul>

In addition, you can add or delete capabilities yourself by these two buttons below:

<ul>

   <li><strong>Add Capability</strong>: Note that the capability name is written only with Latin letters, numbers, and "_". This option is quite advanced because it's related to code, so if you aren't an expert, skip it.</li>

   <li><strong>Delete Capability</strong>: Note that User Role Editor plugin doesn't support deleting the WordPress default capabilities</li>

</ul>

Finally, after you finished customizing user roles, don't forget to click <strong>Update</strong>.

<img class="aligncenter" src="https://i.imgur.com/Ccx3U62.png" alt="Update the changes after you configured the plugin" width="1149" height="534" />

This is the Editor account on my website when I haven't customize this user role yet:

<img class="aligncenter" src="https://i.imgur.com/rcZzx7b.png" alt="the Editor account on my WordPress website" width="1366" height="657" />

And here is the result after I granted capabilities for the Editor role with User Role Editor plugin.

<img class="aligncenter" src="https://i.imgur.com/r37N6Uy.png" alt="I granted capabilities for the Editor role with User Role Editor plugin." width="1351" height="632" />

As you can see, after I customized the Editor role with User Role Editor plugin, the <strong>Plugin</strong> section showed up on the <strong>Admin Dashboard</strong>. From now on, Editors can install, activate, delete, edit, and update plugins on my site.

<h2>Last Words</h2>

Utilizing User Role Editor plugin to appropriately add / remove capabilities and user roles in WordPress will help you manage users on your site easily, quickly, and efficiently. However, you should consider it carefully before granting some important capabilities to users (for example, <a href="https://gretathemes.com/install-wordpress-theme/">install / uninstall themes</a> and plugins; delete <a href="https://gretathemes.com/post-page-different/">posts and pages</a>; add / remove user roles; ...) because they can unintentionally (or intentionally) cause some incidents. These incidents will affect the website operation and even lose your important data.

To prevent incidents caused by users on the site, you better should <a href="https://gretathemes.com/backup-wordpress-site-manually-or-use-plugin/">back up your website's data</a>.