# Scheduled Posts Count in the Admin Menu

> Shows a small counter next to Posts in the admin menu with the number of scheduled posts waiting to go live, so the publishing queue is visible from every screen.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin-menu, scheduling, counters
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/admin-scheduled-count-bubble/

## Code

```php
add_action( 'admin_menu', function () {
    global $menu;

    $scheduled = (int) wp_count_posts( 'post' )->future;
    if ( ! $scheduled ) {
        return;
    }

    foreach ( (array) $menu as $i => $item ) {
        if ( isset( $item[2] ) && 'edit.php' === $item[2] ) {
            $menu[ $i ][0] .= sprintf(
                ' <span class="awaiting-mod" style="background:#2271b1" title="Scheduled posts"><span class="pending-count">%d</span><span class="screen-reader-text"> scheduled</span></span>',
                $scheduled
            );
            break;
        }
    }
}, 99 );
```

## Notes

Uses WordPress's cached post counts, so it adds no extra queries on most screens.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Scheduled Posts Count in the Admin Menu" 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/
