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.
A nice, user-friendly way of deleting your custom roles is using the Members plugin.
Once you install and activate it, go to Users > Roles and here you can delete an custom roles that you do not need, which you can see here:
Once you've remove the unwanted roles, you can simply delete the Members plugin.