# Purchased Items Column in the Orders List

> Adds an "Items" column to the admin orders screen listing what each order contains, so you can see what to pack without opening orders.

- Type: PHP
- Runs: Admin only
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, admin, orders, columns
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-orders-items-column/

## Code

```php
$wpide_items_column_add = function ( $columns ) {
    $new = array();

    foreach ( $columns as $key => $label ) {
        $new[ $key ] = $label;

        if ( 'order_number' === $key ) {
            $new['wpide_items'] = 'Items';
        }
    }

    return $new;
};

$wpide_items_column_render = function ( $column, $order ) {
    if ( 'wpide_items' !== $column ) {
        return;
    }

    $order = $order instanceof WC_Order ? $order : wc_get_order( $order );

    if ( ! $order ) {
        return;
    }

    $lines = array();

    foreach ( $order->get_items() as $item ) {
        $lines[] = esc_html( $item->get_quantity() . ' x ' . $item->get_name() );
    }

    echo wp_kses_post( implode( '<br>', $lines ) );
};

add_filter( 'manage_woocommerce_page_wc-orders_columns', $wpide_items_column_add );
add_filter( 'manage_edit-shop_order_columns', $wpide_items_column_add );
add_action( 'manage_woocommerce_page_wc-orders_custom_column', $wpide_items_column_render, 10, 2 );
add_action( 'manage_shop_order_posts_custom_column', $wpide_items_column_render, 10, 2 );
```

## Notes

Works with both the HPOS orders screen and the legacy posts-based screen.

## How to use it

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