Web Development WordPress

Remove menu items from WordPress Dashboard

Clients can sometimes be very hard to handle. There might be certain things that you would not want your client to use on the WP back end. Since you can not ask them not to use it, what would be a better option is if you could hide those unwanted menu items from the Dashboard itself. Here is a snippet that does just that. This code should go in your functions.php file.

 

function wps_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
$wp_admin_bar->remove_menu('about');
$wp_admin_bar->remove_menu('wporg');
$wp_admin_bar->remove_menu('documentation');
$wp_admin_bar->remove_menu('support-forums');
$wp_admin_bar->remove_menu('feedback');
$wp_admin_bar->remove_menu('view-site');
}
add_action( 'wp_before_admin_bar_render', 'wps_admin_bar' );