# Processing Orders Count in the Admin Bar

> Adds a toolbar item showing how many orders are waiting to be processed, linking to the filtered orders list. Visible to shop managers and administrators.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, admin-bar, orders
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-admin-bar-processing-orders/

## Code

```php
add_action( 'admin_bar_menu', function ( $bar ) {
    if ( ! current_user_can( 'edit_shop_orders' ) ) {
        return;
    }

    $count = get_transient( 'wpide_processing_orders_count' );

    if ( false === $count ) {
        $result = wc_get_orders( array( 'status' => 'wc-processing', 'limit' => 1, 'paginate' => true, 'return' => 'ids', 'type' => 'shop_order' ) );
        $count  = (int) $result->total;
        set_transient( 'wpide_processing_orders_count', $count, 5 * MINUTE_IN_SECONDS );
    }

    $hpos = class_exists( '\\Automattic\\WooCommerce\\Utilities\\OrderUtil' ) && \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled();

    $bar->add_node( array(
        'id'    => 'wpide-processing-orders',
        'title' => sprintf( 'Orders to process: %d', (int) $count ),
        'href'  => admin_url( $hpos ? 'admin.php?page=wc-orders&status=wc-processing' : 'edit.php?post_type=shop_order&post_status=wc-processing' ),
    ) );
}, 80 );

add_action( 'woocommerce_order_status_changed', function () {
    delete_transient( 'wpide_processing_orders_count' );
} );
```

## Notes

The count is cached for five minutes to keep the toolbar fast.

## How to use it

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