How can I remove only pages from Admin Bar?

enter image description here

1 Answer 1


The menu bar is all controlled by an object instantiated as $wp_admin_bar.

I think this is what you want:

function remove_page_menu_wpse_104826() {
  global $wp_admin_bar;
  // var_dump($wp_admin_bar); // debug; uncomment and look at the bottom of the page for the big mess
add_action('wp_before_admin_bar_render', 'remove_page_menu_wpse_104826', 1);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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