Remove “posts” from admin but show a custom post

After checking out:,
I successfully use the following code to hide some stuff from the menu:

add_action( 'admin_menu', 'my_remove_menu_pages' );

function my_remove_menu_pages() {

However both the “posts page” and a custom post types page seems to run on /wp-admin/edit.php.

So I’m looking for a way to hide the posts menubar but still show the menu for a custom post type I’ve added.

Solutions Collecting From Web of "Remove “posts” from admin but show a custom post"

Doing this search, I’ve found this fine answer by Chris_O. There’s even a jQuery solution I proposed there.

Anyway, the function remove_menu_page('edit.php'); only removes the Posts menu.

But, as we learn from Chris answer, remove_menu_page('edit.php?post_type=athletes'); removes the Custom Post Type menu.

To really block access to the URL, as we’re merely hiding the menu item, check the following Q&A: Blocking Administrative Access to Authors and Subcribers?

I just tried and remove_menu_page('edit.php'); only removes the Posts Top Level Menu.

All my other custom post types (and I have a lot) still work fine. I have a feeling this is because it does a direct lookup of the exactly slug, not the basename of the file.