
WooCommerce restrict COD regulated products: A Quick Guide
Discover how to WooCommerce restrict COD regulated products with practical plugins, snippets, and best practices for compliance and risk reduction.
Cody Y.
Updated on Nov 22, 2025
If you're selling regulated products on WooCommerce, you need a reliable way to restrict Cash-on-Delivery (COD). The best approach is using a dedicated plugin to create rules that block this payment method for specific items, categories, or even entire locations. This isn't just a suggestion—it's an essential step for compliance, fraud prevention, and keeping your logistics from spiraling into chaos. Ignoring this exposes your business to serious financial and legal risks.
Why You Must Restrict COD on Regulated Products

Allowing COD for every product in your WooCommerce store might seem like a good, customer-friendly policy, but it's a dangerous blind spot when you're dealing with regulated goods. Products like pharmaceuticals, alcohol, certain electronics, or chemicals come with a mountain of legal requirements that make COD an unsuitable—and often illegal—payment option.
The fundamental problem is that a COD transaction completes after the product is in the customer's hands. This completely bypasses the critical verification steps that must happen before an order is fulfilled. Imagine shipping a prescription medication. The law almost always requires payment and identity verification before the item leaves your facility. A COD order flips that entire process on its head, creating an instant compliance breach.
The Financial and Logistical Dangers
Beyond the obvious legal issues, offering unrestricted COD opens the floodgates to major operational headaches. Failed deliveries are far more common, since customers can simply refuse the package at their doorstep with no skin in the game. You're left holding the bag for wasted shipping fees, return processing costs, and a product that's been tied up for days or weeks.
Fraudulent orders also skyrocket. It costs a scammer nothing to place a fake COD order, which ties up your valuable stock and wastes your team's time. For high-value regulated items, this risk is amplified tenfold. By blocking COD, you ensure every order is backed by a real financial commitment, which dramatically cuts down on impulse refusals and malicious orders.
Navigating Global Payment Trends and Regulations
COD's popularity varies wildly from one country to another. In many emerging markets, it can account for a staggering 30-40% of all eCommerce orders. The catch is that these same regions often have the strictest laws prohibiting after-sale payments for regulated goods.
This creates a tricky situation for merchants. You need to be flexible enough to offer COD where it's expected but smart enough to block it where it's illegal. Modern tools that conditionally disable COD based on the product category are no longer a "nice-to-have"—they're a must-have for global compliance. You can learn more about how WooCommerce’s features help manage diverse payment scenarios to stay ahead.
The decision to restrict COD is rarely simple, which is why it's helpful to see the risks and benefits laid out side-by-side.
Risks of Allowing COD vs Benefits of Restriction
| Risk Area | Impact of Unrestricted COD | Benefit of Restriction |
|---|---|---|
| Legal & Compliance | Potential for severe fines, license revocation, and legal action for violating sales regulations. | Ensures all transactions meet pre-payment and verification requirements, maintaining full compliance. |
| Financial Loss | High rates of refused deliveries lead to wasted two-way shipping costs and lost revenue. | Drastically reduces order refusals and eliminates costs associated with failed COD deliveries. |
| Fraud & Abuse | Easy target for fake orders that tie up inventory and waste fulfillment resources. | Pre-payment acts as a powerful deterrent against fraudulent or malicious orders. |
| Operational Efficiency | Complex logistics for managing cash collection, reconciliation, and high return volumes. | Simplifies the entire fulfillment process, from payment confirmation to final delivery. |
| Inventory Management | Products are tied up in transit for non-committed orders, leading to inaccurate stock levels. | Inventory is only allocated to confirmed, paid orders, leading to more accurate stock management. |
Ultimately, a smart restriction strategy turns a major liability into a source of operational strength.
Key Takeaway: The decision to restrict COD for regulated products isn't just about good business practice—it's a non-negotiable step to protect your store from legal penalties, financial losses, and logistical nightmares. It's about building a sustainable, compliant, and secure eCommerce operation.
When you proactively set up rules to WooCommerce restrict COD regulated products, you aren't just following the law. You're fortifying your revenue streams and operational efficiency, allowing your business to grow without the constant threat of a costly compliance mistake or logistical failure.
Using a Plugin for Granular COD Restrictions
While WooCommerce offers a basic on/off switch for payment methods, it just doesn't cut it when you need to get specific about who can use Cash on Delivery. Trying to hack together a solution with custom code for regulated products is a maintenance nightmare and a huge compliance risk. This is where a specialized plugin stops being a simple add-on and becomes a core part of your compliance toolkit.
A dedicated tool changes the entire game. Instead of a blunt instrument, you get the power to build smart, conditional rules. This is the secret to properly managing WooCommerce restrict COD regulated products without accidentally blocking legitimate sales of your other items. The right plugin takes a tangled legal requirement and turns it into a smooth, automated process that just works.
When you invest in a dedicated plugin, you're not just buying another feature; you're building a compliance strategy. It's the difference between a manual, error-prone workaround and a reliable, automated system that protects your business 24/7.
What to Look for in a Restriction Plugin
When you're shopping for a solution, the key is granularity. You need a tool that lets you stack multiple conditions together to create a precise rule. For instance, you might need to block COD for products in the "Vape Supplies" category, but only for customers in specific states like Utah or Massachusetts.
Make sure any plugin you consider has these critical features:
- Product-Based Rules: The ability to zero in on restrictions by product category, tag, shipping class, or even individual product IDs.
- Location-Based Conditions: Granular control to set rules for entire countries, specific states, counties, cities, or even a list of individual ZIP codes.
- Cart-Level Logic: The power to disable COD if any regulated item is in a mixed cart, which is essential for closing compliance loopholes.
These capabilities are the building blocks of a flexible and truly airtight restriction system. For a deeper look at the different tools out there, check out this comparison of the best shipping restriction plugins for WooCommerce to see how they stack up.
Beyond Just Blocking the Option
A truly powerful plugin does more than just hide the COD option at checkout. It improves the customer experience by telling them why it’s unavailable. Instead of leaving shoppers confused and ready to abandon their cart, you can show them a custom message that clearly explains the situation.
Imagine a customer trying to buy a regulated chemical. The plugin can instantly display a message like, "Due to state regulations, Cash on Delivery is not available for this item. Please select another payment method to complete your order." This kind of simple, upfront communication turns a potential frustration into a moment of trust. It reduces cart abandonment, cuts down on support tickets, and shows you're a professional operation. This is a level of control that's simply impossible to get with WooCommerce's standard settings.
How to Create Your First COD Restriction Rule
Alright, let's move from theory to practice. Setting up your first rule is surprisingly straightforward, and it’s the quickest way to get a handle on your store's compliance. We'll walk through a common, real-world scenario to show you exactly how it’s done—no generic steps, just practical logic.
Imagine you sell craft spirits online and need to block Cash on Delivery for customers in California due to state shipping laws. This is a perfect example of a rule that combines a product condition with a location condition, a core function you'll need to properly restrict COD for regulated products in WooCommerce.
You're essentially layering different conditions—what's in the cart, where it's going, and which shipping or payment methods are available—to build a smart, automated check.

