1. Documentation /
  2. Hide Shipping Methods for WooCommerce

Hide Shipping Methods for WooCommerce

Hide Shipping Methods for WooCommerce plugin helps to conditionally hide WooCommerce shipping methods and specific shipping options.

Installation

↑ Back to top
  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
  3. Install Now and Activate the extension.
More information at Install and Activate Plugins/Extensions.

Set up and Configuration

↑ Back to top
Once the plugin is installed and activated, you can start with it. Go to WordPress Admin Sidebar menu > Hide Shipping. The whole process is divided into two steps:
  1. Setting Filters for Hiding Shipping Methods
  2. Selecting Shipping Methods for Hiding

Setting Filters for Hiding Shipping Methods

↑ Back to top
The plugin offers some useful filters, using which you can hide WooCommerce shipping methods. Based on the filters configured, the shipping methods will be hidden in the cart and checkout pages. The filter settings are as shown below. Hide WooCommerce Shipping Methods
  • Shipping Class: Select one or more shipping classes that you have created in your WooCommerce shipping settings. Or you can choose to select products with no shipping class as well.
  • Product Category: Select one or more WooCommerce product categories. When products in the selected categories are added to the cart, the shipping methods will be automatically hidden.
  • Order Weight: This is the total order weight in the cart. When the cart’s total weight meets one of the following conditions, the selected shipping methods will be hidden –
    • >=  – Greater than or equal to the specified weight
    • <= – Less than or equal to the specified weight
    • == – Equal to the specified weight
    • || – Between the specified minimum and maximum total order weight
    • All – For all the products regardless of order weight.
  • Product Category: Select one or more WooCommerce product categories. When products in the selected categories are added to the cart, the shipping methods will be automatically hidden.
  • Order Weight: This is the total order weight in the cart. When the cart total weight meets one of the following conditions, the selected shipping methods will be hidden –
    • >=  – Greater than or equal to the specified weight
    • <= – Less than or equal to the specified weight
    • == – Equal to the specified weight
    • || – Between the specified minimum and maximum total order weight
    • All – For all the products regardless of order weight.
  • Order Subtotal: This is the subtotal of products. When the cart subtotal meets one of the following conditions, the selected shipping methods will be hidden –
    • >=  – Greater than or equal to the specified amount
    • <= – Less than or equal to the specified amount
    • == – Equal to the specified amount
    • || – Between the specified minimum and maximum order subtotal amount.
    • All – For all the products regardless of the order subtotal.
  • Countries: Select one or more countries to hide shipping methods. Once you select countries that have states, the States field appears to choose desired states.
  • Postal Code: Enter one or more postal/zip codes separated by commas, to hide shipping methods.
  • Product SKU: Enter one or more product SKUs separated by commas. If you want to hide shipping methods for individual products, this is the most ideal method to use.
  • Shipping Methods: You can use existing WooCommerce default as well as premium shipping methods to hide other shipping methods. Once you activate premium shipping plugins, the shipping method ID will be automatically added to this list.
  • Shipping Options: If you want to filter a specific service from your premium shipping method(s), you can add the HTML value of the desired shipping service. You can add multiple services by separating them with commas.
  • WordPress User Roles: Select the desired WordPress User Roles from whom you want to hide shipping methods. You can select one or more user roles.
Once you have configured the settings, click Save & Continue.

Selecting Shipping Methods for Hiding

↑ Back to top
The plugin allows you to hide three things:
  1. WooCommerce Default Shipping Methods
  2. WooCommerce Premium Shipping Methods
  3. Selected Services from Premium Shipping Methods
Selecting Shipping Methods for Hiding
  • Shipping Methods: Select desired shipping methods to hide. The shipping method IDs – flat_rate, free_shipping, and local_pickup for WooCommerce default shipping methods are listed by default. If you have activated other premium shipping plugins for DHL Shipping, USPS Shipping, and so on, the shipping method ID will be listed here automatically.
  • Shipping Options: If you want to hide a specific service from your premium shipping method, you can add the HTML value (see “How to get HTML value of an element?” in the following section for reference) of the desired shipping service. You can add multiple services by separating them with commas. 
  • Rule Name:  Enter a suitable rule name to identify each rule distinctively.
Finally, click Create Rule to proceed.

How to get the HTML value of an element?

↑ Back to top
The below screenshot shows the HTML value for Priority Mail (USPS) service returned by a Shipping Plugin.

Advanced Rule

↑ Back to top
Create an advanced rule to manage scenarios in which there is a conflict between several hide shipping rules that you have set. You may do this by following the instructions in the previous section. Choose the rules that, when combined, will result in the creation of new rules.

Manage Rules

↑ Back to top
View and manage all the created rules in the Manage tab. Manage Rules You can see the rule name, parameters involved by hiding the shipping method(s), and quick actions to EditCopy, and Delete the rule. Under the advanced rules tab, you can manage the created advanced rules.  advanced rules tab

Examples

↑ Back to top

Hide other shipping methods when “Free Shipping” is available

↑ Back to top
Case: Let us hide other shipping methods, say Flat Rate when Free Shipping is available for the product. Both Free Shipping and Flat rates are offered for the United States region as shown in the screenshot below.
Hide WooCommerce Shipping Methods Plugin Show Existing Methods
Existing WooCommerce Shipping Methods
In the plugin settings, we should select the shipping method filter as the free_shipping option.  advanced rules tab Next, in the hide shipping method settings, we need to select the flat_rate option as shown in the below screenshot. Finally, when we move to the front-end of the WooCommerce store, the cart page now shows only the Free Shipping method for the United States region.
Hide WooCommerce Shipping Methods Plugin Show Free Shipping
Free Shipping is Available – All Other Shipping Methods are Hidden

Hide specific shipping methods based on the customer’s country and the total order weight (Advanced Rule)

↑ Back to top
Case: You want to create an advanced rule that hides specific shipping methods based on two conditions: the customer’s country and the total order weight. Create Rule 1: Customer’s Country On the Set the Filter page, in the “Country” field, choose the country for which you want to hide the shipping methods and click Save & Continue. We have selected United States to demonstrate. Hide specific shipping methods based on the customer's country and the total order weight Next on the Shipping Methods to Hide tab, select the shipping methods you want to hide. We have chosen to hide free shipping if the country condition is met. Shipping Methods to Hide In the “Rule Name” field, enter a descriptive name like “Hide Shipping for Country.” Click on the “Create Rule” button. Condition 2: Total Order Weight Navigate to the “Create Rule” tab again. Choose the “Order Weight” option and set the weight range for which you want to hide the shipping methods. We have used the weight range of >= 1kg to demonstrate. Total Order Weight
Click “Save & Continue”. Next, on the Shipping Methods to Hide tab, select the shipping methods you want to hide for the rule, assign an appropriate name for the rule, and click Create Rule. Shipping Methods to Hide Advanced Rules: In the “Advanced Rules” settings, choose the created rules – Hide Shipping for Country and Total Order Weight. This means both rules must be met for the shipping methods to be hidden.  Advanced Rules Click “Save and Continue” to save the advanced hide shipping rule. After following these steps, the selected shipping method (free shipping) will be hidden on the Cart and Checkout pages for orders that meet both conditions: customer’s country and total order weight. Check out the screenshot below: