Table of Contents
For the most common case, hiding other rates when free shipping qualifies, WooCommerce 9.9 and later has a native toggle at WooCommerce > Settings > Shipping > Shipping Settings. For any other condition, such as country, shipping class, product, cart total, or user role, use the woocommerce_package_ratesfilter to unset the rate IDs you want gone, or a plugin to set the rules without code. Remember that WooCommerce caches rates, so clear the cart and transients when testing.
Key Takeaways
Showing every shipping rate to every customer creates friction. A buyer who qualifies for free shipping does not want to see a paid Flat Rate next to it, and a customer picking up in store should not be offered courier delivery. Hiding the wrong methods at the right time makes checkout cleaner and lifts conversions.
This guide is the pillar for hiding shipping methods by condition. It is a different job from removing shipping for products that do not need it, like digital downloads, which is covered in disable shipping for certain products. Here we are hiding rate options such as Flat Rate, Free Shipping, and Local Pickup based on rules.
Why hide shipping methods
Hiding methods conditionally solves real problems:
- Cleaner checkout. Fewer, more relevant options mean less hesitation at the shipping step.
- Protect margins. Hide a paid rate once free shipping qualifies, so customers do not pay when they do not need to and you do not undercharge.
- Match fulfilment. Hide courier delivery on a local-pickup order, or hide pickup for customers outside your area.
- Fewer abandoned carts. An irrelevant or expensive-looking option at checkout costs sales.
Can WooCommerce hide shipping methods natively?
Mostly no. WooCommerce has one native conditional rule, and it covers only the free-shipping case. Everything else needs code or a plugin.
The native free-shipping toggle (9.9+)
As of WooCommerce 9.9, there is a native setting for the single most-requested scenario. Go to WooCommerce > Settings > Shipping > Shipping Settings and enable Hide shipping rates when free shipping is available. Once a cart qualifies for free shipping, the paid rates in that zone are hidden automatically.

That is the limit of native conditional hiding. There is no native option to hide a method by country, class, product, cart total, or user role. On WooCommerce versions before 9.9, even the free-shipping case needs the code below or a plugin.
Hide other methods when free shipping is available
This is the number one use case, so it is worth covering both ways.
The native toggle
On 9.9 and later, the toggle above is all you need. Set your Free Shipping method’s “requires” condition in the zone (for example, a minimum order amount), enable the hide setting, and qualifying carts see only free shipping.
The code method
For older versions, or when you want finer control, filter the rates. This snippet returns only the free option whenever one is available.
add_filter( ‘woocommerce_package_rates’, ‘ds_hide_when_free_shipping’, 9999, 2 );
function ds_hide_when_free_shipping( $rates, $package ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( ‘free_shipping’ === $rate->method_id ) {
$free[ $rate_id ] = $rate;
}
}
return ! empty( $free ) ? $free : $rates;
}
The high priority (9999) makes sure it runs after other shipping logic.
Hide shipping methods by condition
For every other rule, the same woocommerce_package_rates filter is the tool. It hands you the rates, keyed by IDs like flat_rate:2, free_shipping:8, and local_pickup:1, and you unset the ones to hide. Here is the template, hiding a method for one country.
add_filter( ‘woocommerce_package_rates’, ‘ds_hide_method_by_condition’, 9999, 2 );
function ds_hide_method_by_condition( $rates, $package ) {
if ( ‘US’ === $package[‘destination’][‘country’] ) {
unset( $rates[‘flat_rate:2’] ); // hide this method for US addresses
}
return $rates;
}
Change the condition inside the if to target other rules:
- By state or postcode: read $package[‘destination’][‘state’] or [‘postcode’].
- By shipping class: loop $package[‘contents’] and check $item[‘data’]->get_shipping_class().
- By product or category: loop the contents and match the product ID or has_term().
- By cart total or weight: compare WC()->cart->get_cart_contents_total() or the package weight to your threshold. This is also how you hide Free Shipping until a minimum is reached.
- By user role: check wc_current_user_has_role() or whether the customer is logged in.
Local Pickup: hide it, or hide everything except it
To hide pickup, unset its local_pickup:* rate. To do the opposite and show only pickup, keep just the pickup rates and drop the rest, which is the pattern for a pickup-only checkout. For the full pickup-only setup, see allow only local pickup for orders.
The caching gotcha
This trips up almost everyone. WooCommerce caches calculated rates in the session, so your snippet can look like it does nothing on a cart that was already priced. After adding any rate filter, empty the cart and re-add an item, and clear transients under WooCommerce > Status > Tools > Clear transients. Then test again.
The no-code way: Hide Shipping Method for WooCommerce
Code is fine for one or two fixed rules, but it gets hard to maintain once conditions multiply or you want to combine them. A plugin moves the whole job into the admin.
The Hide Shipping Method for WooCommerce plugin hides methods by rule, with no code. You can hide methods by country, state, city, or postcode, by shipping class, product, or category, by cart subtotal, weight, quantity, or order total, by user role, and by free-shipping or local-pickup availability, then combine several conditions in one rule. For a rule-by-rule walkthrough, see the guide to condition-based hiding of shipping methods, and for product-level control, restrict a shipping method per product.
Hide Shipping for WooCommerce
Hide all other shipping methods when free shipping and/or local pickup are available in two minutes or less.
14-day, no-questions-asked money-back guarantee.

