Title: Javascript loaded in all wordpress pages
Last modified: June 10, 2020

---

# Javascript loaded in all wordpress pages

 *  Resolved [Vil](https://wordpress.org/support/users/viljevitch/)
 * (@viljevitch)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/javascript-loaded-in-all-wordpress-pages/)
 * Please: don’t enqueue all the scripts in all the pages this makes the website
   very slow!
    Call the functions only when needed.
 * for the moment i remove them from functions.php
 *  if(!is_page(xxx) ) {
    wp_dequeue_script( ‘gwolle_gb_frontend_js’ ); wp_deregister_script(‘
   gwolle_gb_frontend_js’ );
 *  wp_dequeue_script( ‘gwolle_gb_addon_frontend_js’ );
    wp_deregister_script( ‘
   gwolle_gb_addon_frontend_js’ );
 *  }
 * but not making it to remove the inpage javascript added with
    add_action( ‘wp_footer’,‘
   gwolle_gb_preview_javascript’ ); function gwolle_gb_preview_javascript() {
 * and other functions.
 * add_action( ‘wp_footer’, ‘remove_my_action’, 20 );
    function remove_my_action(){
   if(!is_page(xxx) ) { remove_action(‘wp_footer’, ‘gwolle_gb_preview_javascript’,
   20); } } seems not working. Any suggestions?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Vil](https://wordpress.org/support/users/viljevitch/)
 * (@viljevitch)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/javascript-loaded-in-all-wordpress-pages/#post-12964826)
 * made it!
 *     ```
       add_action( 'init', 'remove_my_action', 20 );
       function remove_my_action(){
           if(!is_page(xxx) ) {
   
               remove_action('wp_footer', 'gwolle_gb_preview_javascript');
               remove_action('wp_footer', 'gwolle_gb_delete_javascript');
               remove_action('wp_footer', 'gwolle_gb_admin_reply_javascript');
               remove_action('wp_footer', 'gwolle_gb_report_abuse_javascript');
   
           }
       }
       ```
   
    -  This reply was modified 5 years, 11 months ago by [Vil](https://wordpress.org/support/users/viljevitch/).

Viewing 1 replies (of 1 total)

The topic ‘Javascript loaded in all wordpress pages’ is closed to new replies.

 * ![](https://ps.w.org/gwolle-gb/assets/icon-256x256.png?rev=1114688)
 * [Gwolle Guestbook](https://wordpress.org/plugins/gwolle-gb/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gwolle-gb/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gwolle-gb/)
 * [Active Topics](https://wordpress.org/support/plugin/gwolle-gb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gwolle-gb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gwolle-gb/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Vil](https://wordpress.org/support/users/viljevitch/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/javascript-loaded-in-all-wordpress-pages/#post-12964826)
 * Status: resolved