The WordPress admin panel contains so many items that you may not require for regular usage. These items include the Dashboard menus, sub-menus, widgets, post-edit areas, among others. Generally, you will be using few options and many other options always there without much use. The good news is that you can remove some of these items if you don’t like them. This article will give you a step-by-step guide on removing unnecessary menu items in your WordPress admin panel.
Related: Learn how to fix slow WordPress admin dashboard.
Remove Unnecessary Menu Items from WordPress Admin Panel
We will look at two main methods:
- Remove menu items automatically with the Adminimize plugin
- Remove menu items manually with code
1. Using Adminimize Plugin
The Adminimize plugin allows website administrators to grant user roles to users with varying levels of authority. Since the Adminimize works by hiding unnecessary items via the WordPress backend, you can customize the admin area for each user role. To get started using the plugin, install it from the WordPress plugin page and activate it. After a successful install, navigate to the “Settings” menu on the dashboard and click on the “Adminimize” option to configure it.
The Adminimize plugin has so many options on how to go about removing menu items that you may not want to use. However, this article will concentrate on the mini menu option. That is the first item you will see at the top of the Adminimize configuration window. It contains several options which you can use to remove unnecessary menu items from WordPress admin panel.
Menu Options
On the “MiniMenu” item, scroll down and select the “Menu Options.” It has been divided into sections representing the different user roles available on WordPress. They include deactivate for administrator, deactivate for author and deactivate for the editor, among others. In addition, each user role column contains a series of checkboxes that you can use to deactivate menu items for specific users.
Once you have decided on what particular menu items you want to remove and for which user role, click on the respective checkbox to mark the menu item. Once done, scroll down and click on the “Update Options” button to apply changes.
Note: Your new modifications will not appear on the plugin’s Settings page. You will need to open another admin page in a separate browser tab to see the changes in action.
To demonstrate how the plugin works, create a new user with the role “Author.” You can easily add new users from the “Users” menu on the WordPress admin panel. When done, deactivate menus items like posts, media, pages, and comments for this particular user, as shown in the image below.
After applying the changes and logging in as the “Author,” you will notice that on the dashboard of our author, the menu items ‘posts, media, pages, and comments will not appear. The image below demonstrates what just happened.
Widget options
WordPress widgets are blocks of content that you can insert in your footer or sidebars. The Widgets option can be found under the “Appearance” menu on the WordPress admin panel and contains different options depending on the theme you are using.
The “Adminimize” plugin gives you an option to deactivate widgets for particular users on your WordPress site. On the “MiniMenu” item, scroll down and select the “Widgets” option to expand it. Like the “menu options,” it contains columns of the different user roles on our WordPress site and checkboxes to disable the various widgets available for WordPress.
For this post, we will disable the Footer, Pages, calendar, Archives, Image, and Audio widgets for our Author.
Once done, scroll down and click “update options” to apply the changes.
Remove Menu Items Manually with Code
Alternatively, if you don’t want to install multiple plugins on your WordPress site, you can opt to remove the unnecessary menu items with a simple PHP code. Again, you don’t need to be an IT guru or well versed with PHP. Just copy the necessary code below and paste it into the Themes Function file.
There are two ways we can do this:
- Creating an array of menus we want to hide
- Using the remove_menu_page() WordPress Function
Creating Array of Menu Items to Hide
This method is relatively straightforward to use. Create an array with the name of menu items that you want to hide. Luckily, the names of these menu items are just as they appear on the WordPress admin panel. Dashboard, Posts, Media, Pages, Comments, Appearance, Plugins, Users, and Tools. For example, to hide the menu items Plugins, Users, Comments, and Tools, paste the code below in the functions.php file.
function hideUnncessaryMenuItems () {
global $menu;
$itemsToHIDE = array(
('Tools'),
('Users'),
('Comments'),
('Plugins')
);
end ($menu);
while (prev($menu)){
$value = explode(
' ',
$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $itemsToHIDE)){
unset($menu[key($menu)]);
}
}
}
add_action('admin_menu', 'hideUnncessaryMenuItems');
From the image below, you can see that we have successfully hidden the Plugins, Users, Comments, and Tools menu items.
Using remove_menu_page() WordPress Function
The remove_menu_page() WordPress function is a little different from the Array method we discussed above. Unlike the array method, where you passed the menu item’s name as the value, this method uses default menu slugs, as shown in the table below.
Menu Item | Menu Slug |
---|---|
Dashboard | index.php |
Jetpack | jetpack |
Posts | edit.php |
Media | upload.php |
Pages | edit.php?post_type=page |
Comments | edit-comments.php |
Appearance | themes.php |
Plugins | plugins.php |
Users | users.php |
Tools | tools.php |
Settings | options-general.php |
function hideUnncessaryMenuItems(){
remove_menu_page( 'edit.php' );
remove_menu_page( 'upload.php' );
remove_menu_page( 'edit.php?post_type=page' );
remove_menu_page( 'edit-comments.php' );
}
add_action( 'admin_menu', 'hideUnncessaryMenuItems' );
On the image below, you can see that we have successfully hidden the Posts, Media, Pages, and Comments menu items.
Conclusion
This post has given you a step-by-step guide on how to hide unnecessary menu items from WordPress admin panel. If you manage a website with multiple users and need a quick and straightforward method, the Adminimize plugin would be a great option. Alternatively, If you are versed with PHP and want to put your coding skills into practice why not play around with the functions.php file.
Leave a Reply
Your email is safe with us.