Home Forums WoodMart support forum Can i Deregister and dequeue wpb_composer_front_js in the front end website

Can i Deregister and dequeue wpb_composer_front_js in the front end website

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #233354

    dsgm
    Participant

    I found below script in woodmart/functions.php:
    wp_enqueue_script( ‘wpb_composer_front_js’, false, array(), $version );

    This is good for my clients editing stuff in the back end, but it also adds unnecessary JS to every page load on the front end. Can I remove it in front end only?

    Will it cause any problem?

    Please advise.

    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #233370

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for contacting our support center.

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_dequeue_script() {
    	wp_dequeue_script( 'wpb_composer_front_js' );
    	wp_deregister_script( 'wpb_composer_front_js' );
    }
    add_action( 'wp_enqueue_scripts', 'woodmart_dequeue_script', 11000 );

    Regards

    #233470

    dsgm
    Participant

    ok, thank you

    #233477

    Artem Temos
    Keymaster

    You are welcome

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Can i Deregister and dequeue wpb_composer_front_js in the front end website’ is closed to new replies.