The previous answers propose editing core WordPress files, which is never a good idea, as new versions of WordPress will overwrite the changes (among other things).
While the original Trac ticket #18282 has been open since July 2011, the issue still exists in WordPress 4.6 — going on 5+ years now.
Fortunately there is a “safe” way of implementing a workaround to change the behavior without hacking WordPress core.
Sergey Biryukov, a core committer, wrote a small feature plugin that changes the Pages metabox behavior and preserves the hierarchy for both post types and taxonomies:
Preserve Page and Taxonomy Hierarchy on Edit Menus Screen
The plugin only affects the “View All” tab, not “Most Recent” or “Most Used”, but is a much more maintainable and responsible solution than patching core or hacking the files directly.
Related Posts:
- how to create pages and link them to a menu
- Add separator to admin submenu
- how to only add a top-level admin menu without it creating a sub-level-menu
- wp_list_pages: only show subpages on the parent page?
- Does loading of sub pages in menu cause load to the server?
- Schedule Page to Menu [duplicate]
- Programmatically add existing pages and subpages to Appearance Menu
- How to retrieve parent menu item name of current submenu item
- How to highlight 1st level menu item based on actual page
- Add (grand)child pages automatically to nav menu
- Get parents child pages
- Add CSS Class to WordPress Menu Item Dependent on the Page the User is Visiting
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- Display a portion/ branch of the menu tree using wp_nav_menu()
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- how to create a menu with all sub categories?
- Display only page specific sub menu items using Custom Walker
- Add child pages automatically to nav menu
- Add a .last class to the last in each ul.sub-menu
- Multi Level Bootstrap Navigation Menu in WordPress
- Directing a page to a default subpage
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- Can you have different menus and theme on a per-page basis?
- Get parent page/menu id of current post
- Automatically Add New Tags to Sub-menu
- Change menu items URL
- How can I get an array/list of all current WordPress Admin Menu items?
- how to automatically generate hierarchical menus from hierarchy of pages?
- Handling complex multi-level architecture / menu for large site
- Remove Page Name From WordPress Menu
- Hiding Menu From Specific Pages
- Theme menu in Admin Panel
- Menus like a CMS
- Hiding Admin Page While Keeping Menu Expanded
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Check if menu id = $specific_id – then insert specific
- WordPress menu permalink redirects to wrong page
- wp_nav_menu() with multiple Class
- How do you manage large menu hierarchies in WP?
- wp_list_pages() but only show children on the branch you are on
- Change name & menu_name for Profile in the default menu, w/o altering core files?
- Trying to Create Menu in WordPress
- Hierarchical menu nesting problem with jQuery targetting
- Automatically list top level menu item child pages
- Check if menu_item has children or has parent
- Displaying different page links on different pages
- Switch from hover to click on Twenty Twelve Menu
- get_the_title() gets printed out twice
- Admin: sub menu doesnt display under apperance when activate my themes
- a better menu, menu options assistance for WP
- How can I switch pages?
- remove class “sub-menu” from wordpress drop down menu
- Add a submenu to wp_nav_menu
- Insert a div class inside wordpress menu
- How to create a menu item which is not a page
- How can I make a menu link visible only to admins (without plugins)?
- Automatically Display Sub Menu
- How to Structure Pages and Subpages
- sub menu link is not working
- enqueue script during add menu items means before save menu items
- Disable parent in wp_list_pages – WordPress
- How to get submenu of admin menu?
- How to Add support for sub-menu item description in wordpress?
- wp_nav_menu without menu or theme_location specified
- Add menu headings to WordPress sub menus
- I can’t add more pages to menu – menu delete pages
- Making pages in a menu appear conditionally
- add_menu_page does not render the expected result
- How to show pages in menu without link
- Dropdown primary navigation menu not working
- Add a menu metabox to post edit page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- Link after WordPress
- cannot get global $menu value in form request
- Show Sub Menu on click and not hover
- Add prefix to url, but products not showing in page SHOP
- Bootstrap Theme Migrated to WordPress
- Creating navigation out of specific IDs and their children?
- WP pages content is missing in frontend
- Generate Submenu based on Parent Page using If Statement
- Product categories are mixed when creating menu
- Dashicons not showed for admin menu
- How to separate sub-menu output and keep associated with parent
- Any simple way to show 10 previous pages by id to current page in links as a menu
- How to add class and span to
- Show Child of Parent Page including all other parents
- Appearance > Menus
- Is It Possible To A Link To The Homepage From The Admin Sidebar?
- How to create a menu super voice in WP?
- Display all submenus
- Change sub-menu css class
- Adding Sub Menu In a theme which Do not have Menu Options
- Adding Pages to Menus – No Page Hierarchy in Backend [duplicate]
- How can I make this process automatic?
- How can I alter the visible menu according to which level I am on [closed]
- How to display a submenu as a popup when clicking a button?
- how can i get the page_ID in nav li [closed]
- How does WP knows which template to use for a page
- Problems with draft website pages
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?