Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Praveen a11n

    (@spraveenitpro)

    Automattic Happiness Engineer

    Hi @vitalifeshop,

    I understand you would like to selectively deactivate scripts from loading on certain pages to improve load times. You could follow the suggestions in this tutorial: https://perfmatters.io/docs/disable-scripts-per-post-page/

    If you are inclined to code, you can also consider the scripts from this tutorial.

    Cheers!

    Hi @praveen,

    thanks for your answer, but I don’t agree: The posted links suggest to disable the loaded JavaScript with the help of the “wp_dequeue_script” function. But the problem is that you load pure JavaScript into the footer using the “wc_enqueue_js” function in “woocommerce-gateway-paypal-express-checkout/includes/settings/settings-ppec.php” on line 53. That makes it impossible to remove the JavaScript for me via handlers and display it only on certain pages, without editing the plugin PHP files.

    So, how could we remove that JS, which is displayed on each on every page?

    Best regards,
    Chevallier

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

The topic ‘Scripts are injected to every page – causing performance downgrading’ is closed to new replies.