You can show or hide payment methods in WooCommerce in three ways: the limited built-in gateway settings, a code snippet using the woocommerce_available_payment_gateways filter, or a conditional payments plugin that lets you build rules based on the cart, the customer and the shipping method. For most stores, a rule-based plugin is the safest option because it works without code and, if chosen well, on both classic and block checkout.
Softwix builds and maintains WooCommerce stores for merchants in Bangladesh, the UK, the US and Europe, and we develop our own free plugin for this job, Beep Conditional Payments. This guide covers every method fairly, including when you do not need a plugin at all. You can see all our WooCommerce tools on the Softwix products page.
Conditional payment methods at a glance
| Method | What it can do | Best for | Limitations |
|---|---|---|---|
| WooCommerce settings | Enable or disable gateways globally; limit cash on delivery by shipping method and virtual orders | Simple stores with one or two rules | No conditions based on cart value, product, role or location |
| Code snippet | Remove gateways from the list under any condition you can code | Developers with one fixed rule | Needs maintenance; developers report issues on block checkout |
| Conditional payments plugin | Show, hide or reorder gateways using rules for products, cart totals, customers, addresses, shipping and more | Most stores, especially with several rules | One more plugin to keep updated |
What are conditional payment methods in WooCommerce?
Conditional payment methods are payment gateways that appear or disappear at checkout depending on rules you set. Instead of every customer seeing every gateway, each customer sees the options that make sense for their order.
A rule usually has three parts: which gateway it affects, what happens (show, hide or move it up or down the list) and the conditions that trigger it. For example: “Hide cash on delivery when the cart total is above 20,000 BDT.”
The gateways themselves do not change. You are only controlling which ones a particular customer is offered.
Why would you hide a payment method at checkout?
Store owners hide payment methods to reduce risk, cut fees and make checkout simpler. The most common reasons are below.
- Reduce cash on delivery risk. Hide COD on high-value carts, where a refused delivery costs the most.
- Match the product. COD makes no sense for digital downloads or software licences, and some gateways do not allow certain product types.
- Serve wholesale or trade customers. Offer bank transfer or invoice payment only to logged-in users with a wholesale role.
- Control gateway fees. Hide a high-fee gateway on small orders where its fee would eat the margin.
- Show local options to local customers. Offer bKash, Nagad or SSLCommerz to customers with a Bangladesh address and card or PayPal options to international buyers.
- Simplify checkout. Fewer irrelevant options means fewer decisions at the moment of payment.
If you sell in Bangladesh, our guide to the best WooCommerce payment gateways in Bangladesh explains which gateways to set up in the first place.
Can WooCommerce show or hide payment methods without a plugin?
Only in a limited way. WooCommerce lets you enable or disable each gateway for all customers under WooCommerce > Settings > Payments, and the built-in cash on delivery gateway has two conditional settings of its own.
According to WooCommerce’s cash on delivery documentation, COD includes an “Enable for shipping methods” setting, which limits COD to the shipping methods you choose, and an “Accept for virtual orders” checkbox for orders containing only virtual products.
These settings cover two common needs, such as offering COD only with your own delivery service. They cannot hide a gateway based on cart value, product category, customer role or country, and most third-party gateways have no conditional settings at all.
How do you hide a payment method with code?
Developers can use the woocommerce_available_payment_gateways filter to remove gateways from the list before it is shown. The example below hides cash on delivery when the cart total exceeds 20,000 in the store currency.
add_filter( 'woocommerce_available_payment_gateways', function ( $gateways ) {
if ( is_admin() || ! WC()->cart ) {
return $gateways;
}
if ( WC()->cart->get_total( 'edit' ) > 20000 ) {
unset( $gateways['cod'] );
}
return $gateways;
} );
Add snippets through a child theme or a code snippets plugin, never by editing a parent theme or plugin file directly, and test on a staging copy first.
What are the drawbacks of the code approach?
Code works for one fixed rule, but it becomes hard to manage as rules multiply, and every change needs a developer. There is also a compatibility question with the block checkout.
WooCommerce notes in its guide to customising cart and checkout that the Cart and Checkout blocks have been the default for new stores since version 8.3 (November 2023), and that extensions relying on hooks often need extra integration work to support them. On Business Bloomer’s tutorial on disabling gateways by product type, a 2025 reader comment reports that a gateway removed with this filter reappeared on the block checkout after the customer changed form fields. If your store uses the block checkout, test any snippet thoroughly or use a plugin built for it.
How do you set up conditional payment rules with a plugin?
A conditional payments plugin gives you a rule builder in the dashboard, so you can create, test and change rules without code. The steps below use our free Beep Conditional Payments plugin on WordPress.org, but the process is similar in most tools.
- List your rules first. Write down each rule in plain words: which gateway, show or hide, and when.
- Install and activate the plugin from Plugins > Add New by searching for its name.
- Create a ruleset. Choose the gateway or gateways it applies to and the action: enable, disable or reorder.
- Add conditions. Combine them with AND/OR logic, for example “cart total is more than 20,000 AND shipping method is courier”.
- Save and test as a guest, as a logged-in customer and as each special role you use.
- Export your rulesets as a backup, or to copy them to a staging or second store.
What conditions can you use?
The free version of Beep Conditional Payments supports these conditions:
- Products, variations, categories and tags in the cart
- Cart total and subtotal, with minimum and maximum values
- Number of items in the cart
- Billing and shipping address fields
- Selected shipping method
- Applied coupons
- Logged-in or guest status, and user roles
It works with both the classic and block checkout, and rulesets can be exported, imported and duplicated.
What are some practical conditional payment rules?
Most stores need only a handful of rules. These examples cover common situations.
| Goal | Gateway | Action | Condition |
|---|---|---|---|
| Limit COD risk on expensive orders | Cash on delivery | Hide | Cart total above your chosen limit |
| No COD for digital products | Cash on delivery | Hide | Cart contains products in a “Software” or “Downloads” category |
| Trade payment terms | Bank transfer | Show only | User role is “wholesale” |
| Local wallets for local buyers | Mobile wallet gateway | Show only | Billing country is Bangladesh |
| Avoid high fees on small orders | High-fee gateway | Hide | Cart subtotal below a minimum |
| COD only with your own riders | Cash on delivery | Show only | Shipping method is local delivery |
| Promote a preferred gateway | Lowest-fee gateway | Move to top | All orders |
| Protect coupon promotions | Cash on delivery | Hide | A specific coupon is applied |
What does Beep Conditional Payments Pro add?
The Pro version is for stores that need more advanced rules or fees. Pro adds:
- Payment gateway fees at checkout
- SKU, stock, brand and weight conditions
- Customer purchase history
- Date and holiday scheduling
- GeoIP rules and shipping zones
- Subscriptions and multi-currency support
- WPML and Polylang compatibility
Most stores can start with the free version and upgrade only if a rule they need is Pro-only. For Pro details, get in touch through our contact page.
What are the alternatives?
Other free plugins cover similar ground. For example, Conditional Payments for WooCommerce by WP Trio offers product, subtotal, shipping method and address conditions in its free version, and its changelog notes improved block checkout compatibility. Compare the conditions each tool offers against your rule list, check how recently it was updated and confirm block checkout support before choosing.
How do you test conditional payment rules?
Test every rule from the customer’s side before going live. A rule that looks right in the dashboard can behave differently at checkout.
- Use a private browser window to test as a guest.
- Create test accounts for each user role you target.
- Change the cart value above and below each threshold.
- Switch shipping methods and billing countries during checkout and watch the gateway list update.
- Test on mobile as well as desktop.
- Place a real low-value order with each remaining gateway.
- Clear or exclude cart and checkout pages from page caching so customers never see a cached gateway list.
Run these tests on a staging site where possible, and keep backups before installing new plugins, as covered in our WordPress security checklist.
What mistakes should you avoid?
The main risk is leaving a customer with no way to pay. Check that every combination of conditions leaves at least one gateway available.
- Conflicting rules. One rule shows a gateway while another hides it. Keep rules few and clearly named.
- Silent changes. If you hide COD above a certain value, say so on product or cart pages to avoid surprise and abandoned checkouts.
- Too many gateways. Conditional rules work best on a short list. Remove gateways nobody uses.
- Forgetting new products. Category-based rules need new products in the right categories.
- Running two rule plugins. Two tools editing the same gateway list can produce unpredictable results.
Frequently asked questions
How do I hide cash on delivery for certain products in WooCommerce?
WooCommerce has no built-in product-level setting for this. Use a conditional payments plugin and create a rule that hides cash on delivery when the cart contains specific products or categories. Developers can also use the woocommerce_available_payment_gateways filter, but should test it on the block checkout.
Can I show a payment method only to logged-in users?
Yes. A conditional payments plugin can show or hide a gateway based on logged-in status or user role. This is commonly used to offer bank transfer or invoice payment only to approved wholesale customers.
Do conditional payment plugins work with the WooCommerce block checkout?
Some do and some do not, so check before installing. Beep Conditional Payments supports both classic and block checkout. For any plugin, look for block checkout compatibility in its description or changelog and test the rules yourself.
Can I change the order of payment methods at checkout?
You can set a default order in the WooCommerce payment settings for all customers. To reorder gateways based on conditions, for example putting a local wallet first for local buyers, you need a plugin that supports reordering, such as Beep Conditional Payments.
Will hiding payment methods slow down my checkout?
A well-built rule plugin adds very little load, because it only evaluates your rules when the checkout updates. Keep the number of rules reasonable and avoid running several plugins that do the same job. If checkout feels slow, check caching, hosting and other plugins first.
Next steps
Write down the two or three payment rules your store needs, then decide whether WooCommerce’s built-in settings cover them. If they do not, install a rule-based plugin and test each rule from the customer’s side before you go live.
Beep Conditional Payments is free to download and works with classic and block checkout. Explore it and our other WooCommerce plugins on the Softwix products page, or ask our WordPress development team to set up your payment rules for you.
