Opens in a new tab

Save $50 Every Year with MainWP

Get $50 off the MainWP Yearly Plan this Black Friday. Your discount renews every year! Claim Your $50 Discount
← Back to blog

How to Improve Site Performance when using Stripe in WooCommerce

This post may contain affiliate links. Read the disclosure.

The WooCommerce Stripe Gateway is a widely used plugin for adding Stripe integration to your WooCommerce store.

A recent release in version 5.7.0 of the Stripe plugin would cause a number of Stripe-related assets requests and external Stripe requests to load on single product pages and cart pages on your site. This would cause product pages and the cart page of the site to be much slower due to the extra requests being loaded from Stripe on them.

The express checkout options can be controlled in the Stripe payment gateway from;

WooCommerce > Settings > Payments > Stripe

If you are using the current version of the WooCommerce Stripe Gateway plugin which at this time is version 5.8.1 then you will still need to use the code snippet to disable the Stripe scripts from loading on cart and product pages.

Code snippet to use

add_filter( 'wc_stripe_load_scripts_on_product_page_when_prbs_disabled', '__return_false' );
add_filter( 'wc_stripe_load_scripts_on_cart_page_when_prbs_disabled', '__return_false' );

MainWP has a code snippets extension that will allow you to save and execute code snippets to all connected child sites.

Making sure that the Stripe plugin is updated to the current version and using the code snippet will help improve your WooCommerce stores loading time before any Black Friday and Cyber Monday sales.

Useful links
https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2065
https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2179
https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2110
https://wordpress.org/plugins/woocommerce-gateway-stripe/
https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt
https://woocommerce.com/document/stripe/#express-checkouts

Explore MainWP Pro
Get MainWP Pro
Topics: Tips & Tricks