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 Assigned Page Template in the WordPress Pages List

Shared by Alkesh Miyani · October 26, 2026 · @manage_pages_columns

22 views
1 upvote
Back to Snippets

When managing a WordPress site with multiple custom page templates, checking which template each page uses can be time-consuming.

This snippet adds a Page Template column to the WordPress admin Pages list, displaying the assigned template for each page without opening the editor.

How to use

  1. Add the code to your child theme’s functions.php file or a PHP snippets plugin.
  2. Open WordPress Admin → Pages → All Pages.
  3. Look for the new Page Template column.
  4. Pages using the default template will display “Default Template”; pages using custom templates will display their template filename.

Notes

/**
 * Add a Page Template column to the WordPress Pages list.
 */
add_filter( 'manage_pages_columns', 'alkesh_add_page_template_column' );

function alkesh_add_page_template_column( $columns ) {
	$columns['page_template'] = __( 'Page Template', 'alkesh' );

	return $columns;
}

/**
 * Display the assigned template for each page.
 */
add_action(
	'manage_pages_custom_column',
	'alkesh_display_page_template_column',
	10,
	2
);

function alkesh_display_page_template_column( $column_name, $post_id ) {
	if ( 'page_template' !== $column_name ) {
		return;
	}

	$template_slug = get_page_template_slug( $post_id );

	if ( empty( $template_slug ) ) {
		echo esc_html__( 'Default Template', 'alkesh' );
		return;
	}

	echo esc_html( wp_basename( $template_slug ) );
}

Tested on

WordPress 7.1.3 WordPress Admin, Theme Development

Reported by the author on October 26, 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