Thanks, Rajesh.
I’ve added the following code to my functions.php in my child theme folder but it is not doing anything.
function remove_edit_users_from_specific_user() {
// Remove a capability from a specific user.
$user_id = 2; // The ID of the user to remove the capability from.
$user = new WP_User( $user_id );
$user->remove_cap( 'edit_users' );
}
Do I need to refresh or reload something?
Thanks.