# Label Special Pages in the Pages List

> Adds labels such as "Contact form" or "Landing page" next to chosen pages in the Pages list, the same way WordPress marks the front page, so editors know which pages matter.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: pages, post-states, admin-lists
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/admin-label-special-pages/

## Code

```php
// Page ID => label.
$wpide_page_labels = array(
    2 => 'Contact form',
    // 45 => 'Landing page',
);

add_filter( 'display_post_states', function ( $states, $post ) use ( $wpide_page_labels ) {
    if ( isset( $wpide_page_labels[ $post->ID ] ) ) {
        $states[ 'wpide_' . $post->ID ] = esc_html( $wpide_page_labels[ $post->ID ] );
    }
    return $states;
}, 10, 2 );
```

## Notes

Map page IDs to labels in $wpide_page_labels; find an ID by hovering the page's Edit link.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Label Special Pages in the Pages List" 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/
