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'm trying to understand creating custom plugin pages and menus in admin panel, but I get what I don't need. I've got:

function my_plugin_add_pages() {
   add_menu_page(__('Custom quiz', 'custom-quiz'), __('Custom quiz', 'custom-quiz'), 5, 'custom-quiz-listing-page', 'custom_quiz_list_page');
   add_submenu_page('custom-quiz-listing-page', __('Add quiz'), __('Add quiz'), 6, 'custom_quiz_add_quiz', 'custom_quiz_add_quiz');
   add_submenu_page('custom-quiz-listing-page', __('Edit quiz'), __('Edit quiz'), 6, 'custom_quiz_edit_quiz', 'custom_quiz_edit_quiz');

function custom_quiz_list_page() {

function custom_quiz_add_quiz() {
   if (!empty($_POST)) {
      echo '<meta http-equiv="refresh" content="0;url=?page=custom-quiz-listing-page" />';

function custom_quiz_edit_quiz() {
   if (!empty($_GET['quiz_id']) && !empty($_POST))

And the problem is that all these pages (even subpages) are created in menu sidebar in admin panel. How to create page correctly without sticking it into admin menu?

share|improve this question

I found the answer on Wordpress Forum: http://wordpress.org/support/topic/add-backend-page-without-menu-item#post-2135050

It requires add_submenu_page() with slug = null (first argument). In Wordpress documentation it's marked as 'required' so it looks like it's required but can be null.

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.