X

How To Change Default WordPress User Role Names

Snippets by IsItWP

Ever wanted to change the default WordPress user role names? This snippet will let you change any of the existing role names, such as “Administrator”, “Editor”, etc., to anything that you like. This will display within the role select menu for users. Please note this does not add a new role or permanently change the name.

Instructions

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

function wps_change_role_name() {
    global $wp_roles;
    if ( ! isset( $wp_roles ) )
        $wp_roles = new WP_Roles();
    $wp_roles->roles['contributor']['name'] = 'Owner';
    $wp_roles->role_names['contributor'] = 'Owner';           
}
add_action('init', 'wps_change_role_name');

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out How to Create a Custom User Registration Form in WordPress.

Comments   Leave a Reply

  1. Hello,

    How do we revert it? I created a site specific plugin for this, then I deleted it thinking that it was enough to revert back to the default user role label

    1. Hey Cristiano,
      If you’ve created the site-specific plugin manually, then you can go ahead and remove the code snippets you’ve inserted onto your plugin editor page.

      Alternatively, if you’ve installed the Code Snippets plugin, you can deactivate the specific snippet you’ve added by navigating to Snippets » All Snippets from your WordPress dashboard.

      1. Hello,
        Thank you, I deactivated and then removed the plugin but the contributor role, didn’t reverted back. It remains as Owner. Weird, no?

  2. can this be used in multisite wordpress on Version 4.8.2? because i put this code in function.php, its not working on add new user page

  3. How to Change the Default WordPress Role Names to Anything - WPMU DEV January 4, 2015 at 8:10 am

    […] snippet (thanks to Kevin Chard!) will let you change any of the existing role names. For example, instead of Contributor you could […]

  4. WordPress tip: Modify any role name to fit your needs September 15, 2014 at 7:38 am

    […] to Kevin Chard for the […]

  5. Nice function, but good to keep in mind is that the slug of the Role remains the original…

    1. Yes this is true you would need to also change the slug, however at that point it may be better to create a new role rather than change the name of the existing. I still think this has some uses.

      1. Oh I agree, it definitely has some good uses! I just meant that it is something to keep in mind 🙂

        1. Fair enough, and good point 🙂

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!