As you can see, a powerful rule is built by stacking these conditions together.
Defining the Rule’s Logic and Scope
Inside a tool like Ship Restrict, your first move is to create a new rule and give it a name you'll understand later. Something like "Block COD - Alcohol - California" is perfect. Trust me, when you have dozens of rules, being specific from the start is a lifesaver.
Next, you need to tell the system what you're actually restricting. In this case, you’ll select the "Cash on Delivery" payment gateway from your list of options. Now the plugin knows what to hide, but it doesn't know when to hide it.
The "when" is where your conditions come in. For this scenario, we'll set two main ones:
- Product Condition: You'll set a condition where the ‘Product Category’ contains ‘Alcohol.’ This tells the system to fire the rule anytime an item from that category is in the cart.
- Location Condition: Then, you’ll add another condition where the ‘State’ is ‘California.’ This makes sure the rule only applies to shoppers with a California shipping address.
Most plugins give you a ton of flexibility here. If you're curious about all the different ways you can slice and dice your rules, you can explore the various restriction types available in Ship Restrict.
Crafting the Customer-Facing Message
Simply making the COD option disappear isn’t enough; you need to explain why. A good restriction plugin will let you write a custom message that pops up when the rule is triggered.
Pro Tip: Your message should be helpful, not just a dead end. Instead of a blunt "COD is not allowed," try something more transparent: "Due to state regulations for alcohol shipments, Cash on Delivery is unavailable for orders shipping to California. Please choose another payment method to continue."
This small touch turns a potential point of friction into a moment of clear, professional communication. It helps cut down on abandoned carts and builds trust with your customers.
With over 4.6 million active stores, the WooCommerce ecosystem relies heavily on this kind of conditional logic to navigate complex regulations. Many sellers use flexible shipping classes and payment gateways to disable COD for regulated items. For instance, a product tagged with a 'regulated' shipping class can be configured to automatically hide the COD payment option at checkout, guiding customers toward secure online payments like credit cards. This setup not only ensures legal compliance but also helps reduce order fraud, a significant concern with COD transactions that lack upfront verification.
Once you save the rule, that’s it. You’ve created an automated compliance check that protects your business without any ongoing manual work.
Advanced Strategies for Complex Store Setups
Basic rules are a great starting point, but let's be honest—most store inventories aren't that simple. You’re likely selling a mix of products, some regulated and some not, which creates checkout scenarios a single, simple rule can't handle. This is where you need to think a bit more strategically to build a truly airtight system to restrict COD for regulated products in WooCommerce.
The goal here is to move beyond simple one-to-one restrictions. We need to create layered logic that adapts to whatever combination of items a customer puts in their cart, no matter where they are. This is how you close compliance gaps without turning away customers who just want to buy a t-shirt.
Handling the Headache of Mixed Carts
One of the most common headaches I see store owners face is the "mixed cart." That's when a single order contains both a regulated item (like a vape pen) and a non-regulated item (like a bottle of e-liquid with no nicotine). If your rule is too simple, it might not trigger correctly, or worse, only block COD for one of the items.
The only way to handle this properly is to configure your restriction rule to apply to the entire cart the moment a regulated product is added. Good plugins like Ship Restrict have a specific setting for this. You want the logic to be crystal clear: "If the cart contains any product from Category X, then disable Cash on Delivery for the whole order." This is non-negotiable for compliance. It completely shuts down any attempt by a customer to sneak a regulated product through by adding a cheap, unrestricted item to their order.
Expert Insight: I always tell clients to think of it as a "one-drop" policy. If even one drop of a regulated product lands in the cart, the entire order gets treated with the necessary restrictions. Framing it that way helps ensure there are no loopholes in your setup.
This kind of detailed control is becoming standard as eCommerce platforms adapt to complex global laws. Advanced order management, especially for COD, is crucial in places like the European Union and North America, where local statutes often forbid COD for certain goods. WooCommerce’s flexibility is a huge asset here, letting you build out rules by country or state to navigate these laws effectively. You can learn more about how WooCommerce is adapting to global eCommerce trends and why tools like this are so important.
Layering Multiple Conditions for Surgical Precision
Once you've mastered mixed carts, you can start stacking multiple conditions to create incredibly specific rules that go beyond compliance and into proactive fraud prevention.
Imagine you've noticed a pattern of high-value COD orders being refused upon delivery, and they're all coming from a handful of specific ZIP codes in an otherwise safe state. Blocking COD for the entire state would cost you legitimate sales. Instead, you can build a hyper-targeted rule.
Here’s how you'd layer that logic:
- Payment Method: Restrict "Cash on Delivery."
- Cart Condition: Only apply this rule when the "Cart Total" is greater than $250.
- Location Condition: And only when the "ZIP Code" is one of a specific list (e.g., 90210, 10001, 60601).
A rule like this only fires when all three conditions are met—a high-value order going to a known high-risk area. Everyone else can still choose COD. It's a surgical approach that slashes risk without creating unnecessary friction for your good customers. By combining product rules, cart values, and precise location data, you build a smart, responsive system that truly protects your bottom line.
A Code-Based Alternative for Developers
If you're comfortable with code and prefer to keep your plugin list lean, you can restrict Cash on Delivery directly. This route involves adding a custom PHP snippet to your theme's functions.php file, giving you direct, programmatic control over which payment gateways appear at checkout.
But let's be clear: this method has some serious trade-offs. It's far less flexible than a dedicated plugin. You'll have to hard-code product categories or shipping classes, and maintenance can quickly become a headache. Every time you adjust your product lineup or need to change a rule, you’re back to editing code.
For developers looking to go this route, it's a bit like other projects where you want to add features in WordPress without plugins—it offers granular control at the cost of simplicity and scalability.
The Critical First Steps
Before you even think about touching a line of code, there are two steps you absolutely cannot skip.
First, always use a child theme. If you drop this code into your main theme's functions.php file, it will be completely erased the next time your theme gets an update. All your work, gone in an instant.
Second, back up your entire site. A single misplaced semicolon or typo in your PHP code can take your whole website offline, leading to the dreaded "white screen of death." A recent backup is your only safety net to get your store back online quickly if something goes sideways.
A Practical Code Snippet Example
Here’s a basic PHP function that hides the COD payment option if a product from a specific category is in the cart. This is the kind of code you'd place in your child theme's functions.php file.
add_filter( 'woocommerce_available_payment_gateways', 'disable_cod_for_regulated_category' );
function disable_cod_for_regulated_category( $available_gateways ) { if ( is_admin() ) return $available_gateways;
if ( isset( $available_gateways['cod'] ) ) {
$regulated_category_slug = 'alcohol'; // Define your regulated category slug here
$is_regulated_item_in_cart = false;
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
if ( has_term( $regulated_category_slug, 'product_cat', $cart_item['product_id'] ) ) {
$is_regulated_item_in_cart = true;
break;
}
}
if ( $is_regulated_item_in_cart ) {
unset( $available_gateways['cod'] );
}
}
return $available_gateways;
}
A Word of Caution: Think of this code as a starting point, not a complete solution. It can't handle complex scenarios like location-based rules (state, county, ZIP), nor does it provide any clear messages to your customers explaining why COD disappeared. For most store owners, the reliability, user-friendly interface, and dedicated support of a plugin make it a much safer and more scalable way to WooCommerce restrict COD regulated products.
Testing Your Rules and Communicating with Customers

