I am developing one of my first plugins, and have come across a error:

You do not have sufficient permissions to access this page

The plugin has a wizard that uses several forms, obviously I don't want people selecting later forms using the menu.

Is there a way to "silently" register a page? Basically, register the page without having it appear in any menu.

(I don't like my work around)


The mighty Codex holds the answers:

  1. If you're running into the »You do not have sufficient permissions to access this page.« message in a wp_die() screen, then you've hooked too early. The hook you should use is admin_menu.

  2. $parent_slug: Use NULL or set to options.php if you want to create a page that doesn't appear in any menu

  • I am rolling my eyes and laughing at myself. I wouldn't have thought to look on the "add_submenu_page" to figure out how not add a submenu page. Question answered... thanks. – Jefferey Cave Jan 15 '13 at 22:23
  • 1
    You can also register a page as normal and remove it using remove_menu_page(). The page will still be accessible by URL, but will not show up in the menu – shea Jan 15 '13 at 22:54
  • Hmm... I think this may be the question I was really asking [link]wordpress.stackexchange.com/questions/7812/… – Jefferey Cave Jan 16 '13 at 0:05
  • It seems using remove_menu_page() does actually prevent access. Codex seems to suggest it shouldn't also. I'm looking into it because I really need to register 30 pages but only show 5 in the main plugin menu. The rest are offered in tabbed menus. I've just posted a YouTube about my problem and any solution will be added to CSV 2 POST if you want to go looking at code. – Ryan Bayne Jul 1 '14 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.