Around 43% of all websites on the internet use WordPress as their content management system (CMS). This is not surprising when you consider how easy it is to create and manage websites with WordPress.
When you use WordPress to build a large website with lots of users, you may want to customize its settings, including hiding menu items for specific users of the site. Let’s look at how you can do that.
Reasons for hiding menu items for specific users WordPress
When someone enters the administration area of your website, they have to log in via the wp-admin page. By default, WordPress allows admins to access every function available in the admin area, which is why they have varying levels of access to give users (like Editor and Subscriber).
If you grant someone admin access, they can change anything on your website without asking you. This can be a problem if you run a multi-author website or have clients visiting the admin area.
Most users do not need full access to every tool in the administration area. If they use a tool they shouldn’t use or change a setting they shouldn’t change, you can easily break your website. It’s better for both people if only admins have full access, and editors cannot edit functions beyond their needs.
User roles determine how much control authority someone is given on the website. For example, the site owner has control over everything, including the most important settings. Conversely, someone with a guest user role can only see a small selection of menus and use a few functions in the administration area.
If you run a website with multiple authors, setting up user roles is crucial. If you don’t, everyone will automatically be considered an administrator. Anyone who logs in to the administration area can add, change and use anything they want.
There are essentially two options to hide menu items for specific WordPress users.
1 Use a plugin
For beginners and general WordPress users who have no experience with coding, we strongly recommend using plugins, as they’re much easier to use. Members is a great free plugin that helps you solve this problem, as it allows you to create new user roles and edit what they can and cannot do in the administration area.
After you have installed the plugin, its working menu appears in the main menu bar of your administration area.

Click on the “Members” tab and go to the “Roles” sub-tab. The plugin displays a complete list of all user roles on your website – you can add new user roles using the Add new function at the top of the list.
Use the small Edit button at the bottom of the desired role to open the user role editor. In this editor, you can see all the authorizations that you can grant or deny to users.
For example, if you want to create an author role, click on Grant in the settings. Then, give them the ability to add and edit new posts on your website. Then, click on Apply.
Now anyone listed as an author can add and edit new articles, but cannot delete other people’s work. Plugins like Members are very easy and intuitive to use – that’s why we highly recommend this approach to most users.
2 Remove admin menu with code
You also have the choice to manually modify the theme’s code to change the user menu. To do this, you have two options:
- Insert a code snippet into the child function in the functions.php file.
- Use a plugin called Code Snippets to insert the code into your system.
We strongly recommend that you choose the latter route. This way, all your settings will be preserved, even if you change the theme of your website.
A second disadvantage is that this method only prevents visitors from seeing the menu items in their administration area.
In other words, we’re only showing you how to hide menu items in WordPress. Users can still access these tools if they have direct links to them. You’ll need other instructions if you want to block access to or use of parts of the web admin area.
Cloning a WordPress administrator user role
The first step is to create a new user role. An easy way to do this is to clone the default administrator user role. The new, duplicated user role will have all the administrator rights that we will change later. We will call this clone “Site Author”.
Open Code Snippets and paste this code into the field:
/**
* Create a new 'Website author' role by cloning Administrator capabilities
*
* This function creates a new role called 'site_author' with the display name 'Website author'
* and copies all capabilities from the Administrator role to this new role.
*/
function cloneRole() {
// Get the Administrator role object
$adm = get_role('administrator');
// Check if we successfully got the administrator role
if ($adm) {
// Get all capabilities from the administrator role
$adm_cap = array_keys($adm->capabilities);
// Create the new 'site_author' role with the display name 'Website author'
add_role('site_author', 'Website author');
// Get the newly created role
$new_role = get_role('site_author');
// Add all administrator capabilities to the new role
foreach ($adm_cap as $cap) {
$new_role->add_cap($cap);
}
}
}
Remove specific WordPress admin menu item for users
Once you have cloned a new user role named “Site Author”, pay attention to the slug named “site_author”. You can use the slug to call the specific user in the code.
Now let’s say you want to remove the “Site Admin” menu item from users listed as “Site Author”. Copy this code and paste it into Code Snippets:
/**
* Hide update notifications for site authors
*
* This function removes the WordPress core update page from the dashboard
* for users with the 'site_author' capability.
*/
function hide_siteadmin() {
// Check if current user has the 'site_author' capability
if (current_user_can('site_author')) {
/* DASHBOARD */
// Remove the WordPress update page from the dashboard menu
remove_submenu_page('index.php', 'update-core.php');
}
}
// Hook the function to the admin_head action
add_action('admin_head', 'hide_siteadmin');
Once you apply this code, the “Update” menu item will be removed for the users listed as “Site Author”.
You can modify this code snippet to remove other functions and hide the menu item in WordPress.
Conclusion
If you run a multi-author website, it’s very useful to know how to hide menu items for specific users in WordPress. This will keep your website safe from accidents and malicious actors. In addition to hiding menu items, you can also hide your WordPress content from certain user roles.