Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to completely remove (unset) the left hand side admin menu? I examined the ozh-admin-drop-down-menu plugin, since it removes the entire admin menu and adds a top menu bar in order to get a clue.. I made a few snippets, but probably I am missing sth.. I couldn't manage to find a way out..

share|improve this question
add comment

2 Answers

I don't think you can remove it globally, maybe with traversing the global $menu array.

But you can unset each individually:

add_action( 'admin_menu', 'Wps_remove_tools', 99 );
function Wps_remove_tools(){

remove_menu_page( 'index.php' );                     //dashboard
remove_menu_page( 'edit.php' );                      //posts
remove_menu_page( 'upload.php' );                    //media
remove_menu_page( 'link-manager.php' );              //links
remove_menu_page( 'edit.php?post_type=page' );       //page
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

}

share|improve this answer
    
Thank you.. but this removes only the menu items and leaves an empty gray bar.. –  ugurcem Dec 8 '11 at 19:58
    
You can just hide it with css then.... #adminmenuwrap{display:none;} –  Wyck Dec 8 '11 at 20:41
    
ok, that was the last option.. :) together with #adminmenuback{display:none;} and #wpcontent {margin-left: 15px;}, the admin bar is being removed visually and the remaining part of the page spans the area emptied by the admin bar. As far as I can understand there is no way to stop construction of the original menu.. Thank you for the ideas Wyck :) –  ugurcem Dec 9 '11 at 21:23
add comment
up vote -1 down vote accepted

Just to explain the solution better:

I made below additions to theme's function.php in order to remove visually (hide) left hand admin menu:

add_action('admin_init', 'add_custom_admin_style'); 
function add_custom_admin_style(){
    wp_register_style('custom_admin_style', content_url('themes').'/custom_admin.css');
    wp_enqueue_style('custom_admin_style');
}

And then I created custom_admin.css file in themes folder and put below lines:

#adminmenuwrap, #adminmenuback {display:none;}
#wpcontent, #footer {margin-left: 15px;}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.