Title: Gravity forms conflict
Last modified: February 17, 2017

---

# Gravity forms conflict

 *  Resolved [Jasper](https://wordpress.org/support/users/lucydog/)
 * (@lucydog)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/)
 * Unfortunately, Gravity Forms requires that the JS is loaded in the header, so
   checking the box next to: “Load JavaScript early, reducing the chance of JS-errors
   but making it render blocking” causes some forms to now show up.
 * The speed of the site was better when I had the box unchecked, so I tried to 
   exclude GF from JS optimization, hoping that the rest of the site would still
   benefit. Somehow the rules I put in there were incorrect.
 * Here is the entire rule. If you can tell what is wrong, I would appreciate it.
 * s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,
   ch_client,seal.js,/wp-google-search/assets/js/google_cse_v2.js,/gravityforms/
   js/conditional_logic.min.js,/gravityforms/js/jquery.maskedinput.min.js
 * Thank you,

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818024)
 * well, what JS errors do you see on the browser console when JS is not forced 
   in head and with those exceptions?
 *  Thread Starter [Jasper](https://wordpress.org/support/users/lucydog/)
 * (@lucydog)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818074)
 * Thanks for the quick response. You get:
 * Uncaught ReferenceError: gform is not defined
    at conditional_logic.min.js:1 (
   anonymous) @ conditional_logic.min.js:1 jquery.maskedinput.min.js:7 Uncaught 
   ReferenceError: jQuery is not defined at jquery.maskedinput.min.js:7 at jquery.
   maskedinput.min.js:7 (anonymous) @ jquery.maskedinput.min.js:7 (anonymous) @ 
   jquery.maskedinput.min.js:7 (index):227 Uncaught ReferenceError: jQuery is not
   defined at (index):227 (anonymous) @ (index):227 (index):227 Uncaught ReferenceError:
   jQuery is not defined at (index):227 (anonymous) @ (index):227 (index):234 Uncaught
   ReferenceError: renderRecaptcha is not defined at (index):234
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818119)
 * ok, one thing you’ll most certainly need to exclude as well is jquery (the wordpress
   core version can be excluded with `js/jquery/jquery.js`). can you do that and
   report back?
 *  Thread Starter [Jasper](https://wordpress.org/support/users/lucydog/)
 * (@lucydog)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818170)
 * When I do that, the problem of the form not showing up with the “force JS in 
   head” box unchecked.
 * I have suspected that the problem is with the conditional logic, because this
   form has it, and forms that do not have conditional logic were working fine.
 * Instead of a long list of errors I still have one error which makes me worried:
 * Uncaught ReferenceError: gform is not defined
    at conditional_logic.min.js:1
 * Here is the full line of exclusions:
    s_sid,smowtion_size,sc_project,WAU_,wau_add,
   comment-form-quicktags,edToolbar,ch_client,seal.js,/wp-google-search/assets/js/
   google_cse_v2.js,/gravityforms/js/conditional_logic.min.js,/gravityforms/js/jquery.
   maskedinput.min.js,js/jquery/jquery.js
 * By the way, I think you figured this out but my first message was confusing. 
   GF requres the “force JS in head” box TO be checked, and we would prefer not 
   to check it as the site is faster with it unchecked.
 * Thanks again!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818335)
 * ok, try excluding `/gravityforms/js/` instead of `/gravityforms/js/conditional_logic.
   min.js,/gravityforms/js/jquery.maskedinput.min.js`?
 *  Thread Starter [Jasper](https://wordpress.org/support/users/lucydog/)
 * (@lucydog)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818378)
 * That worked perfectly. The form shows up with no errors. Thanks!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-8818429)
 * great! 🙂
 * have a nice weekend!
    frank
 *  [rooftopartscentre](https://wordpress.org/support/users/rooftopartscentre/)
 * (@rooftopartscentre)
 * [9 years ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-9261446)
 * Hi Frank,
 * I’m having a similar issue as above. Autotomize is causing my gravity form not
   to display.
 * My form is using conditional logic and here is the error on the page:
 * Uncaught ReferenceError: jQuery is not defined
 * Gravity Form support are saying that error is being caused by jQuery being loaded
   in a combined minified file at the end of the page, when jQuery should be included
   in the page header.
 * They can’t help me resolve the problem and recommended I reach out to you.
 * I can’t amend code myself, could you please help.
 * Many thanks,
 * Kacem
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [9 years ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-9261696)
 * as per [the FAQ](https://wordpress.org/plugins/autoptimize/faq/); make sure jquery
   is excluded from optimization (by default it is in `js/jquery/jquery.js`).
 *  [rooftopartscentre](https://wordpress.org/support/users/rooftopartscentre/)
 * (@rooftopartscentre)
 * [9 years ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-9261880)
 * Hi Frank,
    Thank you for pointing that out. I ticked the box “Force JavaScript
   in <head>?” and refreshed the website.
 * The form now loads fine but Google Insight’s speed score is complaining.
 * Guess you can’t make everyone happy.
 * Thanks a lot for your speedy response, much appreciated.

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

The topic ‘Gravity forms conflict’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [rooftopartscentre](https://wordpress.org/support/users/rooftopartscentre/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/gravity-forms-conflict-12/#post-9261880)
 * Status: resolved