Title: Autoptimize + Simple Lightbox
Last modified: March 30, 2020

---

# Autoptimize + Simple Lightbox

 *  Resolved [Louno](https://wordpress.org/support/users/louno/)
 * (@louno)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/)
 * Hello,
    I am using autoptimize with the plugin SIMPLE LIGHTBOX : [https://en-ca.wordpress.org/plugins/simple-lightbox/](https://en-ca.wordpress.org/plugins/simple-lightbox/)
 * I noticed that autoptimize prevents lightbox from working on my site. How can
   I restore lightbox functionality while still using autoptimize ?
 * In autoptimize settings, I tried to exclude some JS from Simple Lightbox, I added
   these files to js exclusion :
    lib.core.js,lib.view.js,handler.image.js,tag.item.
   js,tag.ui.js,client.js
 * Even after excluding all these files, it still doesnt work… I would like to exclude
   only what is absolutely needed to exclude (or ideally, not exclude anything so
   that as much as possible everything is optimized)
 * Any help would be greatly appreciated.
 * Thanks,

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12604768)
 * try excluding `plugins/simple-lightbox/` instead and if not OK yet check the 
   browser console for JS errors and share here?
 *  Thread Starter [Louno](https://wordpress.org/support/users/louno/)
 * (@louno)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12607176)
 * Hi,
    Thank you for getting back to me. I dont think we can exclude entire folders.
   The exclude option in Autoptimize specifically says : _Exclude **scripts **from
   Autoptimize: A comma-separated list of **scripts **you want to exclude from being
   optimized, for example **‘whatever.js, another.js’** without the quotes to exclude
   those scripts from being aggregated by Autoptimize._
 * Nevertheless, I tried adding the folder and it didnt work. I looked at the console
   and dont see any relevant JS error as far as I can tell (although I am not too
   familiar with this console tool). Here is a page from the website as an example,
   all the images on this page were able to open in lightbox before I added autoptimize:
   
   [https://bit.ly/2WYzPig](https://bit.ly/2WYzPig)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12607584)
 * >  I dont think we can exclude entire folders
 * yes you can 🙂
 * > Nevertheless, I tried adding the folder and it didnt work
 * ok, next up;
    * (re-)add `js/jquery/jquery.js` to the JS exclusion list * untick
   the “also minify excluded CSS/ JS”
 *  Thread Starter [Louno](https://wordpress.org/support/users/louno/)
 * (@louno)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12607777)
 * Ok i added `js/jquery/jquery.js` to exclusion list and this solved the problem!
   I was also able to remove all the other previously excluded .js / folder and 
   this still works.
 * Unfortunately, this **slightly ** reduced the pagespeed score for my site, however,
   I guess I have no choice if I want to keep using Simple Lightbox? Unless maybe,
   is there another lightweight lightbox plugin that you would recommend that is
   more compatible with Autoptimize (doesnt need js exclusion, thus resulting in
   better pagespeed score?)
 * Thanks!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12608102)
 * > Unfortunately, this slightly reduced the pagespeed score for my site, however,
   > I guess I have no choice if I want to keep using Simple Lightbox?
 * I’m afraid so, yes.
 * > Unless maybe, is there another lightweight lightbox plugin that you would recommend
   > that is more compatible with Autoptimize (doesnt need js exclusion, thus resulting
   > in better pagespeed score?)
 * Maybe, but I don’t know, sorry.

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

The topic ‘Autoptimize + Simple Lightbox’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/autoptimize-simple-lightbox/#post-12608102)
 * Status: resolved