Hi Guys,

This post will show you how to remove unused column from WooCommerce Order. With the recent WooCommerce update it add new column called Actions which may consist of options to change status. This will seems too bulky if there is so many status on our store.

Just to get rid all those buttons, I decided to remove the whole action column from the Orders post. This is quick fix, you just need to add this code to your theme functions file.

We are using current_screen hook to remove existing column functions from the WooCommerce.

/*
* Remove wc-actions columns
*/
add_action( 'current_screen', function() {
	global $wc_list_table;
	remove_filter( 'manage_shop_order_posts_columns', array( $wc_list_table, 'define_columns' ), 10 );
}, 20 );
//add your required column
add_filter( 'manage_shop_order_posts_columns', 'themeslug_add_required_column', 10, 2 );
/**
* Define which columns to show on this screen.
*
* @param array $columns Existing columns.
* @return array
*/
public function themeslug_add_required_column( $columns ) {
$show_columns = array();
$show_columns['cb'] = $columns['cb'];
$show_columns['order_number'] = __( 'Order', 'woocommerce' );
$show_columns['order_date'] = __( 'Date', 'woocommerce' );
$show_columns['order_status'] = __( 'Status', 'woocommerce' );
$show_columns['billing_address'] = __( 'Billing', 'woocommerce' );
$show_columns['shipping_address'] = __( 'Ship to', 'woocommerce' );
$show_columns['order_total'] = __( 'Total', 'woocommerce' );

wp_enqueue_script( 'wc-orders' );

return $show_columns;
}

Note: You can use this method to remove any other columns from the order post.

Thanks

Advertisements

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: