How to Hide Unnecessary Menu Items from Admin Menu in WordPress |
X

Congrats, You are Subscribed to Receive Updates.

How to Hide Unnecessary Menu Items from Admin Menu in WordPress


How to Hide Unnecessary Menu Items from Admin Menu in WordPress. Sometimes we feel irritated with unused items in WordPress admin menu . So here I just thought to hide certain items from the admin menu, which i dont like to use all the time. From the admin menu items, I dont use the following items not properly.

  • Media
  • tools
  • Appearance -> Editor
  • Appearance ->Customize
  • Plugins -> Editor.

That’s it, Probably you may use these above items and want to hide some other items from the menu. So, Here I gave you the code to hide it. Here you can hide Admin menut items using the following code. You can also remove the sub menu items too.

Untitled-1

1. Menu Hide : 

The “remove_menu_page” will help you to remove the main menu items like, themes.php, plugins.php, and etc. Here is an example for it.

add_action( 'admin_menu', 'kv_admin_link_hider' );
function kv_admin_link_hider() {
	remove_menu_page('plugins.php');	
}

The above one will remove the plugins from the admin menu.

2. Submenu Hide

Here is the Submenu hider functions with examples,

add_action( 'admin_menu', 'kv_admin_link_hider' );
function kv_admin_link_hider() {
	remove_submenu_page('plugins.php', 'plugin-editor.php');		// admin plugin editor
}

The above code will hide the  Plugin Editor from the Admin menu. The same way you can remove any link from the admin.   You can remove the link based on user roles. Here i am going to hide the plugin editor for the administrator Role. Here is the code to hide Editor for the Administrator.

if(current_user_can('mange_options')) {
       add_action( 'admin_menu', 'kv_admin_link_hider' );
       function kv_admin_link_hider() {
	   remove_submenu_page('plugins.php', 'plugin-editor.php');	
       }
}

Likewise you can do many operations with “remove_submenu_page”  function.  Comment below your views and problems.

 

 

 

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, PHP and Data Analyst. Database Management Advance Level

2 comments

  1. commenter

    I have comments deactivated in adminimize in the menu options but it stil shows up on the admin screen for all users. I would like only admins and editors to see the comments.

Comment Below

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar