How to fix, rename user roles without plugin?

Jun 6, 2012Blog, WordPress

 Our today tip can help you fix, rename user roles without ANY plugin. We also must put your attention on  perfect plugin called User Role Editor for creating new role’s capabilities easy, that could be useful for membership sites etc. Add new roles and customize its capabilities according to your needs, from scratch of as a copy of other existing role. Unnecessary self-made role can be deleted if there are no users whom such role is assigned. You can add new capabilities and remove unnecessary capabilities which could be left from uninstalled plugins. Multi-site support is provided.

Problem: Example, you use English version of WordPress but you see the user role names in other language.. This problem is caused by that you use other language version of WP before you convert to English.

Find your functinon.php file and add these lines.

function change_role_name() {
    global $wp_roles;

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

    //You can list all currently available roles like this...
    //$roles = $wp_roles->get_names();

    //You can replace "administrator" with any other role "editor", "author", "contributor" or "subscriber"...
    $wp_roles->roles['administrator']['name'] = 'Administrator';
    $wp_roles->role_names['administrator'] = 'Administrator';
    $wp_roles->roles['editor']['name'] = 'Editor';
    $wp_roles->role_names['editor'] = 'Editor';
    $wp_roles->roles['author']['name'] = 'Author';
    $wp_roles->role_names['author'] = 'Author';
    $wp_roles->roles['contributor']['name'] = 'Contributor';
    $wp_roles->role_names['contributor'] = 'Contributor';
    $wp_roles->roles['subscriber']['name'] = 'Subscriber';
    $wp_roles->role_names['subscriber'] = 'Subscriber';

add_action('init', 'change_role_name');

Users Numbers Wrong

When you go to Users – All – Users in admin you see wrong numbers of users in some role? This problem is caused by a corrupted database. If you load up phpMyAdmin for your database, and go to the SQL tab at the top.

Paste this in and press GO.

SELECT * FROM 'wp_usermeta' WHERE 'meta_key' LIKE 'wp_capabilities' ORDER BY 'wp_usermeta'.'user_id' DESC

You’ll notice there are duplicate entries for wp_capabilities in your wp_usermeta table, and this is why the numbers are coming out wrong within WordPress. You can rid yourself of this problem, by going through the list of entries and deleting the duplicates.

User Role Editor

User Role Editor – makes the role capabilities changing easy. You can change any standard WordPress user role (except administrator).


Change the role’s name in wordpress without plugins | Web Help 101
Community Support Forums • View topic – Free Registration Numbers Wrong


Graphic and website designer, currently, I attend to the maintenance of about thirty sites for existing clients as well as creating websites for the new ones. In my free time, I get into the secrets of the world of Linux, SSH, WP-CLI and I’m preparing this blog.

Related Posts



Submit a Comment

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.


Pin It on Pinterest