Skip to content

How To Remove User Roles From WordPress

WordPress comes out with five default roles. Most of them aren’t necessary for most of the websites. Here’s a snippet to remove user roles from WordPress.

For example, I just have a single admin user on this website and my personal website. Do you need a writer or editor for your own personal website? No, we you don’t.

So just add the following snippet to your current theme’s functions.php file:

function remove_role() {
    remove_role( 'editor' );
    remove_role( 'author' );
    remove_role( 'contributor' );
    remove_role( 'subscriber' );
}
add_action( 'init', 'remove_role' );

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *