This is the current situation:

  • I am writing a plugin that has a top-level menu page
  • The plugin also contains other sub-menu pages
  • The sub-menu pages are not assigned a parent slug (thus they do not appear in the admin menu)

My requirement is to do the following:

  • Have only the top-level menu page menu item in the admin menu (no sub-menu page menu items should appear)
  • Highlight the top-level menu page menu item when on a sub-menu page

I've tried giving a parent slug to the sub-menu pages. This, of course, makes it appear as expected under the top-level menu item. I then tried to remove the sub-menu item, by using remove_submenu_page. However, since that removes the entire sub-menu page, it doesn't solve the problem.

I believe the logical thing to do, is to give a parent slug, since the top-level menu item will need to know that the page being accessed falls under it. The problem then, is not showing the sub-menu page's menu item. I am unable to find a function that deals directly with the menu items.

Is this the right approach or is there a better alternative? Is there a action/filter/hook I can utilise to carry out what I need to do?

Edit #1:
Did some further research/testing. Setting the menu_title parameter to null or '' in the add_submenu_page call makes the title not appear. However, the <li> that contains the sub-menu item still does exist and can be interacted with. When there are numerous sub-menu pages (as in my case), the empty <li> elements will add-up and create a long blank area on the menu. This is far from ideal and as such, I'm still searching for a solution.

Edit #2: Tried manipulating the $submenu global after the comment from @s_ha_dum. However, any removal of the menu section pertaining to a page also results in removing the page similar to remove_submenu_page and thus rendering that page inaccessible.

  • See: wordpress.stackexchange.com/a/105370/21376
    – s_ha_dum
    Commented Aug 30, 2013 at 13:10
  • Unfortunately, that method seems to work similar to remove_submenu_page and makes accessing the page throw a "You do not have sufficient permissions to access this page." message. I'll check up further on it though. Thanks for the suggestion. Commented Sep 2, 2013 at 3:39
  • 2
    Would a tabbed interface within your main page achieve the same goal? getbutterfly.com/…
    – epilektric
    Commented Sep 3, 2013 at 23:07
  • That's an interesting approach. I'm not entirely sure I want to have all the different pages (there are about 8 or so in total) loading in tabs though. I suppose I could do some AJAX loading where the individual page content is loaded as and when it is needed. I'm still interested in finding a solution for the original problem. However, I think it may not be possible for the current WP version without modifying the core files (which I do not wish to do). I'll check out the tabbed approach. Thanks for the suggestion. Commented Sep 4, 2013 at 6:31
  • There's an easy way to resolve it here: wordpress.org/support/topic/no-page-menu-item
    – Tsage
    Commented Dec 20, 2019 at 9:53

1 Answer 1


That's a bit of a late answer and I don't know if @Jay ever sorted it out, but to anyone having the same issue, here's how I fixed it.

Menu Pages

function my_admin_menu() {

        'Page title',
        'Menu title',

        'Subpage 1 title',
        'Subpage 1 menu title',

        'Subpage 2 title',
        'Subpage 2 menu title',
add_action( 'admin_menu', 'my_admin_menu' ) );

function my_admin_head() {

    remove_submenu_page( 'my_page', 'my_subpage_1' );
add_action( 'admin_head', 'my_admin_head' );

See the Codex for remove_submenu_page.

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.