Troubleshooting: methods not showing?
If methods vanish that should appear, you may have hidden too much, or a different issue is at play, like a zone that does not cover the address or a cart with no shippable items. The full diagnostic is in the guide to WooCommerce shipping methods not showing. Always keep at least one method available for every cart so checkout never reaches a dead end.
Best practices
Keep these in mind so hiding methods helps without breaking checkout:
- Use the native 9.9 toggle for the free-shipping case rather than code.
- Always leave at least one valid method for every cart and address.
- Clear the cart and transients after editing any rate filter, since rates are cached.
- Match rate IDs carefully, including the instance number, or by method_id for all instances.
- Move to the plugin once you need several conditions or no-code management.
Conclusion
Hiding shipping methods in WooCommerce comes down to three options in order of effort. Use the native 9.9 toggle to hide paid rates when free shipping qualifies, the woocommerce_package_rates filter for any other condition, and a plugin when the rules grow. Mind the rate cache while testing, and keep a fallback method available. When code becomes a chore to maintain, the Hide Shipping Method for WooCommerce plugin sets every one of these rules from the admin.
Hide Shipping for WooCommerce
Hide all other shipping methods when free shipping and/or local pickup are available in two minutes or less.
14-day, no-questions-asked money-back guarantee.

Frequently asked questions
How do I hide other shipping methods when free shipping is available?
On WooCommerce 9.9 and later, enable “Hide shipping rates when free shipping is available” under Settings > Shipping > Shipping Settings. On older versions, use a woocommerce_package_rates snippet that returns only the free rate.
Can WooCommerce hide shipping methods by country or postcode?
Not natively. Use the woocommerce_package_rates filter and read $package[‘destination’] to unset methods for specific countries, states, or postcodes, or use a plugin.
How do I hide a shipping method for certain products?
Loop the package contents in the filter and unset the method when a flagged product, category, or shipping class is present, or set a product rule in a hide-shipping plugin.
Why does my hidden method still show, or hidden rates come back?
WooCommerce caches rates in the session. Empty the cart, re-add an item, and clear transients under WooCommerce > Status > Tools, then test again.
How do I hide everything except Local Pickup?
In the filter, keep only the local_pickup rates and unset the rest. This gives a pickup-only checkout for that cart or zone.
Do I need a plugin to hide shipping methods?
No. The native toggle covers free shipping, and the rate filter covers everything else. A plugin is worth it when you want multiple or combined conditions without code.