Skip to content

Instantly share code, notes, and snippets.

@wpmark
Created November 19, 2014 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmark/bb172f9b6aad56bfa10e to your computer and use it in GitHub Desktop.
Save wpmark/bb172f9b6aad56bfa10e to your computer and use it in GitHub Desktop.
WordPress Remove Top Level Admin Menu
<?php
function wpmark_remove_posts_menu_item() {
/* remove the sub menu item */
remove_menu_page(
'edit.php', // parent slug
);
}
add_action( 'admin_menu', 'wpmark_remove_posts_menu_item' );
@voneff
Copy link

voneff commented Apr 24, 2018

This throws a PHP error.
It should be like this:

remove_menu_page( 'edit.php' ); // parent slug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment