Renaming User roles in wordPress

Renaming existing WP User Roles

If you are the only person who is running your website, you have probably never had to think about WordPress user roles. However, if you ever need to give access to other people to access your WordPress web site, WordPress user roles are essential for controlling what actions the various users at your site are permitted to take.

By smartly applying the WordPress user roles, you ensure that no one has more power than they need. And this helps make your site more secure and streamline your workflow. In the below code will see how to rename the existing wordpress user roles.

In this article, we are going to show how to rename existing user roles in a simple step. By registering a function in functions.php file in the active theme directory.

Paste the below code functions.php to Renaming User roles in WordPress

function wps_change_role_name() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
$wp_roles->roles['subscriber']['name'] ='Member';
$wp_roles->role_names['subscriber'] = 'Member';
$wp_roles->roles['lp_teacher']['name'] ='Trainer';
$wp_roles->role_names['lp_teacher'] = 'Trainer';
add_action('init', 'wps_change_role_name');


check for related WordPress products on amazon (affilate link)

About the author


A coder who is trying to solve some problems via "Procoders", Software Engineer By Profession, WEB Enthusiast, Hobby Blogger. I love to share Tech Ideas and like to learn and explore new things and Technologies.

Add Comment

Click here to post a comment