There are a number of reasons for wanting to simplify the WordPress admin menu, perhaps you are a developer and have handed a new site over to the client and you don’t want to overwhelm them with options. The WordPress admin can be a little complicated if you are new to it and by removing options that are not needed for the function of their site you can make the transition to the CMS a little easier. Maybe you have a lot of plugins or custom post types so you want to remove the unused links to shorten your menu for ease of use.
Whatever the reason, its pretty easy to remove items so is this quick tip I will show you how to remove WordPress admin menu Items.
Adding this function to your theme’s functions.php will remove all menu items
function remove_menus()
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', 'remove_menus' );
If you just want to remove one item, for example the settings menu, use this code :
function remove_menus()
remove_menu_page( 'options-general.php' ); //Settings
add_action( 'admin_menu', 'remove_menus' );
You could also use this method to remove menus created by plugins you need to click on the menu item to get its URL the copy the last part into the function above. For example, to hide a portfolio post type with the URL:
http://yourdomain.com/wp-admin/edit.php?post_type=portfolio
You would use :
function remove_menus()
remove_menu_page( 'edit.php?post_type=portfolio' );
add_action( 'admin_menu', 'remove_menus' );
No comments:
Post a Comment