How to Configure WP Rocket Settings
In This Document
Reading time: 3 minutes | Difficulty: Beginner
Overview
Are your payment forms not working correctly for logged out users, or only some of the time, with WP Rocket active? Follow the steps below to make sure WP Simple Pay works as expected alongside WP Rocket.
Since WP Simple Pay 4.17.5, payment forms load their data from your site as the page opens, so pages with payment forms can be cached. You only need to exclude your payment confirmation pages, plus WP Simple Pay’s scripts if you use WP Rocket’s JavaScript optimizations.
Prerequisites
- WP Simple Pay 4.17.5 or later. On earlier versions, also add your payment form pages to Never Cache URL(s).
- The WP Rocket plugin installed and active
Cache Settings
Add Payment Confirmation Pages to Never Cache
Under the Advanced Rules menu option, add the URLs of your payment confirmation pages to Never Cache URL(s).

JavaScript Settings
Issue 1: Combine JavaScript and Minify JavaScript
In some cases, WP Simple Pay users run into issues because of the Combine JavaScript files option (found under the File Optimization tab).

If forms are not working as expected, try one of the following:
- Exclude the page or post from JavaScript optimization by unselecting the Minify/combine JS option in the page or post editor, then clear the cache before testing again, OR
- In WP Rocket, disable the Combine JavaScript files option, save settings, then clear the cache before testing again.
Issue 2: Load JavaScript Deferred
Loading JavaScript deferred can cause issues with WP Simple Pay payment forms. Add the following to Excluded JavaScript Files to make sure payment forms work as expected:
/wp-content/plugins/wp-simple-pay-pro-3/(.*).js
js.stripe.com/v3/
If WP Simple Pay is installed in a different folder, replace wp-simple-pay-pro-3 with that folder’s name.

Clear All Caches and Optimizations
After making these changes, and after updating WP Simple Pay to 4.17.5, clear all caches and optimizations, reload the payment pages, and try the payment form again.
What’s Next?
- How to Resolve Issues Caused by Cache and Optimization Plugins – General caching and JavaScript optimization guidance
- How to Set Payment Success and Failure Pages – Find the pages to exclude
Still have questions? We're here to help!
Last Modified: