# Hide Admin List Columns by Default

> Hides less useful columns for users who have not customized Screen Options yet. Anyone can still turn them back on.

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

## Code

```php
// Screen ID => columns hidden until the user changes Screen Options.
$wpide_default_hidden_columns = array(
    'edit-post' => array( 'tags', 'comments' ),
    'edit-page' => array( 'comments', 'author' ),
    'users'     => array( 'posts' ),
);

add_filter( 'default_hidden_columns', function ( $hidden, $screen ) use ( $wpide_default_hidden_columns ) {
    if ( $screen && isset( $wpide_default_hidden_columns[ $screen->id ] ) ) {
        $hidden = array_unique( array_merge( (array) $hidden, $wpide_default_hidden_columns[ $screen->id ] ) );
    }

    return $hidden;
}, 10, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Admin List Columns by Default" 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/
