Hi team 👋
I’m using the WooCommerce PayPal Payments plugin (v3.0.1) on a live site and noticed that PayPal scripts like the Smart Button, Google Pay, and Apple Pay SDKs are being loaded globally on every page—even when not needed.
This can negatively impact performance and page speed on non-commerce pages.
Feature Request:
Please consider adding a filter (e.g. woocommerce_paypal_payments_should_enqueue_scripts) that would allow developers to conditionally load PayPal scripts only on relevant pages like Cart, Checkout, Product, or Shop.
Example:
add_filter(‘woocommerce_paypal_payments_should_enqueue_scripts’, function($load) {
return is_cart() || is_checkout() || is_product() || is_shop();
});
This would give more control to developers and help improve Core Web Vitals without breaking checkout or button rendering.
Thanks for the awesome work on the plugin—looking forward to seeing this implemented 🙌
Open
Last updated: March 27, 2025
0 comments
Log in to comment on this feature request.