Search code examples
phpwordpresswoocommerceorders

Remove shipping row from Woocommerce admin edit order pages


How can I hide/remove shipping row from admin order page? Please help, Thanks in advance.

click to view the screenshot


Solution

  • To hide shipping lines and details a from admin order single pages you will use the following:

    add_filter( 'woocommerce_order_get_items', 'custom_order_get_items', 10, 3 );
    function custom_order_get_items( $items, $order, $types ) {
        if ( is_admin() && $types == array('shipping') ) {
            $items = array();
        }
        return $items;
    }
    

    Code goes in function.php file of your active child theme (or active theme). Tested and works.