# Rename Roles Without Changing Them

> Changes the names roles show on the Users screen and in role menus, for example "Subscriber" to "Member", without touching capabilities or the database.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: roles, labels, members
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rename-role-display-names/

## Code

```php
// Role ID => new name.
$wpide_role_labels = array(
    'subscriber'  => 'Member',
    'contributor' => 'Guest Writer',
);

$wpide_role_rename = function ( $roles ) use ( $wpide_role_labels ) {
    if ( ! $roles instanceof WP_Roles ) {
        return;
    }

    foreach ( $wpide_role_labels as $role => $label ) {
        if ( isset( $roles->roles[ $role ] ) ) {
            $roles->roles[ $role ]['name'] = $label;
            $roles->role_names[ $role ]    = $label;
        }
    }
};

$wpide_role_rename( wp_roles() );
add_action( 'wp_roles_init', $wpide_role_rename );
```

## Notes

Only the label changes; role IDs such as subscriber stay the same, so plugins keep working.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Rename Roles Without Changing Them" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
