# Page Template Column for Pages

> Shows which page template each page uses, right in the Pages list.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, columns, templates
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/page-template-column/

## Code

```php
add_filter( 'manage_page_posts_columns', function ( $columns ) {
    $columns['wpide_template'] = 'Template';

    return $columns;
} );

add_action( 'manage_page_posts_custom_column', function ( $column, $post_id ) {
    if ( 'wpide_template' !== $column ) {
        return;
    }

    $slug = get_page_template_slug( $post_id );

    if ( ! $slug ) {
        echo '<span aria-hidden="true">&#8212;</span> Default';
        return;
    }

    $templates = wp_get_theme()->get_page_templates( null, 'page' );

    echo esc_html( isset( $templates[ $slug ] ) ? $templates[ $slug ] : $slug );
}, 10, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Page Template Column for Pages" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
