Title: JS in the header show script errors.
Last modified: January 9, 2021

---

# JS in the header show script errors.

 *  [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * (@123nadav)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/js-in-the-header-show-script-errors/)
 * Hey, what’s up?
    I try optimize jquery and i see in your menu: [https://wordpress.org/plugins/autoptimize/#%E2%80%9Cclear%20cache%E2%80%9D%20doesn%E2%80%99t%20seem%20to%20work%3F](https://wordpress.org/plugins/autoptimize/#%E2%80%9Cclear%20cache%E2%80%9D%20doesn%E2%80%99t%20seem%20to%20work%3F)
 * you recommended if you optimize the jquery JS to turn off js in the head,
    I 
   did it and got this: [https://ibb.co/wB7yXVT](https://ibb.co/wB7yXVT)
 * why?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjs-in-the-header-show-script-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/js-in-the-header-show-script-errors/#post-13886105)
 * forcing JS in head should be avoided if possible 🙂
 *  Thread Starter [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * (@123nadav)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/js-in-the-header-show-script-errors/#post-13887446)
 * I avoid this.
    but i was must check if i have errors in the site so i use this,
   and yes was a JS error as you see.
 * So… i force them in the head and i got the errors.
    Now when i remove the default
   option of creating JS/CSS in the cache folder ( this change them to php )
 * The errors are gone.
 * For now,
    I remove the force header ( this after i know don’t have js errors )
 * I use the PHP option for the cache and not the js/css option.
 * but still, i am afraid.
    This because here: [https://wordpress.org/plugins/autoptimize/#%E2%80%9Cclear%20cache%E2%80%9D%20doesn%E2%80%99t%20seem%20to%20work%3F](https://wordpress.org/plugins/autoptimize/#%E2%80%9Cclear%20cache%E2%80%9D%20doesn%E2%80%99t%20seem%20to%20work%3F)
 * You recommended if somebody optimize jquery script, to use the options:
    [https://ibb.co/QMt0x5h](https://ibb.co/QMt0x5h)
 * Except that everything fine for now 🙂
    Tell me what to do.
 * About the google GA, you was right.
    I need to find a way to store this on my
   server (this is a problem as well, google changes every day, now he “proxy” the
   tag manager.)
 * I open a thread in their support forum.
    let’s hope they will solve the issue.
 * Only tell me what to do about the screenshot i send you (jquery)
    if you want
   to run a test the site is ok now (on php, not default): locksmithunit.com
 * Thank you again 🙂
 * Regards,
    Nadav Levi Yahel Locksmith Unit
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/js-in-the-header-show-script-errors/#post-13887723)
 * afraid jQuery sometimes simply cannot be optimized Nadav, the recommendations
   are always to be tested and if things break then you have to roll back the changes
   and live with jQuery being render-blocking .. :-/

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

The topic ‘JS in the header show script errors.’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/js-in-the-header-show-script-errors/#post-13887723)
 * Status: not resolved