Exclude Inline JavaScript without Query String




Wordpress LScache Plugin: Exclude Inline JavaScript without Query String

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, Im 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. Ive checked the docs here, and Ive 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: document.getElementById( comment ).setAttribute( id , ae78e638defdf0472bf1c5230c38f1f9 ) document.getElementById( b6f07f75fd ).setAttribute( id , comment ) I found a thread detailing a similar issue but on a different plugin (Autoptimize). Presumably that was resolved by excluding the script using the attribute data-noptimize thats 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? 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, Hi, That resolved it. Many thanks!



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference