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, 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 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?
- The topic ‘Exclude Inline JavaScript without Query String’ is closed to new replies.