BlogTutorials

How to Remove Menu Item in WordPress Admin Panel

Have you ever ever labored with a shopper who has a tough time understanding expertise? Nicely, as a advisor, designer, or developer, it’s your job to make issues simpler for them. WordPress admin panel comes with numerous choices within the menu, however you’ll be able to do away with them pretty simply if obligatory. With certainly one of our purchasers, we would have liked to do away with few menu gadgets, so it’s simpler for her to grasp issues. On this article, we are going to present you ways simple it’s to take away a menu merchandise within the WordPress Admin Panel.

For WordPress 3.1 or above, simply paste the next code in your theme’s features.php file:

1
2
3
4
add_action( 'admin_menu', 'my_remove_menu_pages' );
perform my_remove_menu_pages() {
    remove_menu_page('link-manager.php');  
}

In model previous to WordPress 3.1, you would wish to stick the next code in your theme’s features.php file:

1
2
3
4
5
6
7
8
9
10
perform remove_menus () {
international $menu;
    $restricted = array(__('Hyperlinks'));
    finish ($menu);
    whereas (prev($menu)){
        $worth = explode(' ',$menu[key($menu)][0]);
        if(in_array($worth[0] != NULL?$worth[0]:"" , $restricted)){unset($menu[key($menu)]);}
    }
}
add_action('admin_menu', 'remove_menus');

The code above will do away with the Hyperlinks choice for all customers (together with directors). Solely two user roles are allowed to see the Hyperlink tab (Directors and Editors). Now if that is for a multi-author web site (the place there are a lot of editors), and also you as an administrator nonetheless need entry to the Hyperlinks menu, then you’ll be able to add parameters to take action.

You would wish to make the most of the perform current_user_can(), and with a easy if assertion, you’ll be able to do away with the hyperlink menu or different gadgets for particular consumer position.

It is a very useful trick for consultants and builders who work on bigger websites.

Download The WPSaviour App Now

Related posts
Best WordPress PluginsBlog

How to Duplicate Theme Files from WordPress Admin Panel

BlogTutorials

How to Disable Plugin Deactivation from WordPress Admin Panel

BlogThemes

How to Display Any Number of Posts in a WordPress Loop

BlogThemes

Change the Footer in Your WordPress Admin Panel

Leave a Reply

Your email address will not be published.

Pay in your preferred currency
Indian rupee
Euro