Title: Combine Javascript files removing javascript when user is not logged in
Last modified: December 17, 2020

---

# Combine Javascript files removing javascript when user is not logged in

 *  Resolved [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * (@prehealthshadowing)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/)
 * We noticed after the WordPress 5.6 upgrade that our inline Javascript snippets
   were being removed from the HTML when Combine Javascript Files was enabled and
   the user was NOT logged in to our website. Once a user logged in, the snippets
   were present.
 * This functionality specifically broke in the plugins Woody Snippets, DebugPress,
   and Contact Form 7 with ReCaptcha enabled. Things didn’t work when the user was
   not logged in, but worked fine after they logged in.
 * Woody Snippets creates comments in the HTML where the JS is being inserted, and
   so we could actually see the code missing. I’m attaching two screenshots of Chrome
   DevTools – one before logging and and one after logging in. There are no other
   differences.
    Logged in: [https://prnt.sc/w44opg](https://prnt.sc/w44opg) Not
   Logged in: [https://prnt.sc/w44p99](https://prnt.sc/w44p99)

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

 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/#post-13801197)
 * Hey [@prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * This is expected behavior. When the Combine JS files is enabled, we put the content
   from all js files + the inline scripts in a single file.
 * However, this optimization works for non-logged-in users only and this is why
   you see the inline scripts when a user is logged in.
 * Regards,
    Stanimir
 *  Thread Starter [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * (@prehealthshadowing)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/#post-13805340)
 * Unfortunately, it seems as if the scripts are being removed, but not being placed
   into a new file which is being served, as none of the scripts are executing and
   there are no messages on the console. I have looked through the output HTML and
   don’t see reference to a new script tag with the combined JS in it, and I don’t
   see the inlined JS elsewhere on the same page.
 * What is the name of the file that is supposed to be served with the combined 
   Javascript? Could it be a conflict with another plugin?
 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/#post-13806444)
 * Hey [@prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * The scripts are added in the combined js files, but there are errors in the console.
   Please use the exclude functionality that the plugin provides to fix those issues
   and the page will load properly.
 * Regards,
    Stanimir
 *  Thread Starter [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * (@prehealthshadowing)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/#post-13806764)
 * Hello Stanismir,
 * Thank you for the response. The errors have been fixed on our production site
   already, but enabling the Combine Javascript option still causes the problem 
   I describe.
 * I have toggled the Combine Javascript setting ON on our main site if you want
   to try to reproduce. (I will flip it off in the morning). I do not see any sign
   that the scripts that have been extracted from inline are present elsewhere.
 * If you can locate the scripts that have been removed from between the “Woody 
   ad snippets” comments while not logged in, please share with me where they have
   been moved to. You are welcome to create an account to see the issue.

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

The topic ‘Combine Javascript files removing javascript when user is not logged 
in’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/combine-javascript-files-removing-javascript-when-user-is-not-logged-in/#post-13806764)
 * Status: resolved