WooCommerce: Add Column to Orders Table @ WP Dashboard

The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one.

So the question is: how can we display additional columns to that same orders table, so that we can immediately visualize an order custom field, a specific product contained in the order, or anything order-related that can be “calculated” once we have access to the $order variable?

Display an additional columns in the Orders Table @ WooCommerce Dashboard

PHP Snippet: Display Custom Column @ WooCommerce Admin Orders Table

/**
 * @snippet       Add Column to Orders Table (e.g. Billing Country) - WooCommerce
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=78723
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.4.5
 */

add_filter( 'manage_edit-shop_order_columns', 'bbloomer_add_new_order_admin_list_column' );

function bbloomer_add_new_order_admin_list_column( $columns ) {
    $columns['billing_country'] = 'Country';
    return $columns;
}

add_action( 'manage_shop_order_posts_custom_column', 'bbloomer_add_new_order_admin_list_column_content' );

function bbloomer_add_new_order_admin_list_column_content( $column ) {
  
    global $post;

    if ( 'billing_country' === $column ) {

        $order = wc_get_order( $post->ID );
        echo $order->get_billing_country();
	  
    }
}

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (delete "?>" if you have it there). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7.3.

If you think this code saved you time & money, feel free to join 14,000+ WooCommerce Weekly subscribers for blog post updates or 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

34 thoughts on “WooCommerce: Add Column to Orders Table @ WP Dashboard

  1. Hi, Thanks for the amazing article. I need to add more than one column here, how can I dot that?

    1. Hi Asad, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  2. Hi, this code is very helpful. Could you just tell me how to change the billing country to the product name so that we have in 1 screen the order number and the product name? this would help us in linking the payment to the correct product. thank you !

    1. Hello Cedric, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  3. Hi Rodolfo! great!
    I need to add a column called “User profile” to show the client profile, is this possible?

    thanks!

    1. Hi Gonzalo, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  4. I have tested the code on my site but it doesn’t work

    1. Works for me Nando, sorry. Try with no plugins but Woo and 2020 theme

      1. Sorry, the code works perfectly, I had an active plugin that blocked this function.
        But I have a question, how can I show a user meta field in that column? I’ve created the following custom field in the user backend as follows, and I need to display it in that column:

        add_filter( 'woocommerce_customer_meta_fields', 'admin_address_field' );
         
        function admin_address_field( $admin_fields ) {
         
        	$admin_fields['billing']['fields']['clientes_conflictivos'] = array(
        		'label' => '¿Cliente conflictivo?',
        	);
         
        	return $admin_fields;
         
        }
        
        1. Good to know!

          Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  5. HI I want add Products Category in order table. Can you please another blog about this?

    1. I’ll add it to the long list 🙂

  6. Hi Rodolfo,

    Thanks for the article it was very helpful for me. Is it possible to edit this column on the Woocommerce dashboard? Or do I need to make a separate form and function to update the new column?

    1. Not sure I fully understand. What do you mean by “edit”?

  7. It is possible to alter the default displayed order column? ( the first column)
    Instead display only order no. & customer name, I would like to add some extra string placed after each customer name!

    Please give me instruction.
    Thank you

    1. Hey Narong, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  8. Hello
    thanks for all of your tips
    can add item name or SKU in column ?

    1. Hi Majid, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  9. Hi Rodolfo,

    Thanks for the tutorial. I have almost the same question as Carole asked in 2018. Is that possible to show all the photos for ordered items include variations (if exist) and how to make it happen? I tried different ways and just can’t make it work.

    Thanks a lot!

    1. Hello Leon, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  10. Hi
    is it possible to change the column title?

    1. Hey Somy, yes, it is inside the function bbloomer_add_new_order_admin_list_column()

  11. Hi,

    I have some custom checkout fields I would like to show as columns, how do I need to change your code to work for my use case?

    I tired it as it is but only seems to work for standard checkout fields like country, state, first name, etc.

    Btw, thank you for the snippet 🙂

    1. Hello there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  12. Hi Rodolfo,
    Perfect, I added my code for get_total_tax(). It’s helpful for to do my accounting (with Dougs), not oblige to open each order for check if I must indicate if it’s taxed or not. But right now I’ve no idea how to add the Stripe fee in a column. I’m going to see that later. Unless you have an idea 🙂
    Thanks a lot again for your tips.
    Rémi from France.

    1. Excellent! I’m sure you’ll figure out the Stripe thing as well 🙂

  13. Hi Rodolfo,
    This is again a great article, One of my friends is using this method. It really helps them.

    1. Cool 🙂

  14. Hi Rodolfo,

    Thanks for yet another great Woo snippet! Can this be used to display which coupon code was used for each order, if any?

    Thanks!
    -Steve

    1. Hey Steve – thanks so much for your comment! Positive, the get_used_coupons() function should help 🙂

  15. Could I add a column for the product photo?

    1. Hello Carole – thanks so much for your comment! Of course – as long as orders have max 1 product or if you just want to show the first product 🙂

  16. Greetings Rodolfo !
    Thanks for your tips !
    I’m going to try it this week. That will be helpful for me, I wish to see Tax, Stripe fee,.. for to do my accounting without open each order. I will se if I can with your tips.
    (However, maybe I can do that by export all order in a xls table)
    Thanks
    Rémi

    1. Rémi – thanks so much for your comment! Good luck 🙂

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

Your email address will not be published.