fbpx

[Step By Step Guide] How To Add Custom User Roles On Your WordPress Site

Adding custom user roles on your WordPress site, you will be able to manage your multiple users with full flexibility. It helps you to provide your users the desired permission and maintain your site security in advance. 

Custom User Roles WordPress

People get puzzled when it comes to how to add custom user roles to your website by applying the right methods. In this blog, you will get to know in detail about WordPress custom user roles and their configuration below. Excited? Get started!

What Are User Roles In WordPress & Their Use Cases?  

WordPress User Roles can be defined as giving the authority to your WordPress users to manage your entire website, particular content types, or anything you wish to provide. For example, you can give one of your site users to manage only your posts or page, and the rest of the other things are collapsed. 

Or even if you want, you can permit any user who can get access to anywhere on your site. This is totally up to how you are going to assign any user roles and capabilities to your WordPress site users. This can help you to maintain your site security and not make it vulnerable for anyone.  

In WordPress, you can manage your website user roles in two ways. One is by using WordPress default user roles, and another one is custom user roles. You will get to know both of these roles function here: 

custom user roles WordPress

WordPress Default User Roles Use Cases

If you are running a single site you will get five default user roles to manage permission for your multiple websites users like Subscriber, Contributor, Author, Editor, and Administrator. And if you are running multiple sites, then you will get another sixth user role called Super Admin. 

Subscriber

Subscriber role gets a very limited facility on the WordPress website. Just get access to administration screens, their own profile, and dashboard. They can not edit or publish any posts or do anything except make changes to their own profile, add comments on posts, that’s it. And It’s useful when you want your users only to view your restricted content, it could be membership sites or anyone who has signed up for a content offer or mailing lists. 

Contributor

Those who have got the ‘Contributor’ role can only write and edit their own posts but don’t get permission to make them publish. They are not able to add any media files on their content, change any site settings, or other files. Even cannot edit anything or delete after the posts being published. The only thing they can manage is to write and edit content before making it publish. This is useful when you have hired a new writer, giving him/her training or a freelance writer and not on your permanent team. 

Author

The author role also gets restricted permission during maintaining the WordPress site but definitely gets more than Contributor permissions. They have the full authority to manage their own content like they can create, edit, delete or publish any of their posts. They can add media files to their own content. Except they don’t have the permission to view or edit other posts or can not make any changes to the site settings. 

Editor

Editor role gets the full freedom to review contributors' and authors' content. If they want, they can create, publish, modify, or even can delete any post or page of your WordPress site. They have the authority to moderate comment sections, manage tags, and categories for any of the posts. The only thing they can not make is to create any of the larger changes.

Administrator

Administrators’ roles will automatically get by the one who has made the site. Other than that, as an owner, you can permit anyone to become your website administrator. They have the all right to manage and organize the whole WordPress website. They get full control over your site’s content, theme, plugins, updates, backend code, and more. If they want, they can moderate other user roles like can edit user roles of others, provide new or delete ones. 

Super Admin

You will get this ‘Super Admin’ role available on your WordPress site only when you are managing multisite networks in one umbrella network. Super Admin will get all the permissions that the Administrator gets. And in addition, they can make changes on the network like can add or remove any sites from the network, configure any changes to themes, plugins, or more. 

custom user roles WordPress

WordPress Custom User Roles Use Cases 

WordPress custom user roles function exists when you want to provide particular permission that does not exist on default user roles or you want to create your own role management structure. That will help you to better organize your site user permissions and can reduce unnecessary user roles from your website. 

For example, you want to provide some custom permissions to anyone outside your team. That is not present in default roles, in that case, you will feel the necessity of adding a custom user role. And there are several more examples are there for creating custom user roles in WordPress. 

How To Add Custom User Roles On Your WordPress Site

As you have already known custom user roles functionality. In this section, you will now know how to add custom user roles to your WordPress sites with every possible method. Without any further ado, take a look at the methods below:

Method 1: Manually Manage WordPress Custom User Roles 

If you want you can manually update your WordPress custom user roles by adding specific codes into your existing theme function.php file on your database. 

custom user roles WordPress

Before that, you should know that if you want to add custom user roles and capabilities, you can easily do that manually passing five straight functions. These WordPress custom user roles & capabilities function are given below: 

add_role(): It lets you add a custom user role.

remove_role(): Let’s you remove a custom role.

add_cap(): Help you to add a custom capability to your preferred role.

remove_cap(): Let’s remove a custom capability from a role.

get_role(): Gives you information about a role & capabilities associated with the role.

Here we will only focus on how you can add custom user roles to your WordPress site. So the function we are using is add_role() function. And the desired custom user roles code will look structure will be like this: 

