Title: Exclude plugin/file from delayed JS loading
Last modified: March 25, 2022

---

# Exclude plugin/file from delayed JS loading

 *  Resolved [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/)
 * I tried excluding a specific plugin (pop-up) from the delayed JS loading on Litespeed,
   but this doesn’t seem to work.
 * What I did:
    - Changed the setting for the entire site from delayed to deferred in Litespeed
      settings (plugin worked)
    - Added the plugin (/wp-content/plugins/pluginname/) to the _JS Excludes_ and
      _JS deferred excludes_ – **No result**
    - Talked to support of the plugin developer and added _data-no-optimize=”1″_
      to the plugin files – **No result**
    - Tried excluding some seperate JS files (from the plugin) in the excludes (
      JS en deferred JS) – **No result**
    - When logged in (without optimizations) the plugins works, which is also the
      case when delayed JS loading is disabled.
    - Hope there’s a solution for this.
    - Thanks!
 *  -  This topic was modified 4 years, 2 months ago by [brightidiots](https://wordpress.org/support/users/brightidiots/).
    -  This topic was modified 4 years, 2 months ago by [brightidiots](https://wordpress.org/support/users/brightidiots/).
    -  This topic was modified 4 years, 2 months ago by [brightidiots](https://wordpress.org/support/users/brightidiots/).

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15496596)
 * have you tried to exclude the inline JS as well ?
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15498079)
 * Yes, we did, like this:
 *     ```
       <script data-no-optimize="1"> var brave_popup_data = {}; var bravepop_emailValidation='.json_encode($emailValidator).';</script>
       ```
   
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15498457)
 * try add a part of the inline code into the exclude list , instead of use data-
   no-optmize attr
 * like `brave_popup_data`
 * you may need to exclude others like jquery as well
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15499495)
 * Also added all inline JS to the exclude list (Jquery included) in the Litespeed
   options, no results, unfortunately.
    -  This reply was modified 4 years, 2 months ago by [brightidiots](https://wordpress.org/support/users/brightidiots/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15499980)
 * try all inline , alone with
 *     ```
       wp-content
       wp-inclutes
       ```
   
 * see what happens.
 * and please do remember purge all after each change.
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15501232)
 * Also added the wp-content en wp-includes, but no result. It seems like the exclusion
   function just doesn’t work.
 * Anything else I can try to solve this?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15502515)
 * it should work , but I think the thing is we did not find the correct string.
 * what if you find all the inline js , alone with above 2 `wp-` into the list ,
   purge all , how does that go ?
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15502537)
 * Thanks for your reply!
 * To be sure: do you mean I add ‘wp-‘ to the JS exclude box in the Litespeed Settings?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15502540)
 * no no , I mean
 * add all the inline js you found in your page , alone with
 *     ```
       wp-content
       wp-includes
       ```
   
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15502685)
 * To be honest: I’m a bit lost. Don’t know howto get a list of these ‘inline JS’
   files to exclude.
 * Can you provide some guidance on howto make this list?
 * If needed, I can (privately) share my staging environment for this website?
    -  This reply was modified 4 years, 2 months ago by [brightidiots](https://wordpress.org/support/users/brightidiots/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15506021)
 * Hi,
 * disable the plugin , open your page on your browser , I assume it’s Chrome , 
   then right click anywhere in your page , click “view source code”
 * then in that page , search for `<script` any block that doesn’t contains a link
   to a jS file , should be considered as inline JS
 * extract them , save them into a text file , then extract a piece of word/string
   from each of them , put them into the defer JS exclude list
 * purge all ,and check again.
 *  Thread Starter [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * (@brightidiots)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15508730)
 * Thanks for your replies!
 * Found the correct inline JS at the end and had to add this to all 3 excludes (
   no optimize, defer exclude and guest mode).
 * Thanks again!

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

The topic ‘Exclude plugin/file from delayed JS loading’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [brightidiots](https://wordpress.org/support/users/brightidiots/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/exclude-plugin-file-from-delayed-js-loading/#post-15508730)
 * Status: resolved