# Alt Text Column in the Media Library

> Adds an Alt text column to the Media Library list view and flags images that have none, making accessibility clean-ups much quicker.

- Type: PHP
- Runs: Admin only
- Category: [Media](https://wpide.com/library/category/media/)
- Tags: alt-text, accessibility, media-library
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/alt-text-column-in-media/

## Code

```php
add_filter( 'manage_upload_columns', function ( $columns ) {
    $columns['wpide_alt'] = 'Alt text';

    return $columns;
} );

add_action( 'manage_media_custom_column', function ( $column, $attachment_id ) {
    if ( 'wpide_alt' !== $column || ! wp_attachment_is_image( $attachment_id ) ) {
        return;
    }

    $alt = trim( (string) get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) );

    echo '' === $alt ? '<span style="color:#d63638;font-weight:600;">Missing</span>' : esc_html( $alt );
}, 10, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Alt Text Column in the Media Library" 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/
