Title: Excluding code from optimisation
Last modified: July 3, 2024

---

# Excluding code from optimisation

 *  Resolved [DanFoster](https://wordpress.org/support/users/danfoster/)
 * (@danfoster)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/)
 * Litespeed Cache is preventing our plugin [Track The Click](https://wordpress.org/plugins/track-the-click/)
   from working properly when it optimises Javascript. We can have our users [add `track-the-click` to their Do not cache URIs setting](https://wordpress.org/support/topic/plugin-track-links-only-from-logged-in-users/#post-17865780),
   but obviously this isn’t ideal and we’d like to prevent the problem in the first
   place.
 * The others of [Autoptimize](https://wordpress.org/plugins/autoptimize/) have 
   a [simple option](https://wordpress.org/support/topic/exclude-some-inline-js-from-being-autoptimized/)
   to use to exclude our code from their process. Do you have something similar?

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/#post-17866197)
 *  please go to Page Optm -> Tuning -> there are 3 JS exclude fields , please add`
   track-the-click` into them , save and purge all
 *  Thread Starter [DanFoster](https://wordpress.org/support/users/danfoster/)
 * (@danfoster)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/#post-17866208)
 * Yes, I have done that and advise our users to do so. As in the second link in
   my post. Do you offer an option like the link to Autoptimize that I also posted
   where a plugin author can opt out of your optimization which is incompatible 
   with their plugin?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/#post-17866270)
 * ohh , sorry I misunderstood and overlooked it
 * in our case `data-no-optimize="1"` and `data-no-defer="1"` will tell our plugin
   to bypass
    -  This reply was modified 1 year, 11 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Thread Starter [DanFoster](https://wordpress.org/support/users/danfoster/)
 * (@danfoster)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/#post-17866310)
 * Thank you, just what I was looking for.

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

The topic ‘Excluding code from optimisation’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [DanFoster](https://wordpress.org/support/users/danfoster/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/excluding-code-from-optimisation/#post-17866310)
 * Status: resolved