Title: Exclude Inline JavaScript without Query String
Last modified: March 17, 2021

---

# Exclude Inline JavaScript without Query String

 *  Resolved [kevisorus](https://wordpress.org/support/users/kevisorus/)
 * (@kevisorus)
 * [5 years ago](https://wordpress.org/support/topic/exclude-inline-javascript-without-query-string/)
 * Hello,
 * I’m using the combined JS optimization on my site and I noticed that LSCWP is
   creating a unique combined JS for every post. These files are taking a lot of
   space, approx. 200MB.
 * I’ve checked the docs [here](https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/#find-and-exclude-the-random-string),
   and I’ve managed to narrow down the issue is being caused by an inline script
   from Antispam Bee.
 * The script generates a unique ID for each comment form which causes LSCWP to 
   generate a unique combined JS for all posts. Example of script from a post:
 * `<script data-noptimize type="text/javascript">document.getElementById("comment").
   setAttribute( "id", "<strong>ae78e638defdf0472bf1c5230c38f1f9</strong>" );document.
   getElementById("b6f07f75fd").setAttribute( "id", "comment" );</script>`
 * I found a thread detailing a similar [issue](https://wordpress.org/support/topic/request-for-autoptimize-compatibility/)
   but on a different plugin (Autoptimize). Presumably that was resolved by excluding
   the script using the attribute **data-noptimize** that’s in the script.
 * Excluding this attribute does not work with LSCWP as it uses **data-no-optimize
   =”1″** instead. Is there any other way I can exclude this script seeing it has
   no query string I can use?

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/exclude-inline-javascript-without-query-string/#post-14198333)
 * Hi,
 * you can use partial inline script code for pattern to exclude
 * e.g. in your code , you can use `document.getElementById("comment").setAttribute("
   id"`
 * Best regards,
 *  Thread Starter [kevisorus](https://wordpress.org/support/users/kevisorus/)
 * (@kevisorus)
 * [5 years ago](https://wordpress.org/support/topic/exclude-inline-javascript-without-query-string/#post-14199829)
 * Hi,
 * That resolved it. Many thanks!

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

The topic ‘Exclude Inline JavaScript without Query String’ 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/)

## Tags

 * [inline script](https://wordpress.org/support/topic-tag/inline-script/)
 * [Query String](https://wordpress.org/support/topic-tag/query-string/)

 * 2 replies
 * 2 participants
 * Last reply from: [kevisorus](https://wordpress.org/support/users/kevisorus/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/exclude-inline-javascript-without-query-string/#post-14199829)
 * Status: resolved