Title: Remove Forced Script Enqueue
Last modified: April 5, 2018

---

# Remove Forced Script Enqueue

 *  [seriaph](https://wordpress.org/support/users/seriaph/)
 * (@seriaph)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/remove-forced-script-enqueue/)
 * In advanced-forms/core/core-forms.php, line 168 – 170 there is the following 
   code:
 *     ```
       global $wp_scripts;
   
       $wp_scripts->print_scripts( array( 'acf-input', 'acf-pro-input' ) );
       ```
   
 * If possible, can this be modified so that its optional for scripts to be rendered
   above the form? I’m having issues with jQuery not being found by other plugins,
   as it’s being forced to be printed halfway down the page above a form. (jQuery
   is a dependency of ‘acf-input’ and ‘acf-pro-input’)
 * Refer to the documentation on print_scripts:
    [https://developer.wordpress.org/reference/classes/wp_scripts/print_scripts/](https://developer.wordpress.org/reference/classes/wp_scripts/print_scripts/)
 * > Prints the scripts passed to it or the print queue. Also prints all necessary
   > dependencies.
 * Any action here would be most appreciated!
    -  This topic was modified 8 years, 1 month ago by [seriaph](https://wordpress.org/support/users/seriaph/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * (@fabianlindfors)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/remove-forced-script-enqueue/#post-10161107)
 * Hi! This is an interesting topic which I struggled a bit with whilst creating
   this plugin. The problem is that ACF requires these scripts to function and they
   need to be included before the fields, otherwise conditional rendering doesn’t
   work. I couldn’t just enqueue the scripts as that would include them on all pages
   even if there was no form to display. The forced printing before the form became
   the final solution.
 * I haven’t heard of similar issues to yours before. The enqueue should only print
   jQuery if it hasn’t already been included in head which I believe it should if
   one uses the default `wp_enqueue_script( 'jquery' )`. Which plugins are you using
   that causes issues? Would love to try it myself.
 * Thanks for reaching out!

Viewing 1 replies (of 1 total)

The topic ‘Remove Forced Script Enqueue’ is closed to new replies.

 * ![](https://ps.w.org/advanced-forms/assets/icon-256x256.png?rev=1894254)
 * [Advanced Forms for ACF](https://wordpress.org/plugins/advanced-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-forms/reviews/)

## Tags

 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 1 reply
 * 2 participants
 * Last reply from: [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/remove-forced-script-enqueue/#post-10161107)
 * Status: not resolved