I installed BuddyPress which created additional user roles but even after deleting BuddyPress those roles are still there. How can I delete these roles? I have tried the remove_role()
command but it did not work.
2 Answers
$wp_roles = new WP_Roles(); // create new role object
$wp_roles->remove_role('name_of_role');
If you need to check the name_of_role use
$wp_roles->get_names();
you will get an array of name_of_role => Nicename of Role
Alternatively, you could use the global object $wp_roles
global $wp_roles;