How to Add Custom User Roles on Your WordPress Site

WordPress has six predefined roles: Super Admin, Administrator, Editor, Author, Contributor, and Subscriber. Each role is allowed to perform a set of tasks called Capabilities. That means capabilities for each type of role is different. For example, Subscriber user role has only read capability whereas Contributor has different capabilities, such as read, delete posts and edit posts.

To learn about WordPress user roles, you can read this article.

WordPress User Roles, Permissions and Capabilities Explained

In this article, We are going to discuss why custom user role is necessary and how to add a custom user role.

Creating Custom User Roles on Your WordPress Site

Suppose, you want to have a user who can only edit posts and read, but among the six default user roles, you will not find a single one who has only read and edit posts capabilities but more or less. In this case, what’s the solution?

You may add edit posts capability for the subscriber by using add_cap(); function, but this is not a good practice. The best idea is to create a custom user role by assigning with capabilities.

There are two major ways of creating custom user roles in WordPress. You can do it by adding custom code or by using a plugin. We will discuss both of the approaches in this post. Let’s see how they work.

Plugin Method: Using A WordPress Custom User Role Plugin

You may like to use plugin instead of adding custom code. To create new user roles you can use Members plugin, it is a very popular user and role management plugin that was created to make WordPress a more powerful CMS.

Creating a New User Role

  • After installing and activating this plugin navigate to wp-admin → Users → Add New Role
  • Enter the role title (e.g Comments Moderator)
  • Select the capabilities for this new user role (e.g. moderate comments, read)
  • Click on Add Role button.

Now, go to wp-admin → Settings → General, click on New User Default Role dropdown field. You can see the newly created user role listed along with the default user roles.

It's very easy, right? Using this handy plugin, we have created a WordPress custom user role and it took only a few steps!

Custom Code Method

WordPress is the number one CMS in the world and it is popular for its open source nature. This means you have the opportunity of customizing WordPress the way you want and its completely FREE. Just like that WordPress gives you the opportunity to create custom user role by using a function called add_role();

There are three parameters in add_role() function.

add_role( $role, $display_name, $capabilities );

  1. $role (string) (required): Unique name of the role
  2. $display_name (string) (required): The name to be displayed
  3. $capabilities (array) (optional): Capabilities that one can access

Let’s create a new user role named Custom Editor with read and edit posts capabilities. Include the following lines of code toward the end of your functions.php, which is located in your theme folder.

    __( 'Custom Editor' ),
        'read'         => true,  // true allows this capability
        'edit_posts'   => true,

Now save the file, login to your site with an admin account. Navigate to Settings → General. You can see the newly created user role in the user list.

That’s all, you can assign a user to this role from WordPress admin panel, also you can set this role as New User Default Role.

We hope this tutorial will be very helpful for beginner users. If you have any suggestions or query, please let us know in the comments.


  • Alejandro


    Hello, very good article, I would like to know how I can change the name of a role already created, for example I have to Vendor that I simply want to change the language and pass it to Spanish since neither poedit nor crazy helped me to solve it. it would only be that, some code so that I can locate it in funtions of my child theme, for example I have a code that is function wpbod_nombres_roles () {

    global $ wp_roles;

    if (! isset ($ wp_roles)) {
    $ wp_roles = new WP_Roles ();

    $ wp_roles-> roles [‘contributor’] [‘name’] = ‘Participant’;
    $ wp_roles-> role_names [‘contributor’] = ‘Participant’;

    $ wp_roles-> roles [‘subscriber’] [‘name’] = ‘Honorary’;
    $ wp_roles-> role_names [‘subscriber’] = ‘Honorary’;

    add_action (‘init’, ‘wpbod_nombre_roles’); but the vendor roles for example do not change it or pendig seller. thank you very much for your help.

  • Rabbi


    Hello Alejandro,

    You can use WP User Role Renamer plugin to rename user role. Here is the download link:


  • צלם אירועים

    צלם אירועים

    Thank you for the information

  • Samuel


    Yes that’s what I was looking to create custom user role for my wordpress site with having different roles.
    Thanks to you for writing about it. Cheers!

  • Tomas Ale

    Tomas Ale


  • công ty bất động sản

    công ty bất động sản

    Really no matter if someone doesn’t be aware of then its up to other users that they will assist,
    so here it takes place.

  • Pingback: WordPress User Roles, Explained under 5 min!

  • halfey


    I wonder if I could create 2 user roles with the same set of privileges (capabilities), let’s say “Readers A” and “Readers B” where I can set “Articles A” only available to Readers A, and likewise “Articles B” only visible to Readers B, despite both groups have the same privileges.

  • Daniel


    Really that’s good job. Thanks to you!
    This is very helpful article for those who are interested in WordPress. Actually I’m interested to make career in WordPress. Recently I have purchased WordPress hosting coupon with discount offer. But I face difficulty to create custom user role and searching about this. I found your article and you have provided this solution with interface. I’m getting more help from your article.

  • Cong_Iam


    please help me!
    In case you want to distribute administrative rights to new account registrants with rights
    1. Permission: add, edit 1 plugin. like upload gallery for example (automatically create not need administrator censorship)
    2. after creating the album and this person can create the post and display it outside the webite under the administrator’s censorship.
    1 and 2 are the same type of decentralization (SUBCRIBER)
    So how is this issue decentralized?
    I want you to take care and feedback to help me in the shortest time!
    Thanks ad!

  • Stephe


    really Beautiful Article is this, More helpful every one take guidance by, I have no more about inform about world of IT but I try always for that I visit coupons Stores for different related Software Items & whenever purchasing some software’s, Word press one of favorite my Item I could more learn by that & related that pages. Thank You for yours

  • nom


    hi – can we set a role to an email nab group? Thanks

  • Brad


    Thanks for the tutorial!

    For the custom code method of creating a new role, you should ideally only call it once since the role is saved to the database with the first call. This post details a good method using the after_setup_theme hook and setting a custom option to see if the role has already been created:

  • Ben


    Hey, if I want to have a certain page than only certain roled users can view, is that possible? I don’t want these users to see all ‘private’ content, I want a middle category that is only visible to a specific role user.

  • pink sheets

    pink sheets

    Good blog post. I definitely appreciate this website. Thanks!

  • Priyanka



    In wordpress the Admin role has all capabilities. When you add a third party as admin they can even change site owner’s password, remove site owner as admin, or reduce the role. They can publish anything without site owner’s permission. They can make technical changes which siteowner may not be comfortable with. While a site owner do need help from technical developer to make certain changes, a site owner needs to protect his/her ownership of the site and restrict a developer from doing undesired changes. Many people complain that they took help from third party developer but they did not get desired site and so they had to restart from scratch.

    If Site owner creates a custom role of web Master with all capabilities but not User management using plug in or code can the web master, edit this settings ( as he is given all other technical rights like add or remove plug in/theme etc)?

    If so, how to create a technical role but restrict Publishing rights and User management rights?

  • Md Atikur Rahman

    Md Atikur Rahman

    thanks for sharing with such type of custom code. waiting for new one…..

  • tungsten alloys

    tungsten alloys

    Its really Beautiful Article is this, More helpful every one take guidance by, I have no more about inform

  • Pingback: Best WordPress Membership Plugins Compared [2019]

  • Pingback: Meilleurs plugins d'adhésion WordPress comparés [2019] - Webypress

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.