Site logo

Archived topic

Remove items from dashboard menu

1 reply · Started by Kaleem on February 18, 2018

Viewing posts 1–2 of 2

Hello sir, seriously i must commend you for your wonderful supports.
Please kindly help me with the following code:

/*
REMOVE DASHBOARD MENUS FOR ALL BUT ADMINISTRATOR
*/
if ( ! current_user_can('manage_options') ) {
add_action( 'admin_menu', 'notadmin_remove_menus', 999 );
}
function notadmin_remove_menus() {
remove_menu_page('tools.php');
remove_submenu_page( 'themes.php', 'themes.php' ); // hide the theme selection submenu
remove_submenu_page( 'themes.php', 'widgets.php' ); // hide the widgets submenu
remove_submenu_page( 'themes.php', 'customize.php?return=%2Fwp-admin%2Fprofile.php' ); // hide the customizer submenu
remove_submenu_page( 'themes.php', 'themes.php?page=generate-options' ); //hide generatepress submenu
}

I used the above code to remove items from dashboard "Appearance sub menus" and it successfully removed them except "Customizer" and "Generatepress" . please any correction in the code?

This archived topic is closed to new replies.