You may have setup different shipping rates in your WooCommerce store. What you want and need to charge for shipping is different in each webshop and it is very hard to set things up exactly the way you need it. In this post I will show you how you can only show the cheapest shipping method or the most expensive one.

Only show the cheapest shipping rate

One of the reasons you might want to only show the cheapest rate is because you’re using the different shipping rates form different shipping carriers. To make it easier to your customers you may only want to to show the cheapest shipping rate. To filter out the other rates you can use the following custom code;

This code will ensure only the cheapest shipping rate of ALL your rates is being shown. Keep in mind that this could also be free shipping if that is something you’re offering.

Only show the most expensive shipping rate

There are also different reasons why you may want to only show the most expensive shipping rate available. For example, if you’ve setup shipping rates with a cost based on the class. It could be that you can include some of the lighter items you sell within a heavier/bigger package. In that case it would be good to only show the most expensive shipping rate so you will not lose money on the shipping cost.

The following code is almost the same as the code above and can be used in the same way.

Only show free shipping when available

If you offer free shipping rates you may also want to hide the other shipping rates as it doesn’t always make sense to offer paid shipping when there’s also free shipping available (sometimes it is, but it could be that the free shipping/paid shipping are exactly the same).

The following code will only show all the free shipping rates, meaning that if you’ve setup local pickup for example this will still be a option for the user. With the following code only the free shipping rates will show when there is a free shipping available, but it does make sure that it shows the regular shipping rates when local pickup is available (you probably do want to offer the choice to pickup or ship).

Closing words

Showing only one correct shipping rate will help your customers with the checkout as they’ve got one less decision to make. These code snippets will hopefully help you show the right shipping rates in your webshop.

Please leave a comment below if this was helpful for you, or if you ran into any challenges 🙂

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

34 thoughts on “Only show free/cheapest/most expensive shipping in WooCommerce

Joe September 7, 2023 at 7:53 pm

Hi, I use your plugin and the advanced pricing add-on.
I have several shipping methods with the same name and want to only show one when there are duplicates available with the same name.

How can this be done?
They are all free ($0.00)

Jeroen Sormani September 8, 2023 at 7:51 pm

Hi Joe,

If you’d like to do this through the plugin it would depend on your requirements/conditions. Its not possible to automatically hide others with the same name for example.
For this, please reach out through the support channel of the plugin.

In case you’re looking to do this automatically through a customization, thats an option as well. Feel free to reach out if you need help with this.

Cheers,
Jeroen

Leave a Reply