Title: Cannot dequeue style anymore
Last modified: April 17, 2021

---

# Cannot dequeue style anymore

 *  Resolved [Laurent OneChai](https://wordpress.org/support/users/lolobu/)
 * (@lolobu)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/)
 * Hello,
    Since I don’t need all the css and js enqueued by NextGen (I have my 
   own), I use to dequeue all that to speed up things and load as few resources 
   as possible.
 *     ```
       add_action('wp_enqueue_scripts', 'deregister_css', 999);
       function deregister_css() {
         wp_dequeue_style('nextgen_basic_thumbnails_style');
       }
       ```
   
 * It used to work like a charm, but since version 3.9, it doesn’t work anymore,
   and I end up loading tons of css and js that I don’t want.
 * I can see in your code the wp_enqueue_style call within the function enqueue_frontend_resources.
   The handle I’m using is still correct so why can’t I dequeue those?
 * Commenting out the wp_enqueue_style is of course possible, but that’s not really
   a clean and serious option because any update would overwrite that.
 * Any help would be appreciated.

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

 *  Thread Starter [Laurent OneChai](https://wordpress.org/support/users/lolobu/)
 * (@lolobu)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14333924)
 * I figured out that setting define(‘NGG_SKIP_LOAD_SCRIPTS’, TRUE) fix my problem,
   no more dequeue 🙂
    -  This reply was modified 5 years, 1 month ago by [Laurent OneChai](https://wordpress.org/support/users/lolobu/).
 *  [francoc30](https://wordpress.org/support/users/francoc30/)
 * (@francoc30)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14338151)
 * Hi Laurent,
    I find your post very interesting. Using Query Monitor, I find NGG
   makes a lot of queries on loading. I am interested in reducing that number to
   improve performance, then I see your post. Can you share more details as how 
   you go about doing this? I am not a developer but can follow instructions in 
   confidence.
 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14341655)
 * Hi [@francoc30](https://wordpress.org/support/users/francoc30/),
 * You can try Laurent’s suggestion by adding the mentioned by him line of code 
   to your site’s wp-config.php file ( somewhere above the /* That’s all, stop editing!
   Happy publishing. */ line )
 * Hope this helps
 *  [francoc30](https://wordpress.org/support/users/francoc30/)
 * (@francoc30)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14342744)
 * Hi Mihai-imagely,
    As I said I am not a developer. I sure can add the mentioned
   code into wp-config.php. I am using NGG Plus. What will the impact on my slideshow
   and galleries displays? Will they still function as before? Will the loading 
   of web pages faster? I don’t want to break my site though. Specifically, what
   does dequeuing scripts mean in terms of NGG? All NGG scripts are being skipped
   over during loading?
    -  This reply was modified 5 years, 1 month ago by [francoc30](https://wordpress.org/support/users/francoc30/).
 *  Thread Starter [Laurent OneChai](https://wordpress.org/support/users/lolobu/)
 * (@lolobu)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14342978)
 * I did that only because I’m using my own CSS for NextGen galleries and my own
   Javascript for the lightbox. Therefore, I don’t want to load the one provided
   by the plugin.
    But if it’s not your case and you’re using NextGen the way it’s
   intented to be used, unloading the CSS and Javascript will break everything. 
   They are meant to be loaded because they are requireds indeed.
 *  [francoc30](https://wordpress.org/support/users/francoc30/)
 * (@francoc30)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14344214)
 * Ok Laurent, that makes sense. Thanks.

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

The topic ‘Cannot dequeue style anymore’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [francoc30](https://wordpress.org/support/users/francoc30/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-dequeue-style-anymore/#post-14344214)
 * Status: resolved