Prevent from deleting any user role but subscriber
If you mean the delete button on the user list at /wp-admin/users.php, then that button is created by the WP_Users_List_Table class around (currently) line 256. If you look a little further down– a few lines– you will see a filter called user_row_actions. You can use that to hide the ‘delete’ link. add_filter( ‘user_row_actions’, function($actions, $user_object) … Read more