WooCommerce: Translate “Shipping” @ Cart Totals

The cart totals table cell title “Shipping” or “Shipping and Handling” appears also on the checkout page. So, what if you wish to “translate” this string from English to “better” English or completely customize it? Thankfully there’s a quick 4 lines snippet for you. Enjoy!

Editing/translating the Cart Totals “Shipping” table cell title @ WooCommerce Cart & Checkout

PHP Snippet: Translate “Shipping” @ WooCommerce Cart Totals & Checkout Order Review

 * @snippet       Translate "Shipping" - WooCommerce Cart & Checkout
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.8
 * @donate $9     https://businessbloomer.com/bloomer-armada/

add_filter( 'woocommerce_shipping_package_name', 'bbloomer_new_shipping_title' );

function bbloomer_new_shipping_title() {
   return "Delivery";

Where to add this snippet?

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 files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

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 Customization?

Check out these free video tutorials. You can start learning how to customize WooCommerce without unnecessary plugins. Watch me code and learn by example!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP

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.

26 thoughts on “WooCommerce: Translate “Shipping” @ Cart Totals

  1. It works great! Just plugged the code into my functions.php and vualรก. Too bad I can’t understand why it works. No clue how this refers to specific instances. What if the word exists in multiple places and you only want to change it in one? Just curious so i can use it in other circumstances I may need. Thanks for sharing your solutions. They are awesome.

    1. Awesome! Inside the function you can use WordPress conditionals and only trigger this on a specific page (is_page). Hope this helps!

  2. This does not seem to work any longer. But this worked for me:

    add_filter( ‘woocommerce_shipping_package_name’, ‘custom_shipping_package_name’ );
    function custom_shipping_package_name( $name ) {
    return ‘Delivery’;

    1. Awesome and thank you! Snippet revised ๐Ÿ™‚

  3. great snippet works great. Thank u very much

  4. Hi !

    Thanks for a great article !

    The code only replaces one instance of “shipping” to “delivery” on my page (the Address) section but not the instance in the total section. I’ve tried experimenting with changing other words (e.g. Total) and this works. Any idea what’s stopping the translation for shipping ?

    Many thanks in advance for any advice – much appreciated ๐Ÿ™‚

    1. Hey Richard, thanks for your comment! You might need a second call or maybe that’s coming from your theme or specific plugin. Sorry but I can’t offer free support here in the blog comments ๐Ÿ™‚

  5. hi. my site is multilingual (English as main language & Bahasa Indonesia). if i use this code, is the translated version going to show only when visitor switch to Bahasa Indonesia? (i want it to be so)

    1. Hey Sandra, thanks so much for your comment! No, this solution I think applies to all languages – if your site is multilingual, instead, you should have a function to edit such string in your multilingual plugin. Do you use WPML or similar?

  6. Hi Rodolfo!

    I attended your class last month and signed up to attend the one next week- I’m so excited!

    I am interested in renaming the “Calculate Shipping” button (located under Cart Totals Table) to “Calculate Taxes” (since this functionality calculates both shipping & taxes) so I wanted to know if you had any idea how to rename it? I did some research and there appears to be a Shipping.php file but I know if a new version of Woocommerce comes out it would get overridden. Any ideas? Also, is it possible to add the “Calculate” button on the Checkout page as well?



    1. April – awesome! I’m looking forward to next week’s event as well ๐Ÿ™‚

      In regard to the string translation question, check this out: https://businessbloomer.com/translate-single-string-woocommerce-wordpress/. It should help you with that.

      In relation to the calculate button, the checkout calculates shipping already – not sure why you would need it there again? Maybe explain that a little better and I’ll get back to you with an answer ๐Ÿ™‚


      1. Hi Rodolfo,

        Great, thanks! I will check out the thread.

        So, the reason why I was interested in adding the ‘Calculate Shipping’ to the Checkout Page as well, is just in case the user doesn’t calculate the shipping on the Cart page and wants to do it on Checkout. I do think it’s redundant but I just wanted the user to have the option for both pages ๐Ÿ™‚



        1. No problem ๐Ÿ™‚

          Re: shipping calculator I don’t honestly think that’s good for UX. On the checkout, people can select shipping methods and “calculate” shipping in that way – it’d be redundant in my opinion. Of course there is a way to add it there as well (find the PHP that is generating the calculator and try copy/paste that on the checkout via a hook) – good luck!

          1. You have a good point! Thanks for the insight. Have a great day ๐Ÿ™‚

            1. No problem at all ๐Ÿ™‚ Talk soon!

  7. Great in theory, and I used it to change from “Shipping” to “Shipping and Handling”, but I was frustrated to find that it changes it everywhere. It even says “Shipping & Handling Address” instead of “Shipping Address” on the invoice. Is there a way to just change it just on the cart totals and invoice totals?

    1. Thanks for your feedback! Good point – of course you can trigger the function only on the Cart page for example by using:

      if (is_cart()) {
      // run function

      In this way the snippet will only be called on the Cart page. Hope this helps!

  8. Hello,
    Great, thank you for that! ๐Ÿ™‚
    Can i remove text with that function?
    Best regards!

    1. Anze, thanks for your feedback! Of course – just enter ” (2 single quotes) in the second place and the string will be translated into an empty one! Rodolfo

  9. Fatal error: Call to undefined function add_filter() in /home/u627751393/public_html/wp-includes/functions.php on line 10

    1. Thanks Anon for your feedback. This code works with every version of Woocommerce so you probably forgot an apostrophe or a parenthesis. Can you check this please?

  10. Hi

    Can this be used to translate more than one string?

    1. Yes Tom, of course. Use an array:

      // Add this to your functions.php
      add_filter('gettext', 'translate_enhu');
      add_filter('ngettext', 'translate_enhu');
      function translate_enhu($translated) {
      $before = array ("word1", "word2");
      $after = array ("newword1", "newword2");
      $translated = str_ireplace($before, $after, $translated);
      return $translated;
  11. Hi… and if I wanted to translate that string in 5 languages … how can I do?
    Thanks ๐Ÿ™‚

    1. Mik thanks for your message! If you want to translate this in 5 languages you will need to use a plugin such as WPML or Codestyling Localization (a free plugin that used to be on the WordPress repository but for some reason I can’t find at the moment). Hope this helps!

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 *