如何从管理员的“新用户”页面中删除不需要的角色?

Basiclly, I must Remove the next roles whenever the admin is creating a new user and clicks on the dropdown menu tu display all the available roles:

  • Contributor
  • Editor
  • Unapproved User
  • Author

It should only display Subscriber and Administrator.

Also I must change the name of Subscriber to something different, where is this code? This problem would seem to me like there was a plugin to it.

To remove a role you can use

<?php remove_role( 'editor'); ?> 

and to rename a role add the following php t your functions.php file

function change_role_name() {
    global $wp_roles;

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

    //You can replace "administrator" with any other role "editor", "author", "contributor" or "subscriber"...
    $wp_roles->roles['administrator']['name'] = 'Owner';
    $wp_roles->role_names['administrator'] = 'Owner';           
}
add_action('init', 'change_role_name');

(The above is from here

There is a function called remove_role that WordPress has in its PHP API. you use it like this:

<?php remove_role('author'); ?>

author could be replaced with any role you want. The way you want to use this command is different than most WP commands. This is because it removes the role from the DB so any future times, the role is already removed. I would recommend making a custom WP plugin that just removes the roles you want on activation.

WP Plugin Help