Restricting PayPal Commerce to the PayPal Button Only

Are you a non-profit using WPForms with PayPal Commerce and want to accept payments through the PayPal button only? By default, PayPal Commerce enables several alternative funding sources such as Apple Pay, Google Pay, Venmo, Pay Later, and regional methods like iDEAL and Bancontact. Non-profit accounts that qualify for PayPal’s discounted rate often need to restrict checkout to the PayPal button to retain that rate.

This tutorial will show you how to disable all alternative payment methods in PayPal Commerce using a custom code snippet, leaving only the PayPal button active.


This snippet is compatible with WPForms 1.10.0 and above.

Because of the order in which WPForms loads the Apple Pay and Google Pay components, this snippet will not work correctly if added to your theme’s functions.php file. It must be added as a must-use plugin or through the WPCode plugin, both of which load early enough for the filters to take effect.

Adding the Snippet

Once you’ve set up your must-use plugin or installed WPCode, go ahead and add the following snippet to your site.

<?php
/**
 * Restrict WPForms PayPal Commerce to the PayPal button only.
 *
 * @link https://wpforms.com/developers/
 */

// Prevent Apple Pay and Google Pay from registering their SDK components.
add_filter( 'wpforms_integrations_paypal_commerce_payment_methods_apple_pay_allow_load', '__return_false' );
add_filter( 'wpforms_integrations_paypal_commerce_payment_methods_google_pay_allow_load', '__return_false' );

// Disable the remaining alternative funding sources.
add_filter(
    'wpforms_integrations_paypal_commerce_frontend_get_disabled_funding_sources',
    function ( $disabled, $is_single ) {
        return array_unique(
            array_merge(
                $disabled,
                [
                    'card',
                    'credit',
                    'paylater',
                    'venmo',
                    'bancontact',
                    'blik',
                    'eps',
                    'giropay',
                    'ideal',
                    'mybank',
                    'p24',
                    'sepa',
                    'sofort',
                    'trustly',
                    'wechatpay',
                    'mercadopago',
                ]
            )
        );
    },
    10,
    2
);

// Clear any explicitly enabled funding sources (such as Venmo).
add_filter( 'wpforms_integrations_paypal_commerce_frontend_get_enabled_funding_sources', '__return_empty_array', 10, 2 );

The snippet works in three parts, each hooking into a different stage of the PayPal Commerce load process. The first two filters prevent Apple Pay and Google Pay from registering their SDK components entirely. This step is important because simply disabling these funding sources without preventing them from loading can cause the PayPal.js script to fail.

The next filter, wpforms_integrations_paypal_commerce_frontend_get_disabled_funding_sources, appends the remaining alternative funding sources to PayPal’s disabled list. This covers credit and debit cards, Pay Later, Venmo, and a range of regional methods like iDEAL, Bancontact, and SEPA.

The final filter clears out any funding sources that were explicitly enabled elsewhere, making sure nothing slips through.

Together, these filters leave the PayPal button as the only available payment method on your form. Payments will continue to process normally, and your non-profit account will retain its discounted rate.

That’s it! You’ve successfully restricted PayPal Commerce to the PayPal button only. Would you like to learn more about accepting payments with WPForms? Check out our complete guide to setting up PayPal Commerce with WPForms.