To remove old user roles in WordPress you simply need to execute the following code in functions.php once. You can delete the code after running it and reloading a page on your site.


// This function will remove user roles.  You may need to inspect the user role dropdown on the user profile page to see the correct user role label to use below
function wps_remove_role() {
    remove_role( 'bbp_moderator' );
    remove_role( 'bbp_blocked' );
    remove_role( 'bbp_spectator' );
    remove_role( 'bbp_keymaster' );
    remove_role( 'um_admin' );
    remove_role( 'um_member' );
}
add_action( 'init', 'wps_remove_role' );

To identify your user role names go to the users page, use the browser inspector and inspect the user roles in the “change role to” dropdown. The option value is the value you want to use as seen below:

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.