Is it possible to filter available payment methods to certain user roles just using the WooCommerce configuration? Without adding anything to any template file I mean. What I want to achieve is to give the possibility to pay with credit card only to certain users.


It is not possible by WooCommerce default configuration.

You have to install below plugin.


or programmatically, you can refer below link.



You can use following:

  add_filter('woocommerce_available_payment_gateways', 'filter_gateways', 1);
  function filter_gateways($gateways)
      $current_user = wp_get_current_user();
      $role = $current_user->roles;
      global $woocommerce;
      /* add your user role in condition and payment method which you need to unset*/
      if ($role[0] == 'administrator') {
      return $gateways;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.