To show only free shipping when the customer qualifies for it, tick the “Hide shipping rates when free shipping is available” box in WooCommerce. No more file to upload to the server as in the first version of this article. There is one case left where a short snippet helps: when free shipping comes from another plugin.
In short
- The problem: once the threshold is reached, the customer still sees the paid rates and can choose one by mistake.
- The native solution: a box in WooCommerce > Settings > Shipping > Shipping settings.
- Local pickup stays on display, which is the expected behavior.
- The box only recognizes the WooCommerce “Free shipping” method.
- Free shipping worked out by a plugin? A few lines of code do the same job.
The problem
You offer several shipping methods, and free shipping above a certain amount. When the customer reaches that amount, WooCommerce shows free shipping… next to Colissimo at €7.90 and the pickup point at €4.90. It is confusing, and some customers pick a paid option without noticing.
The native solution, in three steps
- Create free shipping. In WooCommerce > Settings > Shipping, open your zone, add the Free shipping method and choose “A minimum order amount” with your threshold.
- Tick the box. Still in the Shipping tab, in the Shipping settings section, tick Hide shipping rates when free shipping is available, then save.
- Test. Fill a cart below the threshold, then one above it. Above it, only free shipping should remain, with local pickup if you offer it.
Nothing changes? WooCommerce caches shipping rates. Temporarily tick “Enable debug mode” in the same settings, run the test again, then untick it.
When the box is not enough
The WooCommerce box only recognizes its own “Free shipping” method. If your free shipping comes from another plugin, for example a €0 row in a Flexible Shipping table or a carrier rate, it will hide nothing.
In that case, this code keeps the €0 rates and local pickup, and hides the rest as soon as a free shipping rate exists:
add_filter( 'woocommerce_package_rates', 'wycan_seulement_livraison_offerte', 100 );
function wycan_seulement_livraison_offerte( $rates ) {
$methodes_retrait = array( 'local_pickup', 'pickup_location' );
$offertes = array();
$retraits = array();
foreach ( $rates as $rate_id => $rate ) {
if ( in_array( $rate->get_method_id(), $methodes_retrait, true ) ) {
$retraits[ $rate_id ] = $rate;
} elseif ( 0.0 === (float) $rate->get_cost() ) {
$offertes[ $rate_id ] = $rate;
}
}
return $offertes ? $offertes + $retraits : $rates;
}Where should it go? The simplest option is a plugin such as Code Snippets. You can also add it to your child theme’s functions.php file, or to a PHP file placed in wp-content/mu-plugins/ (create the folder if it does not exist, and start the file with <?php). A file in mu-plugins activates on its own and cannot be deactivated by mistake from the admin.
Going further
Flat rate, weight, coupons, pickup points: every method is in our guide to WooCommerce shipping costs and delivery.
Would you rather we set up your shipping costs for you? Write to us and we will look at your shop.



