bbPress – Remove Old User Roles

bbPress Functions PHP

Snippet Overview

bbPress – Remove Old User Roles

bbPress is a fantastic forum plugin developed by the folks at WordPress. That said after testing it out on a site and then removing it, you may notice that the additional forum roles that the plugin installed have remained in your database. Outside of physically logging into PHPmyAdmin and removing them manually, here is a handy function that ensures the extra roles are hidden from the WordPress Admin area.

To enable this function you need to add the following code to your WordPress theme’s functions.php file.

// Hide bbPress Roles

$wp_roles = new WP_Roles();
$wp_roles->remove_role("bbp_keymaster");
$wp_roles->remove_role("bbp_moderator");
$wp_roles->remove_role("bbp_participant");
$wp_roles->remove_role("bbp_spectator");
$wp_roles->remove_role("bbp_blocked");
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply