Add ‘Free’ after a shipping label

Posted on January 16, 2018

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.

Who’s this guy?

My name is Jeroen, go ahead and try to pronounce that! I bet you get it wrong if you’re not Dutch

I am a professional WordPress Plugin Developer, working from Alphen aan den Rijn in the Netherlands. Besides being a seasoned developer, I have a solid background in SEO and have been responsible for hundreds of websites and webshops in my previous work experience.

I build custom plugins for WordPress, WooCommerce and Easy Digital Downloads. My focus is to build the best, secure, reliable, optimized plugins with a good User Experience.

When not working, I like to watch tv series and eat some healthy home-made pizza.