How to disable all payment methods in WooCommerce

How to disable all payment methods in WooCommerce

You will have the need to disable all payment gateways on the site, but just disabling them in WooCommerce > Settings > Payments will not work because then the customers will get an error message since there are no payment methods available.

We’re going to be using a different method here. The way to go is to add just a single line code to the functions.php file within your theme folder.

Here’s the code:

<?php // Do not include this if already open! Code goes in theme functions.php.

add_filter( 'woocommerce_cart_needs_payment', '__return_false' );

The checkout page will now display only a Place Order button.

Was this article helpful?
YesNo

Leave a comment

Your email address will not be published. Required fields are marked *