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 custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Add Second Description @ Product Category Pages
    In terms of SEO, if you’re trying to rank your product category pages, you really need to make the most of the default WooCommerce product category “description” and “thumbnail”. Most themes, if compatible with WooCommerce, will show this content right below the product category name and above products. Nothing new so far. But what if […]
  • WooCommerce: Get Order Info (total, items, etc) From $order Object
    As a WooCommerce development freelancer, every day I repeat many coding operations that make me waste time. One of them is: “How to get ____ if I have the $order variable/object?“. For example, “How can I get the order total“? Or “How can I get the order items“? Or maybe the order dates, customer ID, […]
  • WooCommerce: How to Add a Custom Checkout Field
    Let’s imagine you want to add a custom checkout field (and not an additional billing or shipping field) on the WooCommerce Checkout page. For example, it might be a customer licence number – this has got nothing to do with billing and nothing to do with shipping. Ideally, this custom field could show above the […]
  • WooCommerce: Allow Users to Edit Processing Orders
    How can WooCommerce customers edit an order they just placed and paid for? I swear I looked on search engine results and other places before coming to the conclusion I needed to code this myself. For example, a user might want to change the delivery date (if you provide this on the checkout page). Or […]
  • WooCommerce: Create a Custom Order Status
    All WooCommerce orders go to either “processing”, “completed”, “on-hold” and other default order statuses based on the payment method and product type. Sometimes these statuses are not enough. For example, you might need to mark certain orders in a different way for tracking, filtering, exporting purposes. Or you might want to disable default emails by […]

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. Follow @rmelogli

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

  1. Hi , no longer works with New HPOS Meta data structure.

    1. I find this unlikely, wc_get_order works with HPOS as well

      1. It doesn’t work here either with HPOS enabled. Do you know any alternative codes for this?

        1. Not yet, as I haven’t switched to HPOS yet!

  2. Hi, I love your work.
    Can you show hot to add Phone Number Column at the main WooCommerce Customer Page?

    Thanks.

    1. Hello Tiago, 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. still working on wp 6.11 with up to date woocommerce. Thank you

  4. Hi,

    I want to show the product regular price in order admin dashboard and i have tried using get_regular_price() function but it’s showing error?

    1. Hi Rohini, 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!

  5. The code is wonderful congratulations. What if I want to show the product name?

    1. Hello Andre, 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!

  6. 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!

  7. 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!

  8. 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!

  9. 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!

  10. 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 🙂

  11. 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”?

  12. 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!

  13. 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!

  14. 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!

  15. 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()

  16. 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

  17. 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 🙂

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

    1. Cool 🙂

  19. 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 🙂

  20. 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 🙂

  21. 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? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. 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 the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *