WordPress Tip: Remove Items from the Admin Menu
I wrote this post a while back. The content can still be relevant but the information I've linked to may not be available.
Yesterday I was working on a WordPress site and a question came up about removing (or hiding) top level items from the Admin Menu (for all users). This is what I've used in other projects:
function edit_admin_menus() { remove_menu_page('page-you-want-to-remove.php'); } add_action( 'admin_menu', 'edit_admin_menus' );
Change page-you-want-to-remove.php
to the page you want to hide. Put the code in your functions.php file. That should be it.
WordPress Codex: remove_menu_page function
Comments
14 Feb 2014 19:07:25
Good tip Clive but using functions.php for such tweaks should be avoided. Check out http://dev7studios.com/adding-code-customisations-wordpress-the-right-way/.
14 Feb 2014 19:33:03
Thanks Iain, that looks like a really useful method. I would normally only edit a child theme functions.php but your approach is better. Cheers!
Comments are OFF for this post.