Remove User Roles from WP

October 20, 2021
Code Category:

Sometimes you just don't want to see a bunch of user roles. This will help.

// Just put this in functions.php, or, better yet, a plugin.
// Doesn't need to be in a function wrapper or anything. 

$wp_roles = new WP_Roles();
$wp_roles->remove_role("your_role")
$wp_roles->remove_role("second_role_to_delete")
©2021 Fotan Web Design