SOLUTION:
// Remove Administrator role from roles list
add_action( 'editable_roles' , 'hide_adminstrator_editable_roles' );
function hide_adminstrator_editable_roles( $roles ){
if ( isset( $roles['administrator'] ) && !current_user_can('level_10') ){
unset( $roles['administrator'] );
}
return $roles;
}
Related Posts:
- How to check if a user is in a specific role?
- How to prevent access to wp-admin for certain user roles?
- Check if user is admin by user ID
- Only allow administrators and editors to access wp-admin
- create users to site with specific language
- Prevent from deleting any user role but subscriber
- What is the capability that permits access to WP-Admin?
- Displaying which Role the current user is assigned to
- Adding HTML/Text to Top of Subscriber’s Profile Backend Page
- Custom role based users are not able to access wp-admin
- Custom roles showing HTML entities in title form field
- Users Unable to Access Dashboard/Posts/Pages
- Only allow administrators and editors to access wp-admin
- Allow administrators to pick post author on custom post type edit screen
- Adding Custom Capabilites
- Restrict Author role to only 3 wp-admin pages
- Why is unfiltered_upload not working despite being enabled?
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- Downgrade admin account by mistake
- How to set where user is redirected to after logging in at wp-login?
- User Capabilities are not available in WP REST permission callback?
- Change users.php WP_User_Query
- User Roles: How to hide a plugin from showing in WP-Admin?
- Is WordPress secure enough for a multi-user article directory?
- Newly created user role not displaying on users screen
- How to check if a user is in a specific role?
- Give wp-admin access for shop managers
- adding existing menu page on new customer user role
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
- how to Hide all products except the General Manager role in the WordPress admin panel?
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- ‘wp’ hook supposed to trigger when editing a post?
- How do you force the wordpress dashboard to be 1 coulmn by default?
- How to remove dashboard access (wp-admin) for author but not disable the capabilities?
- always by default show welcome panel in the dashboard
- Migrated wordpress site give “Undefined variable: php” warnings
- Add and Remove Row Actions in an Existing WP_List_Table
- WordPress custom post type capabilities issue
- I am unable to login into my wp-admin
- Is it possible to take over a WordPress site if the old administrator is MIA?
- Dashboard Widget CSS
- How can I prevent redirects from mysite/page to mysite/wp path/page?
- How can I prevent a function from loading in the admin screens?
- Add styles to wordpress admin on the Page List
- making users.php search include a specific user meta data field without messing with the SQL query itself
- Move WooCommerce menu entries to top of dashboard
- Redirect an entire WordPress site on a subdomain, except wp-admin
- WordPress Admin Toolbar Disappeared when moved site to subfolder
- Admin sometimes redirects to HTTPS
- WP Core hard coded to use http://www.w3.org/1999/xhtml not HTTPS
- Hide user group filtering links
- 404 Admin Error
- Fix Admin Dashboard Posts tab
- auto generated robots.txt problem
- Change maxlength of link_description in dashbord link section?
- Add a custom field when adding / editing a page / post in admin panel
- View all comments on post one click
- wordpress wp-admin/includes/shema.php file has been modify alone
- Broken Customizer page
- I can’t access my wp admin dashboard
- wp-admin going directly to 404
- Should I move wp-admin to a separated server? How to do it?
- WP-Admin throws 404 after changing wp-config Salts
- How to create a new section on the wordpress admin dashboard?
- What event I can tap into that fires before loading wp-admin page?
- Weird white space in admin area
- How to logout the current user without notices and warnings?
- Updated to wordpress 5.5.1 doesn’t work
- How can I change block editors suggested links to display another url (i.e. from api.mysite to www.mysite)
- How to fix the view of admin all posts
- mixed contents admin panel is Unsecured
- Link with password is not sent to the new user
- How to change labels in the projects page
- Can’t access Network Admin dashboard in wp-admin
- Can I rename the wp-admin folder?
- How do I list subpages in post editor view?
- Remove View details option from plugin listing
- wp-admin won’t load for users behind a Barracuda F600 firewall
- WordPress wp-admin login problem
- Failed to load resource: the server responded with a status of 431 ()
- Database problem
- WordPress Admin Page Redirecting to Subdomain
- Remove Theme menu link from Admin Panel
- Why does my edit screen suddenly have such a buggy interface?
- Disabling WP-Admin Caching in htaccess
- Unable to log in as admin
- Add files to wordpress admin panel footer
- Can I rename the wp-admin folder?
- WordPress Child problem in admin
- SSL doesn’t deliver parts of WordPress Administration Module
- WordPress admin option, I can’t use jquery ajax to access my content from another file
- Why WordPress not logout after I have close my browser?
- How to display product category’s individual product list in shop page?
- Images on admin backend not showing up
- WordPress br in content problem
- How to troubleshoot 404s in WordPress admin
- Launch wordpress site to local computer from live website backed-up
- How do I unset all of the select boxes for pages
- wp-admin won’t “remember me” in Chrome & Firefox
- admin showing Array() after adding exit() code