# Show the ID Column in Admin Lists

> Adds an ID column to the posts, pages and custom post type list tables so you can find IDs without hovering over links.

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

## Code

```php
add_action( 'admin_init', function () {
    foreach ( get_post_types( array( 'show_ui' => true ) ) as $post_type ) {
        add_filter( "manage_{$post_type}_posts_columns", function ( $columns ) {
            $columns['wpide_id'] = 'ID';

            return $columns;
        } );

        add_action( "manage_{$post_type}_posts_custom_column", function ( $column, $post_id ) {
            if ( 'wpide_id' === $column ) {
                echo (int) $post_id;
            }
        }, 10, 2 );
    }
} );

add_action( 'admin_head', function () {
    echo '<style>.fixed .column-wpide_id{width:64px;}</style>';
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Show the ID Column in Admin Lists" 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/
