WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use nextgen gallery in a multisite. How can I disable all scripts and styles? These thing are loaded in the code of my site:

<link rel='stylesheet' id='NextGEN-css'  href='http://mysite.com/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0' type='text/css' media='screen' />

<script type='text/javascript' src='http://mysite.com/wp-content/plugins/nextgen-gallery/js/jquery.cycle.all.min.js?ver=2.9995'></script>

<script type='text/javascript' src='http://mysite.com/wp-content/plugins/nextgen-gallery/js/ngg.slideshow.min.js?ver=1.06'></script>

<!-- <meta name="NextGEN" version="1.9.7" /> -->
share|improve this question

closed as off-topic by birgire, Johannes Pille, s_ha_dum Oct 3 '14 at 16:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

This takes care of NextGEN's slideshow and CSS, as well as the Shutter script and CSS that it also enqueues by default.

add_action('wp_print_scripts', 'wpse_82982_removeScripts');
add_action('wp_print_styles', 'wpse_82982_removeStyles');

function wpse_82982_removeScripts() {

function wpse_82982_removeStyles() {

But: are you sure you want to do that? Maybe you can be a little selective, and only do that on selected pages / posts / categories.

Edit: to remove the commented-out meta tag too, add this filter:

add_filter('show_nextgen_version', '__return_null');
share|improve this answer
i use with Justified Image Grid - Premium WordPress Gallery , so the js and css of nextgen are useless now. Also, if i wont to this action in all of my sites in my multiste what is the code for wp-config.php? – Alex Jan 24 '13 at 11:31
I'd suggest you create a minimal plugin, then you can easily drop it into any site without modification. – webaware Jan 24 '13 at 11:34
ok, thnx a lot :) – Alex Jan 24 '13 at 11:37
@Alex: see updated answer – webaware Jan 25 '13 at 12:19
This doesn't work anymore with nextgen version 2.x – Murhaf Sousli Jan 26 '15 at 22:22

Another buyer has created this snippet https://gist.github.com/Davidlab/5134645

The proper way is to define('NGG_SKIP_LOAD_SCRIPTS', true);

Note that this'll be included in the next version of my plugin.

share|improve this answer
Thanks Firsh for this ability :) – Alex Jun 24 '13 at 12:43
How can I disable this nextgen retarded code from custom template? Why dont you use wp_footer hooks? Instead stuff them freaking everywhere and your source code is horrible to understand. If I have jquery UI and jquery already in the head, dont put them again to the footer. – Badr Hari Oct 3 '13 at 8:26
What do you mean by 'nextgen retarded code' exactly? What script are you talking about and are you talking to me? I do use wp_print_footer_scripts hooks and enqueue scripts with the footer set to true. Can you define 'stuffing them freaking everywhere'? My code is long and linear, it's better for me than having zillion classes an 600 small PHP files like NextGEN. I don't put jQuery again in the footer, I don't use jQuery UI either. If you have issues with JIG, contact me from my profile on CodeCanyon from the account you purchased it with, you don't need to edit any code, I'm happy to help. – Firsh Oct 4 '13 at 10:19

In new version of nextGen if you want clean album css you just need

add_action('wp_print_styles', 'wpse_82982_removeStyles');

function wpse_82982_removeStyles() {
share|improve this answer
that's not acquired, don't forget that nextgen has many different styles with different name. – Murhaf Sousli Jan 27 '15 at 20:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.