Creating your restriction rules is only half the battle. Now you need to make sure they work flawlessly in every possible scenario without frustrating legitimate customers. It’s a delicate balance.
A poorly tested rule can go wrong in two ways: it either fails to block a restricted order—exposing you to risk—or it blocks a perfectly valid one, costing you a sale. That's why thorough testing isn't just a "nice-to-have." It's a non-negotiable step to WooCommerce restrict COD regulated products correctly.
A Simple Testing Checklist
Before flipping the switch, you need to kick the tires. Running through a few core scenarios will catch most issues before they ever affect a real customer.
Our official Ship Restrict testing guide offers a more detailed framework, but here are the absolute must-do checks:
- Regulated Product Test: Add a single regulated item to your cart. Enter an address in a state or ZIP code where COD should be blocked. Does the COD option disappear? It should.
- Mixed Cart Test: Now, add both a regulated and a non-regulated item to the cart. Test the same restricted address. The COD option should still be hidden for the entire order.
- Location Test: Empty the cart and add only a non-regulated product. Test addresses both inside and outside your restricted zones. You should see COD appear and disappear correctly based on the location.
Crafting Clear Customer Communication
How you explain these restrictions is just as important as the rules themselves. If the COD option suddenly vanishes without a word, you’re practically begging for cart abandonment. People get confused, then they leave.
Your goal here is transparency. A simple, clear message can turn a moment of friction into a positive interaction that actually builds trust. Don't leave your customers guessing.
Instead of a vague, unhelpful message like "Payment method not available," be specific. Try something like this: "Due to state regulations, Cash on Delivery is not available for items in your cart. Please select an alternative payment method to proceed."
This small change does a lot of work. It tells the customer why the option is gone, reassuring them it's a legal requirement, not just some arbitrary store policy.
Once your rules are live, the job isn't quite done. It's a great idea to gather effective customer feedback to make sure the experience is as smooth as you think it is.
Got Questions About Restricting COD?
As you start setting up rules to restrict Cash-on-Delivery for regulated products, a few practical questions almost always come up. Let's get right to the most common ones we hear from store owners.
Can I Just Block COD for One Specific Product?
Yes, you absolutely can. Any good restriction plugin will let you zero in on individual products.
When you're building your rule, instead of selecting an entire product category, you'll want to find the condition for a specific 'Product'. From there, just pop in the Product ID for the item you need to restrict. It’s a straightforward way to handle one-off items without affecting your whole catalog.
What Happens if a Cart Mixes Regulated and Regular Items?
This is a critical scenario, and how you configure your rule here makes all the difference.
The best practice is to set the rule to trigger if any regulated product is in the cart. This disables COD for the entire order, not just the single item. It’s the only way to ensure compliance and prevent clever customers from adding a cheap, unregulated item just to bypass the restriction.
Key Takeaway: Always configure your rules to apply to the entire cart if a single regulated item is present. This closes a common compliance loophole and is by far the most secure approach.
And don't worry about site speed. A well-coded plugin has a tiny footprint and runs its checks during checkout without slowing anything down.
Stop wasting time on manual compliance checks and eliminate costly shipping errors. Ship Restrict automates your rules, giving you the peace of mind to focus on growing your business.
Get started with Ship Restrict today

Cody Yurk
Founder and Lead Developer of ShipRestrict, helping e-commerce businesses navigate complex shipping regulations for regulated products. Ecommerce store owner turned developer.