Title: Bundle plugin js to reduce requests
Last modified: September 24, 2017

---

# Bundle plugin js to reduce requests

 *  Resolved [PeterWillard](https://wordpress.org/support/users/peterwillard/)
 * (@peterwillard)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/)
 * Hello and thank you for the great plugin! Perchance you can provide some insight
   into my problem. I am struggling to optimise a website and am trying to reduce
   the number of requests. I am bundling all javascript into a single file. When
   Advanced Mode is enabled (I need to be able to inline SVGs) the plugin not only
   includes its js in the footer (as expected) but makes WordPress enqueue jquery.
   js as well. I am using my own jquery in my bundle so the additional one is a 
   problem. So can you think of a way to keep inline SVG functionality, include 
   the plugin js manually and not trigger the additional jquery enqueue? Thanks 
   in advance for your time

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

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/#post-9526196)
 * Hey,
 * Glad you like the plugin 😃
 * Sounds like you’d need to modify my plugin where the JS is enqueued and remove
   the jQuery dependency from that line… it’s not something I would likely provide
   an option for in the settings because it’s usually considered bad practice to
   include your own version of jQuery.
 * I hope this makes sense.
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/#post-9540578)
 * Hey I just had a thought, can’t believe I didn’t think of it already!
    You can
   easily dequeue my JS and then enqueue it again using your own code in your child
   theme. Just make sure to enqueue without the jQuery dependency.
 *  Thread Starter [PeterWillard](https://wordpress.org/support/users/peterwillard/)
 * (@peterwillard)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/#post-9550115)
 * Hello again Ben!
 * Please forgive the lack of response, this is a sideproject I am working on in
   my spare time and I have been absolutely swamped with my full time job lately.
 * Anyway, the sub-par JS dev that I am, I figured this out. I dequeued the plugin
   script as per you suggestion with a simple
 *     ```
       function dequeue_svgs_script() {
           wp_dequeue_script('bodhi_svg_inline');
       }
       add_action( 'wp_print_scripts', 'dequeue_svgs_script', 100 );
       ```
   
 * and then included the plugin code in my own as a service. I just had to declare`
   cssTarget = "img.style-svg"` and it worked. Thank you for your time and suggestions.
 * Take care!
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/#post-9550171)
 * Excellent news! I’m glad you got it sorted 😀
 * Thanks for using my plugin. I hope the side project goes well.

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

The topic ‘Bundle plugin js to reduce requests’ is closed to new replies.

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

 * 4 replies
 * 2 participants
 * Last reply from: [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/bundle-plugin-js-to-reduce-requests/#post-9550171)
 * Status: resolved