WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)

WooCommerce functions add the shipping method label on the Cart totals, on the left hand side of the price. This ruins the price amounts alignment (subtotal, shipping, taxes, total) and many clients have asked me to remove it completely. Here’s how you do it!

WooCommerce: remove the shipping labels on the cart page
WooCommerce: remove the shipping labels on the cart page

PHP Snippet: Remove ALL shipping method labels @ WooCommerce Cart & Checkout

For example these:

  • 5 Day Delivery: €25.00
  • Local pickup
  • Free shipping

…will show as:

  • €25.00
  • Local pickup
  • Free shipping

/**
 * @snippet       Removes shipping method labels @ WooCommerce Cart / Checkout
 * @how-to        Watch tutorial @ https://businessbloomer.com/?p=19055
 * @sourcecode    https://businessbloomer.com/?p=484
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 3.5.6
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_filter( 'woocommerce_cart_shipping_method_full_label', 'bbloomer_remove_shipping_label', 10, 2 );
 
function bbloomer_remove_shipping_label( $label, $method ) {
$new_label = preg_replace( '/^.+:/', '', $label );
return $new_label;
}

Where to add this code?

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such delicate files - if you need more guidance, please take a look at my free WooCommerce Customization video tutorial.

Does this snippet still work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7.

If you think this code saved you time & money, please join other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce?

Check out these free videos, tutorials and tips!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP
  • woocommerce-customize-shop-page-PHP
  • woocommerce-advanced-customization
  • how-to-edit-woocommerce-cart
  • woocommerce-customize-checkout-page-PHP
  • woocommerce-email-customization
  • woocommerce-conditional-logic

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

49 thoughts on “WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)

  1. Thank you so much! πŸ™‚

    1. You’re welcome!

  2. Hi!

    Thank you for the code. I’m using WooCommerce 3.5.5.

    If I use this code line, it works, but:
    – if the shipping is cost free, the cost free label is also hidden and there is nothing in this line
    – if the shipping costs ex. 5 USD, the shipping method label is hidden and the cost is showing up

    1. Hey Frank, just retested and my “Free Shipping” and “Local Pickup” rates show correctly even if they are free. Try disabling all plugins and switch theme to see if something is interfering

  3. Still works. How can I apply it to the woocommerce order emails as well?

    1. Thanks for your comment Sergeh! You’ll need to find the filter that the order email template uses πŸ™‚

  4. Worked for me πŸ™‚

    Thank you very much!

  5. This should go into the plugins folder, in a new folder (remove-shipping-labels) and a new file /remove-shipping-labels.php) unless you only want to apply this to your current theme

    1. Casper, thanks for your comment πŸ™‚ I definitely don’t recommend that though!

  6. Seems to do the job for me too. Thanks a lot, really haven’t found any other solution that is working (->senseless feature from the plugin by the way)!

    1. Great, thanks Anna πŸ™‚

  7. I was so hopeful but sadly this didn’t work for us. Do you have any other ideas?

    1. Hey Lauren, it seems it worked for almost all those who left a comment πŸ™‚ Can you try on a default, latest version of Woo (without plugins and with a default theme)?

  8. This worked for me. Thanks for sharing!

    1. πŸ™‚ Thanks Sarah!

  9. Thanks! Still working on march 2017!

    1. Thank you AndrΓ©s!

  10. Thank you Sir, you saved my evening πŸ™‚

    1. My pleasure Pat! Thanks for your feedback πŸ™‚

  11. Hi rodolfo, thanks for this snippet, it works perfect, how ever im looking not to hide the shipping method, but showing it after shipping price. In other words change the order… Example: Shipping $10 (Flat Rate). Thanks in advance.

    1. Hey Juan, thanks for your comment! Unfortunately this is custom and I cannot provide a free fix in the blog comments πŸ™‚ Thanks for your understanding!

  12. Your function is working fine in cart and checkout page .
    When user complete the checkout process. there is a thank you page and shipping label still visible on that page.
    Also an email of order shipping label is also visible in it. can you please let me know how ca i remove shipping label from thank you page and an email.

    Many thanks in advamce

    1. Sahil, thanks for your comment! Yes this is possible, however it’s custom work and I can’t offer you a complementary fix. I looked through the files to see if there was a filter you can use to disable that “via Flat Rate” label, and I found it:

      
      $shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', '&nbsp;<small class="shipped_via">' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '</small>', $this );
      
      

      You can take advantage if this to disable the label on the thank you and emails πŸ™‚

  13. Thanks for this! This works on the checkout page & I saw you mention that it doesn’t work in customer emails, but I was wondering if it can be changed within the My Accounts tab (after the customer has purchased). Currently, it still shows when I go to My Accounts. Thanks!

  14. Hello,

    How can I show the chosen shipping option in the basket totals?

    1. Hello Soyful, thanks for your message! Can you send me a screenshot / mock-up to explain graphically what you’re trying to achieve? Thank you in advance!

  15. Hello, sir in which file i have to set thise code…for removel shipping and handling option from cart page.

    1. Hello Ganesh! You can place this in your child theme’s functions.php file – if you need more guidance, please take a look at this video tutorial: “How to Customize WooCommerce with PHP Snippets (even if you don’t know PHP)“. Hope this helps!

  16. Hello, thank you for your code. It’s work for me. However the code only applied for shipping cost with fee only, it does not work for Free Shipping method. My cart page and checkout page still display “Free Shipping (Free)” and Free via “Free Shipping”. Can I hide Free shipping label also. Thank you for your sharing.

    1. Hello Loi, thanks so much for your comment! I’m afraid I don’t see the “Free Shipping (Free)” label. What version of WooCommerce are you using?

      I tried my snippet on StoreFront and WooCommerce 2.5.5 and it works: http://screencast.com/t/WncaH01jOY (removing “Free Shipping” would give you an empty label… not great!)

      Let me know πŸ™‚

  17. Thanks you!

    1. You’re welcome Yati!

  18. Hello! Is it possible to only hide the labels on checkout page but still display them on cart page?

    1. Hey Sebastian, thanks for your comment πŸ™‚ Of course – you can use the conditional tag is_checkout() and make the function run on the checkout only:

      
      // Removes shipping method labels
       
      add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_label', 10, 2 );
       
      function remove_label($label, $method) {
      if (is_checkout()) {
      $new_label = preg_replace( '/^.+:/', '', $label );
      } else {
      $new_label = $label;
      }
      return $new_label;
      }
      
      
    2. Hello Rodolfo,

      Thank you so much for your explanations. I assume I am supposed to add this function into my functions.php file in my theme correct?

      If so, I did but it seems that its not working for me for some reason. Would you please help me on this?

      Thank you a lot!
      Regards,
      Hashim

    3. Hey Hashim, thanks so much for your comment! I just tested this snippet in Woo 2.6.2 and it still works correctly – and yes, I added this to my current theme’s (child theme) functions.php file. Try clearing the cache if you have a cache plugin πŸ™‚

  19. Hey! Does this code get rid of the shipping method label in the customer’s billing email? If so, then this is exactly what I need.

    Also, where do I exactly insert this code? In my theme’s functions.php?

    1. Meleah, unfortunately this code only works on Cart and Checkout pages. Doing the same in an email can be done but it’s custom and cannot cover this in this post. In case, get in touch πŸ™‚ R

  20. Hello, this doesnt work for me (www.electromes.gr/shop)

    1. Hey Christopher, thank you for this. I’m trying to add a product to cart but I don’t see an Add to Cart button – can you help? Thank you

    2. Thanks for the comment,
      Unfortunately in this clients page you have to be a member to add to cart.

    3. I see – if you want to send me login details I’ll see if I can fix the snippet for you. In case email me at infoATbusinessbloomer.com. R

  21. […] One thing is common in all of these scenarios – they don’t want the shipping options in the cart page. Unfortunately, WooCommerce does not provide a native solution for removing the shipping options. However, Rodolfo Melogli provides a simple solution for doing that in this Business Bloomer tutorial. […]

  22. Hi Rodolfo : I had try to add this , but it seems like My shipping method dropdop section is cart page not getting hide , I am using wp 4.1.5.
    Please check this screenshot : http://www.awesomescreenshot.com/image/370924/647434e661b89b83b042a1da81f633a0

    1. Sorry for a late , your code works awsome , My shipping lable get hidden , But is it possible to hide the whole shipping information in cart page , so that customer will get focused on shipping information only at checkout , Is this is possible .
      Now i add my changes like
      ” .cart_totals table tbody tr.shipping{display:none;} ” In css,
      But for this i need to set my default shipping to free of cost . Is there any way to do this?

    2. Hey Karthick, thanks for your inquiry! Yes – you can set the default shipping via the Woocommerce / Settings / Shipping and by “ticking” the default shipping method at the bottom of the page. Hope this helps!

  23. Very good and working for me πŸ™‚

    1. Thank you Arun πŸ™‚

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.