WooCommerce: Disable Free Shipping if another shipping method is active

Hello Reader,

You have no doubt landed here while trying to figure out how to disable free shipping when another specific method is available. For me personally I needed to disable free shipping when “Distance Rate” rules applied to the order. For you, it may be another case – but this tutorial should help you get the job done right. This tutorial is suited for websites running WooCommerce 2.6 or higher.

Here is what my screen looked like before applying the proper code to charge the user for shipping.

WooCommerce Disable Free Shipping

Here is the code I used to disable the free shipping method when the distance rate shipping applied.

You will need to replace “distance_rate” on line 12, with the name of the shipping method you need to show. If you are not sure what the name of the method is you will need to grab it from the source on the cart or order page. I have provided you with a screenshot on how to do this below:

WooCommerce Shipping Method Name

After you have applied the code in your theme’s functions.php file and emptied your cart (important to clear the cache) and added an item to your cart you should see the following:

WooCommerce Disable Free Shipping For Another Method

That concludes the tutorial on how to disable free shipping when another shipping method is active. I hope I was able to help you solve your dilemma 🙂

Do you need help getting your WooCommerce store to work the way you want? I am available for web design and development at affordable rates! You can get in touch with me by visiting my contact page.