Skip to main content
Question Protected by CommunityBot
Tweeted twitter.com/#!/StackWordPress/status/485745709732618240
improved formatting, title, tags
Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

Remove How to remove admin menu pages inserted by pluginplugins?

Source Link
tmyie
  • 873
  • 2
  • 13
  • 21

Remove admin menu inserted by plugin?

I've got the following code, which cleans up a lot of stuff that is not going to be used within the admin area:

add_action( 'admin_menu', 'my_remove_menu_pages' );

function my_remove_menu_pages() {
  remove_menu_page( 'edit.php' );                   //Posts
  remove_menu_page( 'upload.php' );                 //Media
  remove_menu_page( 'edit-comments.php' );          //Comments
  remove_menu_page( 'themes.php' );                 //Appearance
  remove_menu_page( 'users.php' );                  //Users
  remove_menu_page( 'tools.php' );                  //Tools
  remove_menu_page( 'options-general.php' );        //Settings

};

However, there are two menu items that have been inserted from plugins.

When I hover over each menu item, it says the links are:

/wp-admin/edit.php?post_type=acf
/wp-admin/admin.php?page=wpcf7

Is there a way to hide these menu pages, too?