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();
    //print_r($roles);

    //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).

Source

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

David

Graphic and website designer, currently maintaining web servers for existing clients and building websites for new clients. In my free time, I learn about Linux, SSH, and WP-CLI and I’m preparing this blog.

Related Posts

25+ Free Fonts for Your Next Design Project

25+ Free Fonts for Your Next Design Project

Looking for some fresh and creative fonts to spice up your design projects in 2023? You’re in luck! In this blog post, we’ve curated a list of 25 free fonts that you can download and use right away. These fonts are suitable for various purposes such as logos,...

Adobe Photoshop Shortcuts – Infographic

Adobe Photoshop Shortcuts – Infographic

Thanks to Amanda from the Consumer Base that she sent us an ultimate Adobe Photoshop shortcuts cheat sheet. If you are a beginner or want to brush up your knowledge on Adobe Photoshop shortcuts then you are at the right place. Have look at it and let us your thoughts...

20 WordPress Tutorial channels on Youtube

20 WordPress Tutorial channels on Youtube

This post will introduce you a useful list of the 20+ best currently active WordPress tutorial related channels on Youtube. These channels are mostly focused on Tutorials and Guides for Developers and Designers that want to learn all about WordPress. Check them out...

12 AI Tools for Graphic and Website Designers

12 AI Tools for Graphic and Website Designers

Artificial intelligence (AI) is transforming the way designers work, from ideation to execution. AI tools can help designers automate tedious tasks, generate new content, and enhance their creativity. In this blog post, I will introduce AI tools that you can use to...

How to Pair Fonts – Tips and Tools for Perfect Font Combinations

How to Pair Fonts – Tips and Tools for Perfect Font Combinations

Font pairing is the art of choosing two or more fonts that work well together and create a harmonious design. Font pairing can make or break your website, logo, poster, or any other project that involves typography. But how do you pair fonts like a pro? In this...

The Ultimate Guide to Color Palettes

The Ultimate Guide to Color Palettes

Color palettes are collections of colors that work well together and create a harmonious visual effect. They are essential for any design and art project, as they help to convey the mood, message, and style of your work. But how do you choose the right color palette...

Show/Hide Comments (0 comments)
L

0 Comments

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.

Social followers

Articles

Visits

Pin It on Pinterest

Shares