Open you theme’s functions.php file and add the below code or you can also add the below code if you are using any site-specific plugin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | function fwm_hide_item_menu_dashboard(){ if( !(current_user_can('administrator')) ) { remove_menu_page( 'index.php' ); //Dashboard remove_menu_page( 'edit.php' ); //Posts remove_menu_page( 'upload.php' ); //Media remove_menu_page( 'edit.php?post_type=page' ); //Pages remove_menu_page( 'edit-comments.php' ); //Comments remove_menu_page( 'themes.php' ); //Appearance remove_menu_page( 'plugins.php' ); //Plugins remove_menu_page( 'users.php' ); //Users remove_menu_page( 'tools.php' ); //Tools remove_menu_page( 'options-general.php' ); //Settings } } add_action( 'admin_menu', 'fwm_hide_item_menu_dashboard' ); |
There are also some plugins that can help you out if you prefer that route over coding yourself:
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.