Creating a less cluttered interface is a top priority for store owners, as it significantly impacts the user experience for customers. This customization involves hiding either the entire order status column or specific order statuses from the My Account Orders page. The decision on which approach to take depends on the unique requirements of your business.
Solution 1: Hide Order Status Column from My Account > Orders Page
The code snippet will help to remove the status column of the orders table present in the My Account Orders Page.
add_filter('woocommerce_account_orders_columns', 'ts_hide_status_column', 10); function ts_hide_status_column($order){ unset($order['order-status']); return $order; }
Output
The output image shows that the status column is been hidden from the orders table of the My Account >Orders page.
Solution 2: Hide a Specific Order Status from the Status Column of My Account > Orders Page
When you have created custom order statuses (e.g. Ready to Ship, Scheduled) in your store, then you might want to skip these statuses to be shown and focus customers’ attention only on the most important status updates, such as “Processing” or “Completed”.
add_filter( 'woocommerce_my_account_my_orders_query', 'ts_exclude_status',10,1 ); function ts_exclude_status( $args ) { $statuses = wc_get_order_statuses(); unset( $statuses['wc-scheduled'] ); // wc-completed, wc-processing, etc. $args['status'] = array_keys( $statuses ); return $args; }
Output
I have created a custom order status such as ‘Scheduled’ and after implemeting the code, the status ‘Scheduled’ that appears on the status column along with the other available default/custom statuses will be hidden.
Alternatively, you can also set a filter so that customers can filter WooCommerce Order status in My Account Orders section.
Deprecated: Hook woocommerce_my_account_my_orders_columns is deprecated since version 2.6.0! Use woocommerce_account_orders_columns instead.
Hi Pete,
Thanks for mentioning it. The deprecated hook still works fine without issues, if there is no conflict with other plugins or custom code. But still, as it may not be supported in future updates, I will update the code in the post with the new hook as suggested.