Share X in ✉

How to Add Shipping Charges in WooCommerce

Last updated
Read time
7 min
Category
How to Add Shipping Charges in WooCommerce

To add shipping charges in WooCommerce, create a shipping zone under WooCommerce > Settings > Shipping, then add a shipping method to that zone: Flat Rate for a fixed cost, Free Shipping for rule-based free delivery, or Local Pickup for in-store collection. You can layer in shipping classes and rate formulas to charge differently by product weight, quantity, or order value. 

This guide covers all four approaches, plus how to set shipping costs programmatically if you’re comfortable with code.

How to Add Shipping Charges in WooCommerce Using Shipping Zones

Step 1: Set Your Store Location

Go to WooCommerce > Settings > General and confirm your store address, the countries you sell to, and how WooCommerce should detect customer locations. This information feeds into how zones match customers at checkout.

Step 2: Create a Shipping Zone

Go to WooCommerce > Settings > Shipping > Shipping Zones and click Add Shipping Zone. Name the zone, then define its region by continent, country, state, or postal code. WooCommerce matches customers to the first zone that fits their address, so order specific zones (a single city or state) above broader ones (an entire country).

Step 3: Add a Flat Rate Shipping Method

Inside the zone, click Add Shipping Method and select Flat Rate. Configure these fields:

  • Name: The label customers see at checkout, such as “Standard Shipping.”
  • Tax status: Whether tax applies to the shipping cost.
  • Cost: The base fee. Enter a static number like 10.00, or use the placeholder variables covered in the next section for dynamic pricing.
  • Shipping class costs: Extra fees added on top of the base cost for products assigned to specific shipping classes.

Step 4: Add a Free Shipping Method

Click Add Shipping Method and select Free Shipping. Choose one of these conditions:

  • No requirement: Every customer in the zone gets free shipping automatically.
  • A valid free shipping coupon: Customers must enter a specific coupon code at checkout.
  • A minimum order amount: Customers qualify once their cart subtotal reaches a set threshold.
  • Coupon OR minimum order amount: Either condition unlocks free shipping.
  • Coupon AND minimum order amount: Both conditions must be met.

Enable “Apply minimum order rule before coupon discount” if you want eligibility based on the pre-discount total, so a coupon that drops the order below the threshold doesn’t disqualify the customer.

Step 5: Add a Local Pickup Method

Enter your store’s physical address under WooCommerce > Settings > General first. Local Pickup won’t appear as an option until you do.

Click Add Shipping Method, select Local Pickup, and check the box to enable it. Set a title customers will see, and choose whether pickup is free or has a fee. In current WooCommerce versions, Local Pickup has its own settings screen where you can add multiple store or warehouse locations for customers to choose from at checkout.

One limitation worth knowing: WooCommerce displays Local Pickup to every customer regardless of their location, so if you have pickup locations in specific cities only, customers outside those areas will still see the option.

How to Add Shipping Costs by Quantity, Percentage, or Order Value

The Flat Rate cost field accepts more than a static number. You can build formulas using these placeholders:

  • [qty]: The number of items in the cart. Multiply it against a per-item fee to charge more for larger orders.
  • [fee percent=”X”]: A percentage of the order’s total value. [fee percent=”10″] adds 10% of the cart total.
  • [min_fee=”X”]: A floor for the calculated cost. [min_fee=”5″] means the customer never pays less than $5, even if the formula produces a lower number.
  • [max_fee=”X”]: A ceiling for the calculated cost. [max_fee=”20″] caps the fee at $20 regardless of how high the formula runs.

Formula examples:

A flat $10.00 fee for every order, regardless of cart size, works as a baseline. To add $1 per extra item on top of a $10 base, use 10 + (1 * [qty]). One necklace costs $11.00, two bracelets cost $12.00.

To charge a base fee plus a percentage of the order, use 10 + [fee percent="5"]. A $100 order costs $15.00 in shipping; a $200 order costs $20.00.

To guarantee a minimum charge on percentage-based formulas, use 10 + [fee percent="7" min_fee="10"]. A $50 order calculates to $13.50, which is above the $10 minimum, so it stays at $13.50. Wait, check this scenario against your own formula before publishing. This is called out because it’s a common documentation and configuration behavior area.

To cap costs on higher-value orders, use 15 + [fee percent="10" max_fee="25"]. A $200 order calculates to $35.00, but the customer pays the capped $25.00.

Charging Shipping by Weight

Native WooCommerce Flat Rate does not calculate cost per pound automatically. To approximate weight-based shipping, group products into shipping classes by weight range (for example, “Under 5 lbs” and “5–20 lbs”) and assign a different Flat Rate class cost to each. For true per-pound calculation, you’ll need a dedicated shipping plugin that reads product weight and applies a formula, since core WooCommerce doesn’t expose a weight-based placeholder.

