Ask SkyVerge

Time to start with our first Ask SkyVerge question of 2018 🙂 This question is from Houdayer:

Is there a way to add shipping information in the table at MyAccount > Orders?

Sure thing! We’re looking at the “Orders” menu in the my account page currently, which shows order number, date, status, total, and actions by default:

WooCommerce My Account > Orders default view

The woocommerce_my_account_my_orders_columns filter lets us add or adjust the columns included in this list, so we can add a new one for a shipping destination!

So our first step is to filter these columns, and add our new column in where we’d like. I’m going to loop through all existing columns and add them all to a new array so that I can put my new column where I’d like — after the status column:

 * Adds a new column to the "My Orders" table in the account.
 * @param string[] $columns the columns in the orders table
 * @return string[] updated columns
function sv_wc_add_my_account_orders_column( $columns ) {

    $new_columns = array();

    foreach ( $columns as $key => $name ) {

        $new_columns[ $key ] = $name;

        // add ship-to after order status column
        if ( 'order-status' === $key ) {
            $new_columns['order-ship-to'] = __( 'Ship to', 'textdomain' );

    return $new_columns;
add_filter( 'woocommerce_my_account_my_orders_columns', 'sv_wc_add_my_account_orders_column' );

Now, you’ll see the column added to this page:

WooCommerce My Account > Orders column added

Not done, yet! We need some data for this column that will appear in every row. The woocommerce_my_account_my_orders_column_{$column_id} action fires to let you populate the column you just added with content, and gives us access to the order for that row, so we’ll use this hook next.

The column ID will be the array key you’ve added in the previous snippet (ship-to in my case).

I’ll take the order that’s given to me, and get the shipping details to display in my column. Fortunately, WooCommerce 3.0+ has a handy method to output the formatted shipping display to make this simple:

 * Adds data to the custom "ship to" column in "My Account > Orders".
 * @param \WC_Order $order the order object for the row
function sv_wc_my_orders_ship_to_column( $order ) {

    $formatted_shipping = $order->get_formatted_shipping_address();
    echo ! empty( $formatted_shipping ) ? $formatted_shipping : '–';
add_action( 'woocommerce_my_account_my_orders_column_order-ship-to', 'sv_wc_my_orders_ship_to_column' );

This will now ensure that, if the order has a shipping address, I’ve included it in this column (while orders without a shipping address, like those with virtual items, show nothing):

WooCommerce My Account > Orders column populated

That’s all you need 🙂 You can view the full snippet here or check it out below:

Published by Beka Rice

Beka leads product direction for SkyVerge and technical documentation. She spends a lot of time on research and interviews, but likes to write so she has an excuse to spend more time jamming out to anything from The Clash to Lady Gaga.


  1. Thank you so much for sharing this. I spent hours trying to figure this out. Exactly what I was looking for!

  2. You are a life saver Beka. Exactly what I was looking for.

  3. How to showing/display custom field on My Order like shipping to above ?

  4. this plugin do what you want : Woo admin columns

  5. Hello,
    Thank you for your post.
    How to add another column and populate it from “Admin Custom Order Fields”.
    One of the custom fields filled from within admin panel mus be shown in My Orders list of the Customer Panel for each order.
    Is it possible?

  6. Hello, thank you for this post. That’s exactly what I was looking for. Please, is it possible to add another column and populate it with order items? Thanks

  7. Hi!

    You dont have this function like an plugin? Will bee happy to pay for it!

  8. Hi!

    Is there a equally simple way to add a column to the subscription table as well? Preferably with information from a custom checkout field populated at checkout?

  9. Hi Beka,
    Thanks a lot for this magical snippet !

    I need something a little different, add a column which displays all items ordered.
    Could you help ?

    Sebastien Albert

  10. do you have lists of hooks. or do you know the specific hooks for admin notes and refund amount

  11. Very nice guide! Works!

  12. i have used wp hotel booking plugin..In that plugin discount option is not that i have manually added two fields like discount and grand total..changes in template (wp-cart page)now its showing but in payment gateway page it was showing the total only not my grand wt to do ? for getting grand total in payment gateway and also orederd bookings? can anyone help me? Is there any option to change in ajax?

  13. hey i want to get all order no based on user id this is my code
    SELECT user_id FROM wp_usermeta WHERE meta_value=’ONLINE'” where i get user_id
    id but after that
    customer_orders = get_posts( array(
    ‘numberposts’ => -1,
    ‘meta_key’ => ‘_customer_user’,
    ‘meta_value’ => $ user_id,
    ‘post_type’ => wc_get_order_types(),
    ‘post_status’ => array_keys( wc_get_order_statuses() ), //’post_status’ => array(‘wc-completed’, ‘wc-processing’),
    ) );
    but this give me blank array
    or you know there is any wp_query to get all order no based on post type=shop_order pls replay

  14. Thanks for sharing this helpful post. Is there a way to show new custom column before order number?

    • Sure — instead of inserting it into the middle of the $new_columns array, you could start this array off with your new column name, then loop through the existing ones to add them after it.

  15. Hey,

    this is a very nice code snippet. But i need to add the product name instead if shipping adress. I got no plan about php. Can you please provide this?


  16. […] Add additional columns to the Orders menu on the My Account page for details such as shipping addresses or the date items were shipped. […]

  17. Is there any way to make these columns sortable?

  18. If you want to display the quantity of goods and goods

  19. If I want to show the number of products and products ordered by customers, what should I do?

  20. Is there any way to add a pending amount column pls help me.

  21. How can i make it to be the first coulmn ? 🙂

Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.