add_role( string $role, string $display_name, bool[] $capabilities = array() )

For example, if you are making it in on your the code would be like the function below. And for your better understanding, check out this WordPress.org information about adding custom user roles on your WordPress site. 

add_action(‘init', ‘wpdev_add_roles');

function wpdev_add_roles() {

    add_role( 

        ‘comment_moderator',

        __(‘Commment Moderator'), 

        array( 

            ‘read' => true,

            ‘edit_posts' => true,

            ‘edit_other_posts' => true,

            ‘edit_published_posts' => true,

            ‘moderate_comments' => true

        )

    );

}

Method 2: Use WordPress Plugin & Add Custom User Roles

If you don’t want to take the hassle of adding codes that will help you to manually update your WordPress custom user roles & capabilities, then using a fully functional WordPress plugin can solve this issue immediately. You don’t have to worry about adding any codes, just pick the perfect one that will fit your site environment, and start adding WordPress custom user roles and capabilities on an instance. 

Get a list of three useful plugins here that can help you to add custom user roles to your WordPress site without coding. Besides these three, surely there are some others you may look at. 

Members – WordPress Membership & User Role Editor Plugin

Members is one of the most popular, powerful plugins to add and manage your WordPress site custom user roles & capabilities. It gives you the full freedom to assign custom user roles with its advanced features. You can set permissions to restrict any content on your site with a simple user interface (UI), and many more just with ease. It comes with both a free and a pro version with more features. 

Exclusive Features 

  • Advanced role editor to add, edit or delete your custom user roles.
  • Manage multiple user roles, explicitly deny capabilities & clone roles.
  • Provide content permission or restrict, use shortcodes, add addons & more. 

How To Get Started? 

Make sure to install and activate the Members plugin on your WordPress site. After installing this Members plugin on your WordPress site, your plugin interface will look this: 

custom user roles WordPress

If you want you can ‘Add New Roles’ option to configure your desired custom roles, configure the settings, or can add your preferred Addons, and more with this powerful plugin. 

custom user roles WordPress

After you have configured the changes as per your wish, you can check out your all-created custom user roles defining the capabilities on this ‘Roles’ section. 

Advanced Access Manager – Advanced User Role Management Plugin 

Advanced Access Manager is another powerful WordPress custom user role & capabilities managing plugin. Which has mentioned having advanced facilities to control every aspect of your entire WordPress site. It helps you to add custom roles, provide them the permissions, access control, and more. You will get both a free and a pro version with more exclusive features. 

Exclusive Features 

  1. Powerful widgets to manage your entire WordPress website.
  2. Over 100,000 websites are using this exclusive plugin.
  3. Manage access on your whole website with ease, and many more. 

How To Get Started? 

First, install & activate this Advanced Access Manager plugin by following the link. And if you have already get activated the plugin on your website, you will get this look: 

custom user roles WordPress

As you can see there are lots of options you get to manage your entire website, control the whole access, permission, manage custom user roles & capabilities from one place, and more. 

custom user roles WordPress

User Role Editor – Easily Change User Roles & Capabilities

User Role Editor is one of the most popular plugins to add custom user roles & capabilities and manage in advance on your WordPress site. You just have to turn on check boxes of capabilities you prefer to add, select role, and click the “Update” button. That’s it you can save all the changes you have made. It’s flexible, user-friendly, and fully capable to manage your WordPress custom user roles. Get both a free and a pro version with more advanced features.  

Exclusive Features 

  • Block or Hide selected admin menu items for the role.
  • Export or Import any module from your local site to live one.
  • Multisite configuration via Network Admin is available, and more. 

How To Get Started? 

As you have to install & activate the User Role Editor plugin on your WordPress site and start configuring it having these interfaces that you are getting below: 

Afterward, you can add custom user roles & capabilities, and configure them in advance to make the changes according to your need. custom user roles WordPress

As you have done configuring each custom user role & capabilities, now all you can do is to assign roles to your selected user and rest just with ease. 

custom user roles WordPress

This is it! You have now got a detailed idea about WordPress custom user roles & capabilities that you can set for them manually or using a plugin. Hope you find this blog helpful and don’t forget to share your experience in the comments below. 

If you want to read more exciting blogs, tutorials, & more by visiting our blog page here and join a friendly Facebook community to get attached with WordPress experts. 

Afrin

Afrin

Afrin works as a Digital Marketer and an enthusiastic tech content writer. She completed her Masters of Business Administration with a major in Marketing & a Bachelor in Telecommunication Engineering. If you don't find her out working, maybe then she is traveling, watching animation movies, singing, or eating her favorite food in her favorite place.

Share This Story

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on whatsapp

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.