Title: Defer loading JS
Last modified: October 26, 2022

---

# Defer loading JS

 *  Resolved [izzappel](https://wordpress.org/support/users/izzappel/)
 * (@izzappel)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/defer-loading-js/)
 * Hello
 * Is there a solution to defer loading the plugins and stripe javascript files?
 * On my first try it did not work and the “Buy” button was not initialized properly.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Adam Lea](https://wordpress.org/support/users/adamjlea/)
 * (@adamjlea)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/defer-loading-js/#post-16137138)
 * Hello [@izzappel](https://wordpress.org/support/users/izzappel/)
 * For the most consistent results, we recommend excluding WP Simple Pay’s scripts
   from deferred loading when using an asset optimization plugin.
 * Kind regards,
 *  Thread Starter [izzappel](https://wordpress.org/support/users/izzappel/)
 * (@izzappel)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/defer-loading-js/#post-16193880)
 * Hi [@adamjlea](https://wordpress.org/support/users/adamjlea/)
 * Thanks for your answer.
 * Is it possible to just load the external Stripe scripts on pages where the WP
   Simple Pay Button is embedded?
    Right now it slows down my whole website.
 * Best regards,
 *  [Adam Lea](https://wordpress.org/support/users/adamjlea/)
 * (@adamjlea)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/defer-loading-js/#post-16197331)
 * Hello again, [@izzappel](https://wordpress.org/support/users/izzappel/)
 * Thank you for your patience.
 * We do provide a code snippet that will conditionally dequeue scripts & styles
   based on set conditions. You can read the code comments for further information,
   setup details, etc.
 * You can find the code snippet [here](https://github.com/awesomemotive/wp-simple-pay-snippet-library/blob/master/plugins/remove-scripts-styles.php).
 * I hope that helps 🙂
 * Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Defer loading JS’ is closed to new replies.

 * ![](https://ps.w.org/stripe/assets/icon-256x256.png?rev=2784844)
 * [Stripe Payment Forms by WP Simple Pay - Accept Credit Card Payments + Subscriptions with Stripe](https://wordpress.org/plugins/stripe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stripe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stripe/)
 * [Active Topics](https://wordpress.org/support/plugin/stripe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stripe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stripe/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Adam Lea](https://wordpress.org/support/users/adamjlea/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/defer-loading-js/#post-16197331)
 * Status: resolved