Title: Scripts are loaded
Last modified: October 9, 2019

---

# Scripts are loaded

 *  Resolved [samtulana](https://wordpress.org/support/users/samtulana/)
 * (@samtulana)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/scripts-are-loaded/)
 * Hello. Explain why it is impossible to make the scripts of the plugin not loaded
   on pages where it is not needed? After all, this creates additional load on the
   server.
 * Why can not these scripts be removed from pages where it is not used?
 * wp-content/plugins/drag-and-drop-multiple-file-upload-contact-form-7/assets/js/
   codedropz-uploader-min.js?ver=1.3.0
    wp-content/plugins/drag-and-drop-multiple-
   file-upload-contact-form-7/assets/js/dnd-upload-cf7.js?ver=1.3.0
 * Thank you.
    -  This topic was modified 6 years, 8 months ago by [samtulana](https://wordpress.org/support/users/samtulana/).

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

 *  Plugin Author [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12011205)
 * Hello [@samtulana](https://wordpress.org/support/users/samtulana/) ,
 * Thanks for asking, currently I’m using standard hooks from contact form 7 to 
   load the scripts.
 * This concern is related to contact form 7 plugin.
 * If you don’t want to load the scripts on the page that don’t have contact form.(
   see below)
 * [https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/](https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/)
 * Read through “Step 2: Load the files on pages which contain contact forms” section.
 * Thanks.
 *  Thread Starter [samtulana](https://wordpress.org/support/users/samtulana/)
 * (@samtulana)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12011798)
 * Thank you.
 * I am familiar with this instruction, but the Contact Form 7 I have is on many
   pages, and not on one. After all, it’s possible in the plugin to realize the 
   ability not to load scripts on those pages where I am not used or I need to climb
   into the file and make changes every time after updating the theme or create 
   several dozen files for each form. It is very uncomfortable.
 *  Plugin Author [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12033508)
 * Hello [@samtulana](https://wordpress.org/support/users/samtulana/) ,
 * Currently there’s no option but is to create a separate template for each form
   or if you are familiar with the hooks you can dequeque specific scripts.
 * Can you try the code below?
 *     ```
       function contact_dequeue_script() {
       	if( ! is_page('contact') || ! is_page('another-page-form') )
       		wp_dequeue_script('codedropz-uploader');
       		wp_dequeue_script('dnd-upload-cf7');
       	}
       }
       add_action( 'wp_print_scripts', 'contact_dequeue_script', 100 );
       ```
   
    -  This reply was modified 6 years, 7 months ago by [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/).
    -  This reply was modified 6 years, 7 months ago by [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/).
 *  Plugin Author [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12064758)
 * I haven’t heard back from you, closing this thread now.
 *  Thread Starter [samtulana](https://wordpress.org/support/users/samtulana/)
 * (@samtulana)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12065450)
 * Thank you very much, anyway, the script loads where it is not used. One } bracket
   in the code. Please close the topic
    -  This reply was modified 6 years, 7 months ago by [samtulana](https://wordpress.org/support/users/samtulana/).

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

The topic ‘Scripts are loaded’ is closed to new replies.

 * ![](https://ps.w.org/drag-and-drop-multiple-file-upload-contact-form-7/assets/
   icon-128x128.jpg?rev=1984850)
 * [Drag and Drop Multiple File Upload for Contact Form 7](https://wordpress.org/plugins/drag-and-drop-multiple-file-upload-contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/drag-and-drop-multiple-file-upload-contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [samtulana](https://wordpress.org/support/users/samtulana/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/scripts-are-loaded/#post-12065450)
 * Status: resolved