# Last Edited By Column

> Shows who last edited each post or page, and when, in the admin lists. Useful when several people work on the same content.

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

## Code

```php
// Post types that get the column.
$wpide_last_editor_types = array( 'post', 'page' );

foreach ( $wpide_last_editor_types as $wpide_editor_type ) {
    add_filter( "manage_{$wpide_editor_type}_posts_columns", function ( $columns ) {
        $columns['wpide_last_editor'] = 'Last edited by';

        return $columns;
    } );

    add_action( "manage_{$wpide_editor_type}_posts_custom_column", function ( $column, $post_id ) {
        if ( 'wpide_last_editor' !== $column ) {
            return;
        }

        $editor_id = (int) get_post_meta( $post_id, '_edit_last', true );
        $editor    = $editor_id ? get_userdata( $editor_id ) : false;

        echo $editor ? esc_html( $editor->display_name ) : '&#8212;';
        echo '<br><small>' . esc_html( get_post_modified_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), false, $post_id, true ) ) . '</small>';
    }, 10, 2 );
}
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Last Edited By Column" 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/
