How to Delete User Roles in WordPress
- Article
- Comment
How to Delete User Roles in WordPress. Deleting a WordPress user role can be done through the function remove_role (). But the function can be executed after the theme setup or a plugin activation. Because the removing role can be affecting the settings of a WordPress site. So this can be done on the time of theme change or plugin activation.
Let’s see an example code to delete a user role from database.
The above one removes the subscriber from your words options table.