Do you want to add or remove WordPress custom user roles without using any plugin?
Then you came at the right place.
We have posted simple custom function codes that can help you to easily Add WordPress User Roles and Remove WordPress User Roles.
Just follow below guides:
Add and Remove WordPress User Role
Whether you want to add or remove role from WordPress, you need to copy the below code snippets and paste it into your WordPress theme’s functions.php file.
Save the file and view result by log in WordPress Dashboard > Users > Add New.
Add Custom User Role WordPress
Remove User Role WordPress
Below we have embedded 2 code snippets which from 1 is for removing single user role and 2nd code for removing multiple user role.
Following are the default user’s role list and that you can use to remove:
Code for: Remove one user role.
We removed “editor” role from user’s role list, but you can remove to anyone by just changing role name.
Code for: Remove multiple user role.
Hope the above code helped you. If you have any question or opinion about this guide, let me know in the comment below.
Don’t forget to share this Add and Remove User Role Guide.