I'm writing a couple of plugins. One plugin would be the core plugin with certain bits of functionality.

The other plugin would extend that functionality.

What I've done is in the CORE plugin, I've created a menu using "add_menu_page" and I also one submenu page in that menu.

Now, as users add more extension plugins I want to add new settings menu items under the CORE plugin menu.

I tried using add_submenu_page in the extender plugin and this adds the submenu. Problem is it gets rid of the main menu sublink in the menu. The link is added to the menu, but when i click it it does not load the right page. I get a 404.

I'm curious what command should I use to add a new submenu page to an already existing admin menu?

1 Answer 1


Always happens. I ask and immediately find the answer.

The answer is in the 2nd plugin add a "priority" of 11 to the add_action command. This plugs that submenu right in there.

Like this: add_action('admin_menu', 'admin_submenu', 11);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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