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've created a menu page in the dashboard, then I created a custom post type and now I want to put the menu of the custom post type as a submenu under the first menu page I had created. I tried

'show_in_menu' => 'admin.php?page=mytestpage',

However that did not work. Any tips?

share|improve this question
DO you want to add the Custom Post under an Admin menu item? like: Post -> Custom post ? – Pontus Abrahamsson Jul 12 '12 at 10:51
Yes but not under Post, under one of my custom created menu items. – drtanz Jul 12 '12 at 12:00
way not the other way around? create the custom post type and add your custom page as sub page to that. – Bainternet Jul 12 '12 at 13:11
That's what I ended up doing, operation successful thanks – drtanz Jul 12 '12 at 23:46

You only need to add the page slug to "show_in_menu", making the answer to your example:

'show_in_menu' => 'mytestpage',

For a more complete example:

Admin/Settings page of: /wp-admin/admin.php?page=mytestpage

register_post_type('mycpt', array('label' => 'My Custom Post Type', 'capability_type' => 'post', 'show_ui' => true, 'show_in_menu' => 'mytestpage'));
share|improve this answer
up vote 1 down vote accepted

Ended up creating the custom post type and adding my custom page as sub page to that, as suggested by Bainternet

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.