WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added some pages to the WP-Adminmenu, with add_menu_page and add_submenu_page. The URLs for those pages look like admin.php?page=my-plugin/admin/submenupage.php. If I try to add a page now that has isnt registered to the menu and link to it with <a href="?page=my-plugin/admin/add.php"> I'm getting a permissions error. Is there a way to add pages to the admin area without registering them to the menu?

share|improve this question
Please always show your whole code. – kaiser Nov 21 '12 at 18:50
@kaiser do you miss anything? I think in this case the whole code would be more annoying since its distributed over some classes etc. – wintersolutions Nov 21 '12 at 20:20
up vote 2 down vote accepted

The best thing you can do here is to call them with a $_GET parameter, and just register the first site to the menu.

so for example, when you registered admin.php?page=my-plugin/admin/submenupage.php, you have the submenupage.php structured like this:

if ( !isset( $_GET['section'] ) ) {
} else if ($_GET['section'] == 'hiddenpage1' ){
} // go on for every page needed.

This way you have your registered menuentry, but by clicking it from the adminmenu you always get to the mainpage.php. Just add the &section=hiddenpage1 or whatever you call your hidden pages, and you will see the "hidden" admin sections.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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