Blog

Remove Default WooCommerce Payment Gateways

By default, WooCommerce 2.2.8 ships with five payment gateways:

  • BACS (Bank Transfer/Wire)
  • Pay by Check (or Cheque)
  • Cash on Delivery
  • PayPal
  • Simplify Commerce

If you want to have only one payment gateway available on the Checkout page, the unused payment gateways can be disabled in the admin settings.

WooCommerce Disabled Payment Gateway

This will hide the payment gateway from the customer on the Checkout page, but what if you want to hide the payment gateway from your client who has access to the WordPress dashboard?

Remove Default WooCommerce Payment Gateways

The first thing to know about payment gateways in WooCommerce is that they are handled by the WC_Payment_Gateways class. In the init() method of this class an array named $load_gateways is populated with class names corresponding to the payment gateways to be loaded.

Then the filter ‘woocommerce_payment_gateways’ is used so that 3rd party gateways can register themselves as a gateway.

This same filter can be used with a higher (later) priority to remove unwanted gateways. The following gist shows a function filtering the gateway array and removing any class names that are in a $remove_gateway array.

The array can be expanded or reduced based on the gateways you want removed.

Now the admin dashboard will only display the desired payment gateways.

woocommerce-payment-gateways-removed

Remove WooThemes Helper Plugin Nag

While testing the previous gist, I used the WooCommerce Stripe plugin and I noticed an admin message that can’t be dismissed:

Remove WooThemes Helper Plugin Nag

WooThemes plugins come with functionalty to check for the presence of the WooThemes Helper plugin. It will ask you to install it, if not already installed and activate it if it is inactive.

Unfortunately, this nag can’t be dismissed. If you’d rather manage your plugin licenses and versions manually, you can use the following gist to remove the unsightly message and make your Dashboard neat and tidy.

Get our best WooCommerce advice!

Delivered directly to your inbox

Your email is 100% private. I hate spam too. Powered by ConvertKit

Daniel Espinoza

Daniel has been building ecommerce plugins and sites since 2007. He built the first commercial plugin for WooCommerce in 2011 and has built dozens of plugins and sites since.

Follow Daniel on Twitter