In older versions of WooCommerce there would display a ‘(Free)’ label behind any flat shipping rate without cost. Since WooCommerce version 2.6.0 it no longer shows this automatically behind shipping rates. Instead it doesn’t show anything, which is not as clear as it can be. Which in turn can confuse your customers and lead to lower conversion rates.

If you have a simple ‘free shipping’ option it is easy enough to add a text manually to the shipping option. However if you have a dynamically priced shipping rate in the (e.g. shipping class based cost) flat rate option or the Advanced Shipping plugin you can’t just add ‘Free’ to the title if there’s a chance it will be paid shipping.

Adding ‘Free’ after a free shipping option

Using the following code snippet you can automatically add the ‘Free’ text behind a shipping option, but only when it in fact is free. I’ve also included a – commented out – part where you can exclude local pickup from displaying ‘Free’ behind it, as this often times is implied.

This code snippet is very similar to how WooCommerce used to add the ‘(Free)’ shipping label to the shipping option.

The results look something like:

If wanted you can also make the ‘Free’ text bold, this can be done by replacing line #8 in the snippet with:

$label .= ' <strong>(' . __( 'Free', 'woocommerce' ) . ')</strong>';

Showing the shipping cost, even when free

An alternative is to just always show the shipping cost, even when it is a free shipping option. The following code snippet can be used for that;

Which will look like:

Jeroen Sormani

I'm a professional WordPress plugin developer on a mission to create the best plugins for my clients. I'm specialised in developing general WordPress, WooCommerce and Easy Digital Downloads plugins.

Interested in talking about a WordPress project? Get in touch!

Follow me on Twitter

6 thoughts on “Add ‘Free’ after a shipping label

Quentin February 21, 2019 at 12:10 pm

Thanks for that tip !

I wanted the “free” mention before the label (and bold) so here the few modifications :

$label = ‘ (‘ . __( ‘Free’, ‘woocommerce’ ) . ‘) – ‘ . $label;

If it can help someone..

Sam September 28, 2020 at 1:33 am

You are awesome for this wonderful code. Thank you.

Itai March 17, 2021 at 3:04 pm

Hi, quick question, how can I change the text of free/price (if it’s flat rate ) to the label of the shipping method?

Jeroen Sormani March 17, 2021 at 7:22 pm

Hi Itai,

Not sure what you mean there, the snippet should only add the additional text, and leave the original shipping title with the option; so it shouldn’t require to have to set it back to the label of the method.

Cheers,
Jeroen

Ali Silat November 21, 2021 at 5:05 am

Hey Mate, Thanks for the great solution.

I am using flat fee with different shipping classes. So, I want to add simple text: Shipping charges are calculdated based on product type & qty.

I have removed the second condtion and updated the label:
$label .= ‘ (‘ . __( ‘Shipping charges are calculdated based on product type & qty’, ‘woocommerce’ ) . ‘)’;

I want to break line and mention text in 2nd line.

Flat rate: ₨150.00 (Shipping charges are calculdated based on product type & qty)

Flat rate: ₨150.00
(Shipping charges are calculdated based on product type & qty)

Can you please help?

Jeroen Sormani November 21, 2021 at 12:09 pm

Hi Ali,

I haven’t tested it, but you can try to add or \n\r to add a break-line and see what works.

Cheers,
Jeroen

Leave a Reply