Plugin – create a page without it appearing in the side menu

I am currently using add_submenu_page to add pages for my plugin. However, I wish to create a page that don’t appear in the admin menu, is that possible?

Related posts

Leave a Reply

1 comment

  1. Set the parent_slug property to null, example;

       add_submenu_page( 
              null            // -> Set to null - will hide menu link
            , 'Page Title'    // -> Page Title
            , 'Menu Title'    // -> Title that would otherwise appear in the menu
            , 'administrator' // -> Capability level
            , 'menu_handle'   // -> Still accessible via admin.php?page=menu_handle
            , 'page_callback' // -> To render the page
        );
    

    This will hide the sub menu page from your parent (top level) menu link.

    It does not state this in the Codex entry for add_submenu_page though.

    It now states this in the Codex entry for add_submenu_page (thanks goto Ian Dunn).