Looking to hide the “Shipping to…” text string that is displayed below the shipping rates in the WooCommerce Cart totals section. This code will let you do it easily.
add_filter( 'gettext', 'ts_translate_shippingto', 9999, 3 ); function ts_translate_shippingto( $translated, $untranslated, $domain ) { if ( ! is_admin() && 'woocommerce' === $domain ) { switch ( $translated ) { case 'Shipping to %s.': $translated = ''; break; } } return $translated; }
Output
The output shows that the shipping information message “Shipping to %s.” is effectively hidden from the user during the checkout process.
Before applying the code, the default WooCommerce shipping information would display the “Shipping to address” as follows.
A lot more customization can be done inside cart totals such as renaming the text, styling the text or hiding certain parameters present here. Alternatively, you can also customize the shipping to text on the WooCommerce cart which will allow you to translate the text to easily understandable.