skip to Main Content

Search WordPress Code Snippets – Quick Solutions for Developers


How to Remove Specific Payment Gateways in WooCommerce

This snippet helps you tailor the payment options available to customers, enhancing the checkout experience.

add_filter('woocommerce_available_payment_gateways', 'remove_specific_gateways');
function remove_specific_gateways($available_gateways) {
    if (is_cart() && !is_user_logged_in()) {
        unset($available_gateways['cheque']); // Remove Cheque Payment
    }
    return $available_gateways;
}


I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

Back To Top