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
- Add the code to your child theme’s
functions.phpfile or a PHP snippets plugin. - Open WordPress Admin → Pages → All Pages.
- Look for the new Page Template column.
- Pages using the default template will display “Default Template”; pages using custom templates will display their template filename.
Notes
- Works with standard WordPress Pages and their assigned page templates.
- Uses WordPress’s
get_page_template_slug()function to retrieve the assigned template. - Displays the filename rather than the full path for easier scanning.
- Does not change any page’s assigned template.
/**
* 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.
