WooCommerce is a popular tool for online stores. Sometimes you need to hide shipping methods. This can make your store look cleaner. It can also help customers find the right shipping option faster.

Credit: woocommerce.com
Why Hide Shipping Methods?
There are many reasons to hide shipping methods. Here are a few:
- Reduce clutter
- Guide customers to preferred options
- Offer special shipping for select products
- Show different options for different locations
Methods to Hide Shipping Options
There are different ways to hide shipping methods. You can use plugins. You can also use custom code. Let’s look at both options.
Using A Plugin
Plugins are easy to use. They do not need coding skills. Follow these steps:
- Go to your WordPress dashboard.
- Click on ‘Plugins’ and select ‘Add New’.
- Search for ‘Hide Shipping Methods’.
- Choose a plugin and click ‘Install Now’.
- After installation, click ‘Activate’.
- Go to the plugin settings and configure it.
Using Custom Code
Custom code gives you more control. But it needs some coding knowledge. Here are the steps:
- Go to your WordPress dashboard.
- Click on ‘Appearance’ and select ‘Theme Editor’.
- Find the ‘functions.php’ file of your theme.
- Add the following code to the file:
add_filter( 'woocommerce_package_rates', 'hide_shipping_methods', 10, 2 );
function hide_shipping_methods( $rates, $package ) {
// Add your condition to hide shipping methods here
foreach ( $rates as $rate_id => $rate ) {
if ( $rate->method_id === 'flat_rate' ) {
unset( $rates[$rate_id] );
}
}
return $rates;
}
This code hides the flat rate shipping method. You can change it to hide other methods.

Credit: elextensions.com
Hide Shipping Methods Based on Conditions
You might want to hide methods based on certain conditions. Here are some examples:
Based On Cart Total
You can hide methods if the cart total is too low or high. Use this code:
add_filter( 'woocommerce_package_rates', 'hide_methods_based_on_cart_total', 10, 2 );
function hide_methods_based_on_cart_total( $rates, $package ) {
$cart_total = WC()->cart->get_cart_contents_total();
if ( $cart_total < 50 ) {
foreach ( $rates as $rate_id => $rate ) {
if ( $rate->method_id === 'free_shipping' ) {
unset( $rates[$rate_id] );
}
}
}
return $rates;
}
This code hides free shipping if the cart total is less than $50.
Based On Shipping Class
You can hide methods based on the shipping class of products. Use this code:
add_filter( 'woocommerce_package_rates', 'hide_methods_based_on_shipping_class', 10, 2 );
function hide_methods_based_on_shipping_class( $rates, $package ) {
foreach ( WC()->cart->get_cart() as $cart_item ) {
if ( $cart_item['data']->get_shipping_class() === 'fragile' ) {
foreach ( $rates as $rate_id => $rate ) {
if ( $rate->method_id === 'flat_rate' ) {
unset( $rates[$rate_id] );
}
}
break;
}
}
return $rates;
}
This code hides flat rate shipping for products with a ‘fragile’ shipping class.
Based On User Role
You can hide methods for different user roles. Use this code:
add_filter( 'woocommerce_package_rates', 'hide_methods_based_on_user_role', 10, 2 );
function hide_methods_based_on_user_role( $rates, $package ) {
if ( current_user_can( 'wholesale_customer' ) ) {
foreach ( $rates as $rate_id => $rate ) {
if ( $rate->method_id === 'flat_rate' ) {
unset( $rates[$rate_id] );
}
}
}
return $rates;
}
This code hides flat rate shipping for wholesale customers.
Frequently Asked Questions
How Can I Hide Shipping Methods In Woocommerce?
You can use WooCommerce settings or plugins to hide shipping methods.
Is There A Plugin To Hide Woocommerce Shipping Methods?
Yes, several plugins like WooCommerce Conditional Shipping and Payments can help.
Can I Hide Shipping Methods Based On Location?
Yes, you can hide shipping methods based on the customer’s location.
How Do I Hide Free Shipping In Woocommerce?
Go to WooCommerce settings and disable the free shipping option.
Conclusion
Hiding WooCommerce shipping methods can make your store better. It helps customers find the right shipping option. You can use plugins or custom code. You can also hide methods based on conditions. Try these methods and see what works best for your store.