How to remove specific order meta-boxes from order edit pages.
The following works on legacy orders, but not with High-Performance Order Storage (HPOS):
remove_meta_box( 'woocommerce-order-items', 'shop-order', 'normal' ); // Removes products/items meta box for technicians
remove_meta_box( 'woocommerce-order-actions', 'shop-order', 'normal' ); // Removes products/items meta box for technicians
remove_meta_box( 'woocommerce-order-notes', 'shop-order', 'normal' ); // Removes order note meta box for technicians
remove_meta_box( 'order_custom', 'shop-order', 'normal' );
Any help is appreciated.
2
Answers
Below code seems to hide only, but does not actually remove it.
Any other suggestions?
For High-Performance Order Storage Metaboxes removal (compatible with legacy orders too), you need to use something a bit different as "shop-order" 2nd argument only works for legacy orders.
Also by default in WooCommerce, Order actions and Order notes Metaboxes 3rd argument is "side" (but not "normal").
Try the following:
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.
If you have changed manually some metaboxes location via drag and drop, you will need to adjust the 3rd argument to "normal" or "side".