Home / admin / Change default role names “Administrator, Editor, Author, Contributor, Subscriber” to anything
  • How to Change default role names “Administrator, Editor, Author, Contributor, Subscriber” to anything

    admin roles menu administrator, subsciber, owner

    Have you ever wanted to change the default role names “Administrator, Editor, Author, Contributor, Subscriber” within wordpress? Add this little snippet to the functions.php of your wordpress theme. This snippet will let you change any of the existing role names to anything that you would like. This will of course display within the role select menu for users.

    “Please note this does not add a new role or permanently change the name”

    ( click code to copy )

    wordpress snippet : PHP

    <>
    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');
    

    ( WordPress codex functions, hooks, in this snippet. )

    init, add_action, _n, wp,