Latest Tech and Tips

How to Remove Menu Item in WordPress Admin Panel


Have you ever before collaborated with a customer that has a difficult time comprehending innovation? Well, as a professional, developer, or designer, it is your task to make points much easier for them. WordPress admin panel includes a great deal of choices in the menu, however you can remove them rather conveniently if needed. With among our customers, we required to remove couple of menu products, so it is much easier for her to comprehend points. In this short article, we will certainly reveal you how simple it is to remove a menu item in the WordPress Admin Panel.

For WordPress 3.1 or above, simply paste the complying with code in your motif’s functions.php data:

add_action( 'admin_menu', 'my_remove_menu_pages' );.
feature my_remove_menu_pages() {
remove_menu_page(' link-manager. php');.

In variation prior to WordPress 3.1, you would certainly require to paste the complying with code in your motif’s functions.php data:

 feature remove_menus () {
international $menu;.
$ limited = range( __('Links'));.
end ($ menu);.
while (prev($ menu)) {
$ worth = take off(' ',$ menu[key($menu)][0]);.
if( in_array($ worth[0]!= NULL?$ worth[0]: "", $limited)) {unset($ menu[key($menu)]);}
add_action(' admin_menu', 'remove_menus');.

The code above will certainly remove the Links choice for all customers (consisting of managers). Only 2 user roles are permitted to see the Link tab (Administrators as well as Editors). Now if this is for a multi-author website (where there are numerous editors), as well as you as a manager still desire gain access to to the Links menu, after that you can include criteria to do so.

You would certainly require to use the feature current_user_can(), as well as with a straightforward if declaration, you can remove the web link menu or various other products for details individual function.

This is an extremely helpful method for experts as well as programmers that work with bigger websites.

Additional Sources

Remove Menu Page
Current User Can Function Reference
User Roles and Capabilities Chart