To remove from the admin menu, you could use remove_menu_page():
add_action( 'admin_menu', function ( ) {
if (is_super_admin())
return;
remove_menu_page();
// or remove_submenu_page( ...
},99);
If for some reason the page still exists, it’s just missing it’s menu link, you could check the get_current_screen() to see if the page is being viewed, and prevent access:
add_action( 'admin_notices', function ( ) {
if (is_super_admin())
return;
$screen = get_current_screen();
if ($screen->parent_base == 'all-in-one-seo-pack') { // or wtv
wp_die('get out');
}
},99);
Related Posts:
- User restricted only show posts assigned to current user
- Hide front-end from every logged out user and redirect them to the default login page
- wp_update_user not updating
- Is WordPress’ is_user_logged_in() secure?
- Temporarily disable user role login and replace with message
- how to add custom user capabilities using add_user_meta or something else?
- Is there a way to set the user Role based on email domain
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- What is the difference between “create_users” and “add_users” capabilities?
- Access on specific pages in wordpress for a specific user
- How to ‘unpublish’ or ‘hide’ posts when user role changes?
- Hide Specific User Page
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- Hide everything on site for visitors except specific page IDs
- How do I remove the Other Roles field (from User Role Editor plugin) in wp-admin/user-new.php
- How to redirect specific post type with user role
- wordpress editor role remove all but ‘menus’ in appearance menu
- Parent User and Child User – relate users
- How to create user specific pages (not user role!)?
- Assigning certain authors to specific editors
- Restrict Access in Admin Panel
- Limit a user to have access to only specified pages?
- Plugin creation – how to add user rights?
- Restrict custom post content to specific user
- Need to block user role from accessing bbPress all together
- How to create a front facing user sign up, log in and profile pages like FoodGawker.Com [closed]
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend
- How to make WP page accessile only to specific user roles
- grant multiple roles access to specific admin menu item
- How to show private pages based on a user’s role?
- Check what capabilitie(s) an action requires
- Is it possible to restrict a specific user to edit a specific custom post.
- Assign specific editor with custom user meta “A” to all authors with custom user meta “A” and exclude all other author access
- New folder and file permissions are not correct
- How to change user role setting in members plugin so that user can only edit his own post?
- How to restrict content on a subdomain to users that registers on main site?
- add_role() run only once?
- Allow user to Publish, but not Edit or Delete
- Email notification for editors only
- Custom Post Type’s Capabilities map_meta_cap issues
- Adding multiple user roles dynamically
- Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end
- How do I allow anyone to edit a post — but not access dashboard
- How can I change plugin to give access to editor user role?
- Conditional Tags for Membership Levels when using Wishlist Member Plugin?
- Allow user to edit specific user with meta key using map_meta_cap
- How to restrict access to specific pages on the back-end?
- Can you set a role as author?
- New user created as Participant rather than Contributor [closed]
- How can I disable the update notice for non-administrators?
- How to disable a specific page for a specific user
- Where are the WordPress capabilities stored?
- Display user meta by different user role
- Custom user roles for access to specific parts of the site
- Subscriber (with read permissions) cannot view Private posts
- How can I add a custom role capability to use in a custom plugin?
- Add a button or radio box that update the user role
- Create custom post with custom user rules
- Purpose of Adding Capability to Role But Not Grant?
- bbPress: How to set conditional for specific user -or- user role, to be displayed in user profile
- Menu page with list of users
- How to check user role?
- how to remove some permissions from a shop “manager role” in woocommmerce?
- Create a User Role with permissions to only upload files to the media library?
- Get and display a user’s profile info?
- How to get a users list by who created them?
- Paypal API and WordPress
- Is there a Capability that checks as true for non-logged in users?
- Restrict access to trash, only admin
- Building Forums with Custom Post Types
- How to write conditions based on user capabilities not on user role?
- Redirect admin 403 “Cheatin uh?” admin pages
- Capabilities don’t add
- Migrating Roles from one environment to another
- Letting users create a post that is a custom post type from a page
- Is WordPress secure enough for a multi-user article directory?
- Is there a way to create folders restricted to specific users to open?
- Learndash change user role after completing the course
- How to disable activation email to specific user role?
- logout users with specific role after close browser tab
- Admin user name not showing up in author dropdown
- Separate user bases or hide users of another role or connected to another minisite
- How to restrict subscriber editing other posts but read specific posts in backend
- Publishing post strips custom html element when user is not admin
- Best practices to handle multilpe roles and capabilities?
- Allow multiple roles to specific user
- How do I restrict a second admin certain access?
- user has permission to read a custom post but it is not being shown in wordpress plugin
- Restrict custom fields based on user roles
- Select dropdown with 2 choices from foreach
- translate_user_role doesn’t work
- Remove All in One Seo from Posts for Contributors
- How do I make a draft post accessible to everyone?
- How to assign role to a custom registration form?
- How to add user roles? [closed]
- Check if specific role exists
- How can I display customizer’s “Additional CSS” to administrators and editors (in multisite)?
- How can I add the User Menu for Authors (role)?