Share this page : facebooktwitterlinkedinmailfacebooktwitterlinkedinmail

By only showing the top level pages it not only gave me the result I wanted, but also made the list of parent pages smaller and more manageable.

The Solution

To accomplish the refinement of the ‘Parent’ dropdown options shown when editing the page attributes, I simply added the following code to my themes functions.php file.

// Only show parent pages when editing page  

add_filter( 'page_attributes_dropdown_pages_args''admin_top_level_pages_only' );  

  

// Also perform the same filter when doing a 'Quick Edit'  

add_filter( 'quick_edit_dropdown_pages_args''admin_top_level_pages_only' );  

  

function admin_top_level_pages_only( $args )  

{  

    $args['depth'] = '1';  

    return $args;  

}

Here means only show top level pages, if you want to show 2 level of pages, change

  $args['depth'] = '1';

to

  $args['depth'] = '2';