Home / WooCommerce / How to add custom column and display order meta in WooCommerce admin
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:
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:
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