Title: Exclude not needed javascripts
Last modified: April 18, 2023

---

# Exclude not needed javascripts

 *  Resolved [donpi73](https://wordpress.org/support/users/donpi73/)
 * (@donpi73)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-not-needed-javascripts/)
 * Can you add options (in admin dashboard) to exclude Js files that aren’t needed?
 * For example, if I choose no to show fullscreen button, I could exclude
 *     ```wp-block-code
       /lightbox-photoswipe/assets/ps5/fullscreen/photoswipe-fullscreen.esm.min.js
       ```
   
 * and if I choose not to use dynamic captions, I could exclude
 *     ```wp-block-code
       /lightbox-photoswipe/assets/ps5/dynamic-caption/photoswipe-dynamic-caption-plugin.esm.min.js
       ```
   
 * So we can save some Kilobites and some Server Requests…

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-not-needed-javascripts/#post-16665220)
 * These scripts can not be excluded since they are loaded as modules. Also see 
   the [code here](https://github.com/arnowelzel/lightbox-photoswipe/blob/5.0.23/assets/ps5/frontend.js).
   The only script which is queued at all is the frontend script (`lightbox-photoswipe/
   assets/ps5/frontend.min.js`).
 * And before you ask for it: no, I will no created different versions of the frontend
   script which will be used depending on what options are selected in the backend–
   this would make the whole thing very hard to maintain just to save about 8 KB
   of code, sorry.

Viewing 1 replies (of 1 total)

The topic ‘Exclude not needed javascripts’ is closed to new replies.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-not-needed-javascripts/#post-16665220)
 * Status: resolved