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?
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- Unit testing in the WordPress backend (is_admin() is true)
- How do I change the login logo URL and hover title?
- Restrict admin access to certain pages for certain users
- js error on post editing page
- How to add a custom metabox to the Menu Management admin screen?
- How to change the wording in wp-admin back-end?
- How to make ajax call in wordpress in right way?
- Bulk Delete Users Error uri too large
- Can you change the main heading of a page in the WordPress admin (without output buffering or JavaScript)?
- Change the Return URL from the Customizer
- Where can I edit Admin Panel Page file
- From 403 error to 500 internal server error
- Create a admin page in wordpress without admin menus (“wordpress sidebars”)
- Where are the admin notifications stored?
- New wordpress install, what are the reasons the “Install Themes” tab is missing?
- Customise WordPress Update Notice in wp-admin backend area
- wp_comments table really big casuing /wp-admin/edit-comments.php to slowly load
- I get a 404 page on /wp-admin but not wp-login but as soon as I login I get a 404 again [closed]
- I want to disable login of admin (/wp-admin) with email and make it accessible only with username
- password reset link being sent as HTTP?
- Post.php is blocked by server? How to unblock? [closed]
- WP-Admin shows (1) update but there is no update for plugin, theme or WordPress
- Do I have to face security problems if I changing default role to Contributor
- Editor’s role in WP
- Minimum version for WordPress Backbone
- I accidentally deleted an admin user and all their content is now gone from the site. [closed]
- Detect Featured Image remove while editing post in wp-admin (client-side)
- Cannot log in to the admin, no error message [closed]
- Need help for WordPress User Session Management?
- Create reviews and star-rating for user accounts in wp-admin [closed]
- Disable Admin CP authentication (or auto login)
- can’t access backend while frontend works perfect
- How to add Extra Column of post Status in All post page
- Developer/Designer asking for admin access
- WordPress Child theme fails to override parent theme css
- How to change home page only in WordPress
- Admin menu success message
- Pages section (only) not loading after publishing large number of pages
- Users can login to Website from wp-admin prior to confirmation email
- wp-admin 503 error
- Admin Page access
- Add HTML to custom post type edit page
- WP site after login keeps redirecting to looped url [closed]
- Locked out of site admin after change of URL
- WordPress Admin Login Issue
- Edit “Not Available” Page
- admin-ajax and external service interaction
- Add admin page to the top of the admin panel
- Admin page changes the $_POST data
- Remove menu item dashboard for a unique user
- Reestablishing Automatic and Secure FTP Connection, Primary Domain Change
- str_replace in wp-admin
- Admin area is not loading properly
- Changed the path to wp-login and now can’t access WPress dashboard
- Why my login panel has a wrong language?
- Using meta_query in add_query_arg
- Mixed content and expired session issues with SSL and wp-admin
- Limit access to wp-admin but still be able to log in from different locations?
- How to Filter in the “Add Media Popup” to show only “unattached” Media
- Working with post values in the admin panel
- wordpress login blank screen [closed]
- Can a wordpress admin see my failed Login attempts?
- My website does not load since two days!
- After Upgrade: $user becomes unknown (id: 0) after successful login?
- Redirect users based on their roles, is_admin()
- insert an admin table inside another admin page
- /wp-admin/ – this link showing me “Index of /wp-admin”/ instead of dashboard
- What methods are you using to transfer individual WP site components from one site to another?