Title: reduce unused javascript
Last modified: December 11, 2022

---

# reduce unused javascript

 *  Resolved [lucytech](https://wordpress.org/support/users/lucytech/)
 * (@lucytech)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/)
 * my lighthouse report is telling me: I have a potential saving of 80.7 KiB from
   123.9 KiB on mobile for the /sdk/js?client-id=…(www.paypal.com) file.
    Is there
   anything I can do about this?
 * I have WP Rocket installed and set up.
    Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freduce-unused-javascript-5%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Syde Niklas](https://wordpress.org/support/users/niklasinpsyde/)
 * (@niklasinpsyde)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16281076)
 * Hi [@lucytech](https://wordpress.org/support/users/lucytech/),
 * If you are looking to improve performance, I suggest disabling the Mini Cart 
   buttons: [https://woocommerce.com/document/woocommerce-paypal-payments/#faq-paypal-scripts-on-every-page](https://woocommerce.com/document/woocommerce-paypal-payments/#faq-paypal-scripts-on-every-page)
   
   With this button location enabled, the PayPal scripts are loaded on almost every
   page of the site.
 * Kind regards,
    Niklas
 *  Plugin Support [Syde Niklas](https://wordpress.org/support/users/niklasinpsyde/)
 * (@niklasinpsyde)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16311211)
 * We have not heard back from you in a while, so I’m marking this thread as resolved.
   
   Hopefully, you were able to proceed as advised above.If you have any further 
   questions, please feel free to reopen this topic or create a new one.Thanks!
 * Kind regards,
   Niklas
 *  Thread Starter [lucytech](https://wordpress.org/support/users/lucytech/)
 * (@lucytech)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16311252)
 * Thanks for your help.
 * But I need to have the mini cart… this is a e-commerce website and that is the
   norm for a good shopping experience.
 * Do you suggest only showing the paypal option on the checkout page and not in
   the minicart?
 *  Plugin Support [Syde Niklas](https://wordpress.org/support/users/niklasinpsyde/)
 * (@niklasinpsyde)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16311269)
 * Hi [@lucytech](https://wordpress.org/support/users/lucytech/),
 * You can still use your Mini Cart. But when the PayPal buttons are enabled on 
   the Mini Cart, then the PayPal scripts will also be loaded on every page of your
   site where the Mini Cart is active. And the Mini Cart is almost omnipresent.
 * > Do you suggest only showing the paypal option on the checkout page and not 
   > in the minicart?
 * Yes, precisely. This button can be disabled from the bottom of the Standard Payments
   tab: [https://woocommerce.com/document/woocommerce-paypal-payments/#button-on-mini-cart](https://woocommerce.com/document/woocommerce-paypal-payments/#button-on-mini-cart)
 * I hope this helps!
 * Kind regards,
   Niklas
 *  Thread Starter [lucytech](https://wordpress.org/support/users/lucytech/)
 * (@lucytech)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16322356)
 * I disabled it from the mini cart but when I load the product pages it still says
   in the browser (edge, chrome) at the bottom – waiting for t.paypal.com or paypal.
   com
 * why is that? How do I speed that up?
    -  This reply was modified 3 years, 5 months ago by [lucytech](https://wordpress.org/support/users/lucytech/).
 *  Plugin Support [Syde Niklas](https://wordpress.org/support/users/niklasinpsyde/)
 * (@niklasinpsyde)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16322659)
 * Hi [@lucytech](https://wordpress.org/support/users/lucytech/)
 * The scripts are loaded on all pages where the buttons are enabled. So this looks
   like the [single product page buttons](https://woocommerce.com/document/woocommerce-paypal-payments/#button-on-single-product)
   are still enabled.
 * These buttons appear to not show on your product pages, but this may be an issue
   with the theme. Regardless of whether they are rendered, the scripts are still
   loaded.
   From the Standard Payments tab, you can decide on which pages you want
   the buttons to be loaded. I suggest only keeping Cart and Checkout enabled if
   you want to reduce how often the scripts are loaded.
 * Kind regards,
   Niklas
 *  Thread Starter [lucytech](https://wordpress.org/support/users/lucytech/)
 * (@lucytech)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16322962)
 * Thank you!!

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

The topic ‘reduce unused javascript’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-paypal-payments/assets/icon-256x256.png?rev=
   3234615)
 * [WooCommerce PayPal Payments](https://wordpress.org/plugins/woocommerce-paypal-payments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-paypal-payments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-paypal-payments/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-paypal-payments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-paypal-payments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-paypal-payments/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [lucytech](https://wordpress.org/support/users/lucytech/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/reduce-unused-javascript-5/#post-16322962)
 * Status: resolved