The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · PHP

Display Parent Page in the WordPress Pages List

Shared by Alkesh Miyani · October 27, 2026 · @manage_pages_columns, manage_pages_custom_column

19 views
Back to Snippets

Managing a website with many nested pages can be challenging when you need to identify each page’s parent.

This snippet adds a Parent Page column to the WordPress admin Pages list. It displays the parent page’s title and provides a convenient link to edit it.

How to use

  1. Add the code to your child theme’s functions.php file or a PHP snippets plugin.
  2. Navigate to WordPress Admin → Pages → All Pages.
  3. Find the new Parent Page column.
  4. Click a parent page’s title to open its editor.

Expected result

Page Parent Page
About Us — No Parent —
Our Team About Us
Leadership Our Team
Contact — No Parent —

Example data only.

Notes

/**
 * Add a Parent Page column to the Pages list.
 */
add_filter( 'manage_pages_columns', 'alkesh_add_parent_page_column' );

function alkesh_add_parent_page_column( $columns ) {
	$columns['parent_page'] = __( 'Parent Page', 'alkesh' );

	return $columns;
}

/**
 * Display the parent page title.
 */
add_action(
	'manage_pages_custom_column',
	'alkesh_display_parent_page_column',
	10,
	2
);

function alkesh_display_parent_page_column( $column_name, $post_id ) {
	if ( 'parent_page' !== $column_name ) {
		return;
	}

	$parent_id = wp_get_post_parent_id( $post_id );

	if ( ! $parent_id ) {
		echo esc_html__( '— No Parent —', 'alkesh' );
		return;
	}

	$parent_title = get_the_title( $parent_id );
	$edit_link    = get_edit_post_link( $parent_id );

	if ( ! $parent_title ) {
		echo esc_html__( 'Parent Unavailable', 'alkesh' );
		return;
	}

	if ( $edit_link ) {
		printf(
			'<a href="%1$s">%2$s</a>',
			esc_url( $edit_link ),
			esc_html( $parent_title )
		);
		return;
	}

	echo esc_html( $parent_title );
}

Tested on

WordPress 7.1.3 WordPress Admin

Reported by the author on October 27, 2026. WPFolks has not verified this.

Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments

Proudly supported by