0

How can I remove only pages from Admin Bar?

enter image description here

2

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
  $wp_admin_bar->remove_menu('new-page');
}
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, privacy policy and cookie policy

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