Skip to main content
Articles

Prevent other Admins from Promoting other Admins

17
0

Sometimes I hate the things I have to know about WordPress. I shouldn’t have to know this.

“Make your client an admin, then use this so they can’t make more admins without asking.”

Add this to your functions to make it work, then comment it out when you need to actually add a new admin.
Or turn it into a plugin so you can activate and deactivate it.


// Prevents promoting anyone to admin
add_filter( 'editable_roles', function( $roles ) {

  unset( $roles['administrator'] );
  
  return $roles;
} );