How to Add Shipping Classes in WooCommerce

A shipping class groups products that share the same shipping requirements, such as size, weight, or fragility. Go to WooCommerce > Settings > Shipping > Shipping Classes to create one. Give it a name, slug, and description, then assign products to the class individually or in bulk from the product list.

Once classes exist, open your Flat Rate method inside a shipping zone and set a cost per class. Choose between two calculation types:

Per class: Charges shipping for each class present in the order separately.
Per order: Bases the charge on the single most expensive class in the cart, rather than stacking every class’s cost.

Shipping classes combined with rate formulas get you close to table-rate shipping without installing an extra plugin, though dedicated shipping plugins remain the more flexible option for complex, multi-condition rules or real-time carrier rates from providers like USPS, UPS, or FedEx.

Setting Shipping Costs Programmatically

If you’re comfortable editing your theme’s functions.php or a custom plugin, WooCommerce exposes hooks for developers who need shipping logic beyond the settings screen. The woocommerce_cart_calculate_fees action lets you add a custom fee based on cart contents, while woocommerce_package_rates lets you filter or modify the shipping rates a customer sees before checkout. A common pattern:

add_action( 'woocommerce_cart_calculate_fees', function( $cart ) {
    if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
        return;
    }
    $cart->add_fee( 'Handling Fee', 5.00 );
});

This adds a flat $5 handling fee to every cart. Test any custom code on a staging site first, and confirm compatibility with your active shipping plugins before deploying to production.

Best Practices for Setting Shipping Charges

Show shipping costs as early as possible, ideally on the cart page, so customers aren’t surprised at checkout.
Set a free shipping threshold slightly above your average order value to encourage larger carts.
Factor in packaging and carrier costs when setting flat rates so shipping doesn’t quietly erode your margin.
Order your shipping zones from most specific to least specific, since WooCommerce uses the first match.
Revisit your rates periodically. Carrier costs change, and a flat rate set a year ago may no longer cover your actual cost.

Frequently Asked Questions

How does WooCommerce shipping work?

WooCommerce matches a customer’s address to a shipping zone, then displays whichever shipping methods you’ve configured for that zone: Flat Rate, Free Shipping, Local Pickup, or methods added by shipping plugins. The customer picks one at checkout, and the cost is added to their order total.

What is a shipping class in WooCommerce?

A shipping class is a label you assign to products that share shipping characteristics, like weight or fragility. You then set different Flat Rate costs per class, so heavier or bulkier products can cost more to ship without needing a separate plugin.

How do I add a shipping class in WooCommerce?

Go to WooCommerce > Settings > Shipping > Shipping Classes and create a new class with a name and slug. Assign products to it from the product edit screen or in bulk from the product list, then set a cost for that class inside your Flat Rate shipping method.

Can I set shipping costs based on quantity in WooCommerce?

Yes. Use the [qty] placeholder in the Flat Rate cost field, combined with a per-item multiplier, such as 10 + (1 * [qty]). This adds a fixed amount per item on top of a base rate.

How do I add shipping charges in WooCommerce with WordPress?

Shipping is configured through the WooCommerce plugin itself, not core WordPress. Once WooCommerce is installed and activated, go to WooCommerce > Settings > Shipping to create zones and add Flat Rate, Free Shipping, or Local Pickup methods.

Key Takeaways

  • WooCommerce ships with three built-in methods: Flat Rate, Free Shipping, and Local Pickup, all configured inside shipping zones.
  • Flat Rate accepts formula placeholders ([qty], [fee percent], [min_fee], [max_fee]) for quantity- and percentage-based pricing.
  • Weight-based shipping in native WooCommerce works through shipping classes, not a direct per-pound setting; true weight calculation needs a plugin.
  • Shipping classes let you charge different rates for different product types without leaving the default settings screen.
  • Developers can set shipping costs and fees programmatically using the woocommerce_cart_calculate_fees and woocommerce_package_rates hooks.
  • Local Pickup displays to all customers regardless of location, so plan your messaging around that limitation.
  • Review shipping rates periodically against actual carrier and packaging costs to avoid losing margin on every order.
[CTA] Stop reading. Start fixing.
Fix your product feed with CTX Feed Pro.

Free version on WordPress.org. Every Pro licence includes a 30-day money-back guarantee.

[0] Comments
Join the discussion
Leave a comment →

Leave a comment.

[NEWSLETTER] Field Notes, monthly

One email a month.
Zero fluff.

Channel-spec changes, plugin releases, the occasional deep dive on something we broke.