# ID Column on Category and Tag Screens

> Adds a sortable ID column to categories, tags and every other taxonomy screen, handy for shortcodes and filters that need term IDs.

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

## Code

```php
add_action( 'admin_init', function () {
    foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $taxonomy ) {
        add_filter( "manage_edit-{$taxonomy}_columns", function ( $columns ) {
            $columns['wpide_term_id'] = 'ID';

            return $columns;
        } );

        add_filter( "manage_{$taxonomy}_custom_column", function ( $content, $column, $term_id ) {
            return 'wpide_term_id' === $column ? (string) (int) $term_id : $content;
        }, 10, 3 );

        add_filter( "manage_edit-{$taxonomy}_sortable_columns", function ( $columns ) {
            $columns['wpide_term_id'] = 'term_id';

            return $columns;
        } );
    }
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "ID Column on Category and Tag Screens" 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/
