WP Simple Pay Documentation

Documentation, Reference Materials, and Tutorials for WP Simple Pay

Tips & Tricks

Join our Newsletter

Please enable JavaScript in your browser to complete this form.
Get tips, tricks, and resources delivered directly to your mailbox.
WP Simple Pay
Save 50%!

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

This is NOT recommended, and if you decide to use this approach, you will vastly reduce the advanced fraud protection that Stripe provides.

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.

If you are unfamiliar with adding custom code to WordPress, please review this helpful documentation article.

Still have questions? We’re here to help!

Last Modified:

Start Accepting Payments Today

Start accepting one-time and recurring payments or donations on your WordPress website.