• Resolved lausianne

    (@lausianne)


    Hi,

    I find wpa.js and wpae.js loading on every page, although I have a form only on one page. Is this necessary?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dnesscarkey

    (@dnesscarkey)

    Hi lausianne,

    Our plugin is designed to cover all forms across the entire website, which is why wpa.js and wpae.js are loaded on every page. Currently, there isn’t an option to load these scripts only on pages with forms.

    Thank you for understanding!

    Best regards, Dinesh

    Thread Starter lausianne

    (@lausianne)

    Thank you. Hardly any of my sites is using more than a single form, just on the contact page. But now WP Armour is slowing down every page. And almost each of your clients will have the same problem. There must be some way to fix that. Even if you have no option built in, which would of course be ideal, then perhaps you know of another way to include scripts only on certain pages. A plugin maybe.
    I will do some research myself now, just thought you might already know something.

    Best regards,
    Ralf

    Thread Starter lausianne

    (@lausianne)

    Found this:

    function dequeue_scripts() {
    if( ! is_page( array( 230 ) ) ) {
    wp_dequeue_script( 'wpascript' );
    wp_deregister_script( 'wpascript' );
    wp_dequeue_script( 'wpaescript' );
    wp_deregister_script( 'wpaescript' );
    }
    }
    add_action( 'wp_print_scripts', 'dequeue_scripts' );

    (sorry, don’t know how to format code here …)

    Plugin Author Dnesscarkey

    (@dnesscarkey)

    Hi Lausianne,

    Yes, this should work, but please make sure that the Page ID with the form is 230.

    Thanks

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