Why is stripe.js Loaded on Every Page?
To best leverage Stripe’s advanced fraud functionality, Stripe recommends including this script on every page of your website, not just the payment page(s). This allows Stripe to detect suspicious behavior that may indicate fraud as customers browse your website. Including the script on every page vastly reduces potential fraud.
https://stripe.com/docs/js/including
To best leverage Stripe’s advanced fraud functionality, include this script on every page, not just the checkout page. This allows Stripe to detect suspicious behavior that may be indicative of fraud as customers browse your website.
How to Remove stripe.js on Non-Payment Pages
While we do not advise it, here is a link to our custom snippet to remove the script from all but payment form pages: https://library.wpcode.com/snippet/e5wn795d/
In the example shown in the script, we remove all plugin scripts & styles unless the current page slug is “payment-page,” “donate,” or “subscribe.”
You will want to update the snippet in two places and replace the example slugs with your payment page slugs.
Still have questions? We’re here to help!
Last Modified: