Support » Plugin: WooCommerce PayPal Payments » Remove Scripts on Frontend

  • Resolved Zachary Elkins


    There are (3) scripts that run on the frontend, which I don’t think are necessary unless at checkout.


    The (2) external scripts are not easy to remove. I’m digging through your code to figure out how it’s loaded. The last script is 124KB!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Zachary Elkins


    Ah, so button.js loads the other two.

    Still, why is this being loaded outside of single product pages and the cart/checkout?



    I agree, as good practice they should load the JS conditionally.

    Plugin Support Inpsyde Niklas


    Hi there,

    The scripts are only loaded when a button is active on that page.
    So when you have the button for the Mini Cart enabled, then the scripts will be loaded on all non-Cart and non-Checkout pages of your site.
    Disabling it will prevent the scripts from being loaded:

    Kind regards,




    Unfortunately we are seeing PayPal’s scripts being loaded on the frontend despite not having Mini Cart or others activated…

    The file /woocommerce-paypal-payments/modules/ppcp-wc-gateway/assets/js/pay-upon-invoice.js is being loaded and in turn other scripts / calls are being initiated such as

    We have the sandbox mode enabled and the only setting we activated is Enable on Checkout, all other options are NOT active.

    Using the latest version 1.9.0.

    Please look into this asap and let us know if you need anything else in this regards – we can provide a full log as well as backend access if need be.

    Thanks & regards,


Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.