by Tom Millard

Hide Wordpress menu options

wordpress - php

I recently had to work with a Wordpress 'hand-me-down' with a rather large Admin menu.

The problem with giving the user too much choice is that they become overwhelmed and quickly the responsibility of looking after a website fall back to the developer.

So in order to give the user a system they can maintain themselves it might be worth removing some of the unnecessary menu options that only a developer/Admin would need.

function edit_admin_menus() {
    global $menu;
    global $submenu;
    global $user_ID;

    //page keys to be removed
    $pages = array(

        foreach($pages as $p){


add_action('admin_menu', 'edit_admin_menus');

Note: sometimes you will need to check the $menu object to get the key you need for the menu option you wish to hide.