Written by: John | 24th Sep 2014
Do you want to remove certain unwanted elements from the WordPress admin menu, to stop your client from becoming confused or overwhelmed? Here’s how.
WordPress has a neat little function built in to do just that, namely: remove_menu_page().
The great thing about this function is the pages are not removed, just the admin menu link!
For example:
remove_menu_page( 'upload.php');
Would remove the link to the media library, but the page its self would still exist and could be accessed by the admin via: http://your-domain.com/wp-admin/upload.php.
How to use this function?
We need to add this function(s) to a hook and the best place to do this is functions.php. To remove Posts, Tools, Media, comments and a portfolio section (if your theme has one) add this to your functions.php:
//HIDE UNWANTED ITEMS FROM WP ADMIN MENU function your_admin_clean_up(){ remove_menu_page( 'edit.php?post_type=portfolio'); remove_menu_page( 'upload.php'); remove_menu_page( 'edit-comments.php'); remove_menu_page( 'edit.php'); remove_menu_page( 'tools.php'); } add_action('admin_menu', 'your_admin_clean_up');
That’s it! To find out more about the remove_menu_page function look here