How to Add a Cash on Delivery Fee in WooCommerce

October 25, 2026,
How to Add a Cash on Delivery Fee in WooCommerce

WooCommerce doesn't include a cash on delivery fee setting. To add one, use a plugin that charges a fee when the customer selects cash on delivery, or add a short code snippet that applies the fee at checkout. A small COD fee discourages fake orders, covers part of the cost of refused parcels, and nudges real customers towards prepaid payment.

This guide covers both setup methods, how much to charge, who to exempt, and how to tell whether the fee is working.

Why Charge a COD Fee?

Cash on delivery costs you more than a prepaid order, even when the parcel is accepted. Couriers often charge a COD collection fee, the money takes longer to reach your account, and every refused parcel costs shipping in both directions. A COD fee helps in three ways:

  • It puts off fake orders. Someone placing a prank order is less likely to bother when it carries a fee.
  • It covers part of your cost. The fee offsets courier COD charges and some of the loss from refused parcels.
  • It moves customers to prepaid. A customer who sees a small saving for paying online often switches, and prepaid orders are never refused at the door.

Method 1: Add a COD Fee With a Plugin

Blacklist and Block Customers and Orders includes an optional cash on delivery fee as part of its COD protection, alongside the other tools that cut refused deliveries.

  1. Install and activate the plugin.
  2. Open its cash on delivery protection settings and enable the COD fee.
  3. Enter the fee amount and a clear label, such as "Cash on delivery fee".
  4. Save, then test: add a product to the cart, go to checkout and select cash on delivery. The fee should appear in the order totals, and disappear when you switch to another payment method.

Because the fee sits next to the plugin's other COD tools, you can combine it with stronger measures for the riskiest orders, such as hiding COD for guests on high-value orders or asking first-time buyers to verify their email.

Method 2: Add a COD Fee With Code

If you prefer code, this snippet adds a flat fee when cash on delivery is selected. Add it to a child theme's functions.php file or a code snippets plugin, and test it on a staging site first.

add_action( 'woocommerce_cart_calculate_fees', function ( $cart ) {
    if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
        return;
    }

    $chosen = WC()->session ? WC()->session->get( 'chosen_payment_method' ) : '';
    if ( 'cod' !== $chosen ) {
        return;
    }

    // Skip the fee for logged-in customers with at least 2 previous orders.
    if ( is_user_logged_in() && wc_get_customer_order_count( get_current_user_id() ) >= 2 ) {
        return;
    }

    $fee    = 100;  // Fee amount in your store currency.
    $taxable = true; // Set to false if the fee should not be taxed.

    $cart->add_fee( 'Cash on delivery fee', $fee, $taxable );
} );

// Refresh the classic checkout totals when the payment method changes.
add_action( 'wp_footer', function () {
    if ( ! is_checkout() ) {
        return;
    }
    ?>
    <script>
    jQuery( function ( $ ) {
        $( 'form.checkout' ).on( 'change', 'input[name="payment_method"]', function () {
            $( document.body ).trigger( 'update_checkout' );
        } );
    } );
    </script>
    <?php
} );

A few things to know about the code route:

  • The refresh script is written for the classic shortcode checkout. The newer block-based checkout handles totals differently, so test carefully if you use it.
  • Every new condition, such as a percentage fee or exempting certain areas, means more code to write and maintain after WooCommerce updates.
  • If you are not comfortable editing code, the plugin route is safer.

How Much Should You Charge?

There is no single right number, but these guidelines work for most stores:

  • Keep it small compared to the basket. The fee should feel like a reason to pay online, not a reason to leave. A fee that is a few percent of your average order is a common starting point.
  • Base it on your real cost. Look at what your courier charges for COD collection and what refused parcels cost you per order, then set the fee to cover part of it.
  • Flat or percentage? A flat fee is easy to understand and suits stores with similar order values. A percentage fee scales better if your baskets vary a lot.
  • Make the saving visible. Customers respond better to "Save Rs 100 when you pay online" than to a fee they only see at the last step.

Who Should Pay the Fee?

Charging everyone the same fee is simple, but it can annoy loyal customers who have never refused a parcel. Consider exempting:

  • Returning customers with several completed orders, as in the code example above.
  • Wholesale or trade accounts, who may be on agreed payment terms.
  • Orders above a certain value, if you want to keep COD attractive for larger baskets you are confident about.

For customers at the other end of the scale, such as guests on high-value orders or anyone who has refused a parcel before, a fee alone may not be enough. Our guide on disabling cash on delivery for risky customers shows how to remove COD for them entirely.

Be Clear About the Fee

  • Label it plainly in the checkout totals, for example "Cash on delivery fee".
  • Mention it early. Add a line to your product pages, shipping policy or FAQ, so the fee isn't a surprise at checkout.
  • Check local rules. Some countries have rules on charging extra for a payment method. Check what applies to your store before you add the fee.
  • Decide on tax. WooCommerce fees can be taxable or not. Ask your accountant how a COD fee should be treated where you sell.

Is the Fee Working?

Compare these numbers for the month before and the month after adding the fee:

Number What you want to see
Refusal rate (refused COD orders divided by all COD orders) Going down
Share of prepaid orders Going up
Total orders Roughly the same
Checkout abandonment No big jump

If total orders drop sharply, the fee is too high or not explained well. Lower it, or add the "save when you pay online" message. For the full picture of what refused parcels cost, see how to reduce fake COD orders and refused deliveries.

Frequently Asked Questions

Can I add a cash on delivery fee in WooCommerce without a plugin?

Yes, with a code snippet that adds a fee when cash on delivery is selected. WooCommerce has no built-in setting for it, so either code or a plugin is needed.

Will a COD fee reduce my sales?

A small, clearly explained fee usually moves some customers to prepaid rather than losing them. Watch your total orders for the first few weeks and lower the fee if they drop.

Should the COD fee be a fixed amount or a percentage?

A fixed fee is simpler and suits stores with similar order values. A percentage fee suits stores where order values vary a lot.

Can I exempt loyal customers from the COD fee?

Yes. With code, you can skip the fee for logged-in customers with a set number of previous orders. Many stores also exempt wholesale accounts.

Is a COD fee enough to stop fake orders?

It reduces them, but it won't stop a determined bad actor. Combine it with hiding COD for risky orders, verifying first-time buyers and blocking customers who refuse parcels.

Make COD Pay for Itself

A COD fee is one of the simplest ways to cut fake orders and move customers to prepaid. It works best alongside the rest of your COD protection. Blacklist and Block Customers and Orders gives you the fee, COD restrictions for risky orders, email verification and refused delivery tracking in one plugin.