The WordPress codex is full of fun little things that you can experiment with. Have you ever wanted to remove a menu page from the WordPress dashboard? Perhaps you’re building a site for a client who gets confused by the settings menu. Blow the dust off of your handy codex and check out the function references for removing menu pages.
Here’s what you’re looking for:
1 |
<?php remove_menu_page( $menu_slug ) ?>
|
Replace the menu slug with the name of the php script for the menu item you want to remove.
Here’s a quick example. Let’s say you want to remove the posts menu. Who needs to write posts?

Just for kicks, let’s remove the settings menu, too. Here’s the before and after:

The quick and dirty way to do this one is to add it to your theme’s functions.php file, but that’s only if you’re feeling like a lazy goose. The best way to add this type of modification is to create a functionality plugin. Don’t worry it’s very easy. Just open a blank text file and add a little information about your plugin and then your code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php
/*
Plugin Name: Remove Settings and Posts Menu
Description: Just don't want my settings menu anymore and I don't want to write any posts - what's the big deal?
Version: 0.1
License: GPL
Author: Sarah Gooding
Author URI: http://untame.net
*/
add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
remove_menu_page('options-general.php');
remove_menu_page('edit.php');
}
?>
|
Save this as remove-menu.php or whatever you want to name it. Then upload it to wp-content/plugins.
Last step: Don’t forget to activate your little plugin. You’ll find it among your inactive plugins, ready to activate:

That was easy, wasn’t it? Please be advised that this only removes the items from the menu but does not prevent a user from accessing those pages, should he know where they are located. For that you’d be better off using a more comprehensive option that limits users based on roles and capabilities.
Before turning to the plugin repository, you may want to have a little fun exploring the codex. You might find exactly what you need to create your own quick plugin.
Ah, thats a nice one! However – any tips on how to do the same for the adminbar?
If anyone wants to know how to remove any of the other items in the menu I made a handy table at the bottom of this post – http://sethstevenson.net/customize-the-wordpress-admin-menu-based-on-user-roles/
Does this work only for the main menu items? I edited it for just the Tools / Import item (import.php), and it seemed to have no effect. The menu item was still there and import.php was accessed with it.
To remove the import link use remove_submenu_page( ‘tools.php’, ‘import.php’ );
You can see the link I posted above for all the other menu items.
That did the trick! Thanks, Seth.
I’m more likely to eliminate some submenus from client sites… well, maybe Links from some.
Hi,
This post is very valuable, thank you. I applied it.
But I have a more question;
how can I remove contact form7 from dashboard, because it is like this;
……com/wp-admin/admin.php?page=wpcf7
what have I to write to remove_menu_page(‘?????’);
Thanks for your cooperation.
Regards
What about a plugin to hide menu options (theme, editor, plugins etc )from clients and limit users based on roles and capabilities.
Now that would be a great plugin:)
Maybe included into your white label branding plugin.
Great post, and a funny picture “One does not simply remove” :) reshared
Very handy little trick. I like to use this when I create a WordPress based site for a client and don’t want them to have access to certain settings that I’m afraid they might tinker with (and mess their site up).