In this one we’ll show you how to add a custom column in the Orders table in WooCommerce Admin dashboard. This way you can easily add and view order meta (or custom field) information you need at glance, without viewing the order itself.

This tutorial has two parts. First off we’ll add the column in the WooCommerce admin order view table. Then we’ll populate the meta info in it.

PHP Snippet: Add custom column to WooCommerce admin orders list

In order to add a new column in the orders table, we’ll use the manage_edit-shop_order_columns filter. In your child theme’s functions.php file add the following code:

function webroom_add_order_new_column_header( $columns ) {

    $new_columns = array();

    foreach ( $columns as $column_name => $column_info ) {

        $new_columns[ $column_name ] = $column_info;

        if ( 'order_total' === $column_name ) {
            $new_columns['order_details'] = __( 'Details', 'my-textdomain' );

    return $new_columns;
add_filter( 'manage_edit-shop_order_columns', 'webroom_add_order_new_column_header', 20);

Now, we’ve created a new column named “Details”. You can choose a name of your own. Remember to change both ‘order_details’ and ‘Details’ in the above code. We’ve placed the column ‘Details’ right after the Total column.

Now It’s empty so lets add some data.

PHP Snippet: add order meta data in WooCommerce admin orders table

For demo purpose we’ll add the billing phone to the custom column. In functions.php add the following snippet:

add_action( 'manage_shop_order_posts_custom_column', 'webroom_add_wc_order_admin_list_column_content' );
function webroom_add_wc_order_admin_list_column_content( $column ) {
    global $post;
    if ( 'order_details' === $column ) {
        $order = wc_get_order( $post->ID );
        echo '<p>Phone: ' . $order->get_billing_phone() . '</p>';

Here you have to change ‘order_details’ according to the first snippet which creates the column. The next thing to change is the echo part where we actually display the desired order data (or any data we want). In the example we are showing the billing phone.

PHP Snippet: show order private notes in WooCommerce admin orders table

Here is how to show order Private notes:

add_action( 'manage_shop_order_posts_custom_column', 'webroom_add_wc_order_admin_list_column_content' );
function webroom_add_wc_order_admin_list_column_content( $column ) {
    global $post;
    if ( 'order_details' === $column ) {
        $order = wc_get_order( $post->ID );
        $args = array(
            'order_id' => $post->ID,

  		$notes = wc_get_order_notes( $args );
        foreach ( $notes as $note ) {
            $css_class   = array( 'note' );
            $css_class[] = $note->customer_note ? 'customer-note' : '';
            $css_class[] = 'system' === $note->added_by ? 'system-note' : '';
            $css_class   = apply_filters( 'woocommerce_order_note_class', array_filter( $css_class ), $note );
            <li rel="<?php echo absint( $note->id ); ?>" class="<?php echo esc_attr( implode( ' ', $css_class ) ); ?>">
                <div class="note_content">
                    <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ); // @codingStandardsIgnoreLine ?>
                <p class="meta">
                    <abbr class="exact-date" title="<?php echo esc_attr( $note->date_created->date( 'Y-m-d H:i:s' ) ); ?>">
                        /* translators: %1$s: note date %2$s: note time */
                        echo esc_html( sprintf( __( '%1$s at %2$s', 'woocommerce' ), $note->date_created->date_i18n( wc_date_format() ), $note->date_created->date_i18n( wc_time_format() ) ) );
                    if ( 'system' !== $note->added_by ) :
                        /* translators: %s: note author */
                        echo esc_html( sprintf( ' ' . __( 'by %s', 'woocommerce' ), $note->added_by ) );
                    <a href="#" class="delete_note" role="button" rel="nofollow ugc"><?php esc_html_e( 'Delete note', 'woocommerce' ); ?></a>

Learn more about the action hooks we used in this tutorial:

Recent Articles


Leave a comment
  1. Ady July 23, 2020 at 8:49 am - Reply

    Please, how can I show my “Private notes”. Is it possible to show with this snippet? Thank you.

    • webroom July 23, 2020 at 2:09 pm - Reply

      Hi, Ady! I’ve added third snippet in the article above which shows the Private notes.

      You can remove the meta paragraph if you don’t need it.

      Take care :)

  2. Alec July 16, 2020 at 1:10 am - Reply

    Great tutorial. I learned a lot.

    I sell digital downloads and want to add a column to show if the customer downloaded the product.
    Currently I have to go to each order to see if the download counter still says 0 or 1….2….3…. etc.

    I tries adding- $order->get_downloadable_items(); but comes back as an “array”.
    Is this even possible with this type of code?

    Thank you

  3. webroom June 21, 2020 at 7:32 am - Reply

    Here’s how to get all the order information when using $order = wc_get_order( $post->ID );

    // Get Order ID and Key

    // Get Order Totals $0.00

    // Get and Loop Over Order Items
    foreach ( $order->get_items() as $item_id => $item ) {
    $product_id = $item->get_product_id();
    $variation_id = $item->get_variation_id();
    $product = $item->get_product();
    $name = $item->get_name();
    $quantity = $item->get_quantity();
    $subtotal = $item->get_subtotal();
    $total = $item->get_total();
    $tax = $item->get_subtotal_tax();
    $taxclass = $item->get_tax_class();
    $taxstat = $item->get_tax_status();
    $allmeta = $item->get_meta_data();
    $somemeta = $item->get_meta( '_whatever', true );
    $type = $item->get_type();

    // Other Secondary Items Stuff

    // Get Order Lines

    // Get Order Shipping

    // Get Order Dates

    // Get Order User, Billing & Shipping Addresses

    // Get Order Payment Details

    // Get Order URLs

    // Get Order Status

  4. marcel June 20, 2020 at 9:13 pm - Reply

    how get order comment ? for display in details for example ? In your example, you get phone :

    $order = wc_get_order( $post->ID );
    echo ‘Phone: ‘ . $order->get_billing_phone() . ”;

    but order notes ?

    • webroom June 21, 2020 at 7:29 am - Reply

      Hi! Try using


      echo ‘Order Notes: ‘ . $order->get_customer_note(); . ”;

      This is for Woocommerce 3+.

  5. Chealsie June 10, 2020 at 5:43 pm - Reply

    Awesome article just had one question. Is there a way I can call $order->get_description(); in my code after adding the column?

    • webroom June 21, 2020 at 7:36 am - Reply

      If you are using WooCommerce 3.0 or above, then you can get description with the below code.

      $order = wc_get_order($order_id);

      foreach ($order->get_items() as $item) {
      $product_id = $item['product_id'];
      $product_details = $product->get_data();

      $product_full_description = $product_details['description'];
      $product_short_description = $product_details['short_description'];

      Alternate way (recommended)

      $order = wc_get_order($order_id);

      foreach ($order->get_items() as $item) {
      $product_id = $item['product_id'];
      $product_instance = wc_get_product($product_id);

      $product_full_description = $product_instance->get_description();
      $product_short_description = $product_instance->get_short_description();

  6. Thomassen Henneberg April 26, 2020 at 5:18 am - Reply

    Enjoyed reading the content above, actually explains everything in detail,
    the guide is very interesting and effective. Thank you and good luck in the articles.

    King regards,
    Thomassen Henneberg

  7. Sven April 18, 2020 at 7:24 pm - Reply


    Thanks for your tutorial.
    Do you know how to make that new column searchable?

    Best regards,

Leave a Reply

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.