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

in my effort in making the WP backend as user friendly as possible, I'm looking for a way to limit the amount of child (or submenu items) of the menu(s) under "admin > appearance > menus". They idea is: when a theme doesn't support a second menu level, its should also not be possible in the backend to add (drag) items to this level.

I guess to achieve this, I would have to dive in the jQuery UI library (and more specifically the jQuery sortable library).

Preferably without having to edit WP's core. Does anyone has any idea or experience in this?

Looking forward to your ideas.

share|improve this question

Just use remove_submenu_page( $menu_slug, $submenu_slug );.

  • $menu_slug = Parent page
  • $submenu_slug = Submenu page

Example usage:

// Remove the submenu page for widgets
add_action( 'admin_menu', 'adjust_the_wp_menu', 999 );
function adjust_the_wp_menu() 
    remove_submenu_page( 'themes.php', 'widgets.php' );
share|improve this answer
Kaiser; thanx for your reply but it is NOT AT ALL related to my qustion. As mentioned in my post I'm talking about the customizable theme menu's under: "admin > appearance > menus". I think this is quite clear. – Marsman Apr 24 '12 at 17:26
Ah, this was a missunderstanding. In this case, your only option is to use jQuery (measure .length » disable), etc.). There're no hooks, as mostly of this page is hard coded. – kaiser Apr 24 '12 at 18:09

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.