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.

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.

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:

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.