Remove a top level admin menu:
function custom_menu_page_removing() {
remove_menu_page( $menu_slug );
}
add_action( 'admin_menu', 'custom_menu_page_removing' );
To remove only certain menu items include only those you want to hide within the function.
To remove menus for only certain users you may want to utilize current_user_can().
You can take a look at https://codex.wordpress.org/Function_Reference/remove_menu_page
Related Posts:
- What action should I hook into when adding roles and capabilities?
- What’s the difference between Role and Meta capabilities; When to use map_meta_cap() filter
- Disable posts, only allow to edit existing pages, not create new ones (create_posts)
- How to get all capabilities of an existing user role
- Does the “promote_users” capability allow someone to create a new admin account?
- Add Media Upload Capabilities Needed for Custom Role for non-Posts
- How can I prevent a writer from being able to edit an article that has been scheduled?
- Check whether user can delete a given post
- Allow unfiltered HTML in titles for low level users?
- Allow users to set a post author
- Unify the roles and caps?
- Filter list of rules based on a capability
- Using author_can() on custom post types in WordPress
- How to show a admin bar menu item only to users with certain capabilities?
- Theme option editing capability problems
- Assign multiple roles , overlapping capabilities
- Add capability to a role , so user is only able to view his own posts
- Is there a way of retrieving the core WP capabilities?
- Best Roles and Capability on a site with review features using a front end custom post
- Manage Roles and Capabilities on Multi-site
- add_role() run only once?
- Custom post type role permissions won’t let me read
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- What is valid timing of using current_user_can() and related functions?
- Groups of capabilities: users with multiple roles?
- Allow user to Edit Posts but not Add New?
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Apply custom role capabilities to administrator (without plugin)
- Possible to make custom role in multisite that can add sites?
- How to enable the theme editor cap for an editor role?
- current_user_can( ‘edit_post’, $post_id ) does not work for contributer but for administrator
- Editor role cannot save custom theme options
- How can I prevent users from creating new categories?
- How to Structure a New Role/Capability Scheme?
- Allow user to Publish, but not Edit or Delete
- How to allow Unfiltered HTML in a wordpress multisite install
- Author Role – Allow editing of Gallery images
- What is the difference between “create_users” and “add_users” capabilities?
- How to change menu page capability
- Role Capabilities: Add New Ones?
- Allow user to edit specific user with meta key using map_meta_cap
- How to remove sticky post capability for a specific user role?
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Add custom capabilities to existing custom post type
- How to restrict access to specific pages on the back-end?
- allow edit of custom post type but not regular posts?
- Users with custom roles can’t read each other’s comments
- add_menu_page() for more than one user role
- Why is my Custom Post Type not showing up after adding capabilities?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- Where are the WordPress capabilities stored?
- Custom user roles for access to specific parts of the site
- map_meta_cap woes
- Roles for Custom Post Types
- can’t see custom post content filtered under “mine” filter in admin panel
- Add, edit specific CPT with custom role
- Giving permission to anyone (non-users as well) with a password to edit a post, possible?
- Allow users with Editor role to edit menus (without a plugin)
- How can I add a custom role capability to use in a custom plugin?
- “Submit for review” for updates on existing posts
- Add a role and give admin priviledges
- Usage of current_user_can()
- “edit_published_posts” and “edit_other_post” issue
- Adding post tags without capability edit_posts
- Reset Roles (or undo role changes on theme change)
- Remove capability from specific user
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- Custom Capabilities for CPT and Problem with current_user_can()
- Which capabilities are available in Gravity Forms Salesforce plugin? [closed]
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Select other roles as custom post authors
- User Capabilities are not available in WP REST permission callback?
- Prevent all users from editing posts except admins using hooks
- Why cannot author edit pages?
- Plugin page and capabilities
- Roles and Capabilities in Custom Post Types
- Require Capability to View Woocommerce Product
- User role and capablities only for 1 plugin
- Create role that can edit some user details, but not the role
- How can I add capability to multiple roles?
- Create a Capability category to group a few custom Capabilities
- Disabling user capability to edit_posts or delete_posts in the front-end
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- Why the capability ‘activate_plugins’ is needed to allow a role to see all posts/pages/comments?
- admin can not change author profile picture
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Run only on plug-in activation instead of wp_head
- creating different edit screens for different roles
- Users can only save their draft once before saving for revision
- Add role and edit page capabilities
- Hide user fields based off capability
- Author capabilities: Deleting comments on their own published posts
- Capability to read user’s own draft post of CPT
- Custom post type & role issues
- Want to add post to user dashboard
- Sync roles across several plugins
- Explanation of User Roles and Capabilities
- edit slider plugin capability for custom_role