How to disable/hide all payment gateways in WooCommerce


WooCommerce is an eCommerce WordPress plugin used to set up an online shop in your WordPress website. WooCommerce is very flexible and user-friendly as you can easily customize its functionality using its hooks and its templates by overriding options in your theme.

Why disable all payment gateways in WooCommerce?

If you have long-term customers who place an order on regular basis like weekly and pay later at the end of the week, fortnight, or even a month. Sometimes you want to schedule an order delivery on different dates. Where the sales department manages all the invoices and delivery schedules, and this can definitely make things easier for the customers to place an order.

Recently we created an online store for one of our clients who scheduled orders delivery on selected days that is managed in the backend system. So, when the customers visited the store, they placed orders without doing online payments.

Woocommerce hook to disable payment gateways

If you want to set up a Woo store for goods delivery where the shop owner wants to take orders manually and deliver later by sending an invoice to the customer; in other words, he doesn’t need online payment functionality. You need to disable or hide payment gateways.

Here is the code snippet written below that you need to copy and then paste into your theme’s functions.php file.

// Disable all payment gateways on the checkout page
add_filter( 'woocommerce_cart_needs_payment', '__return_false' );

After placing this snippet all payment gateways will be disabled and customers will be able to place orders and go to the thankyou page directly to see order details.

We are WordPress WooCommerce experts. We did a lot of work in WooCommerce like WooCommerce-ready theme design, Shop setup, customization, and plugin development. You can discuss your Woocommerce requirements with us.