Ready to get started?Download WordPress

Plugin Directory

NextGEN Gallery Optimizer

The essential add-on for the NextGEN Gallery WordPress plugin.

Author's note:

I'm afraid Optimizer v2.0 is not currently compatible with the major NextGEN Gallery (v2.0.7x) update, released on the 19th of February 2015.

As key parts of the NextGEN v2.0 API were completely removed in this update (without any graceful deprecation, or backwards-compatibility in place), Optimizer (and likely many other NextGEN extensions) will display fatal errors, and not function correctly with this release, until all affected integration components are rewritten.

I'm currently working on compatibility with NextGEN v2.0.7x (and hope to have an update ready soon), but in the meantime, if you've already updated to NextGEN v2.0.7x, I would recommend rolling-back to the immediately-preceding stable release of NextGEN v2.0.66.33. Our broad, existing compatibility with NextGEN (v2.0.0 to v2.0.66.33), NextGEN Legacy (v1.6.2 to v1.9.13) and NextCellent Gallery remains unaffected.

Apologies in advance for any inconvenience, and thank you for your patience.


NextGEN Gallery Optimizer

NextGEN Gallery Optimizer improves your site's page load speed by preventing NextGEN's scripts & stylesheets from loading on pages without galleries.


If you're using NextGEN 2.0, Optimizer provides you with complete granular control of the scripts and stylesheets that load on your gallery pages.

For a live example of these settings in action, please view the source of Optimizer's homepage (a NextGEN 2.0 gallery page with AJAX pagination) in your browser.

If you're using the original NextGEN Gallery (v1.6.2 and up) or the NextCellent Gallery fork, Optimizer will intelligently fine-tune all your gallery pages automatically... detecting every shortcode and setting to only load what's necessary.

For a full overview of the optimization process, please see...

Optimizer also includes an enhanced version of the fantastic Fancybox lightbox script, and only loads it on gallery pages. The result? Gorgeous galleries and a speedy site.

Optimizer v2.0 now supports NextGEN 2.0, NextGEN Legacy and the NextCellent Gallery fork.

NextGEN Gallery Optimizer Pro

Upgrade to Optimizer Pro for the new NextGEN Gallery Deactivator feature.
A whole new level of speed optimization that only loads NextGEN’s code on gallery pages.

Upgrade to Optimizer Pro for the new Dynamic Fancybox Settings Interface.
The fastest and easiest way to customize Fancybox.
Set title styles, background color and opacity, make Fancybox responsive and more.

For more information, please see the following...

Key features:

  1. Improves your site's page load speed when using NextGEN Gallery.
  2. Prevents NextGEN's scripts and styles from loading on non-gallery pages.
  3. Additionally fine-tunes NextGEN's scripts and styles on gallery pages.
  4. Lets you easily install an enhanced Fancybox to display your images in style.

NEW in Version 2.0:

  1. Now optimizes the new NextGEN v2.0.xx codebase, and the new NextGEN Legacy fork called NextCellent Gallery.

  2. Completely rewritten utilizing class encapsulation, and with a strong focus on WordPress coding standards and best practices.

  3. Virtually all of Optimizer's former Premium functionality for NextGEN Legacy is now included in the Basic version here at the WordPress repository.

  4. Completely rounds out support for all features and options available in NextGEN Legacy (and the NextCellent Gallery fork).

  5. Optimizer Pro is introduced, including the all new NextGEN Gallery Deactivator feature, and the Dynamic Fancybox Settings Interface.

  6. Optimizer's website is introduced.

Please view the changelog for the full list of improvements and additions.

NEW in Version 1.1.2:

  1. Tested compatible with WordPress 3.5 (Basic and Premium)
  2. Latest Google-hosted jQuery 1.8.3 to match new WP version (Basic and Premium)
  3. New admin notifications to assist with NextGEN installation (Basic and Premium)
  4. Improvements to Optimizer's automatic Fancybox installation (Basic and Premium)

This release brings us up to date with WordPress 3.5, and features a number of additions and refinements to improve user experience. These include new admin notifications to assist users who don't have the required NextGEN Gallery plugin installed and activated, new step-by-step installation instructions via the WordPress admin (to ensure the correct file ownership and permissions are set), a streamlined settings page, and improvements to Optimizer's automatic Fancybox installation.

NEW in Version 1.1.1:

  1. Dynamic messaging for admins on unsupported shortcodes (Basic)
  2. Checks to ensure jQuery isn't being deregistered (Basic and Premium)
  3. Includes blank index.php files for enhanced security (Basic and Premium)

This release aims to improve communication between Optimizer and end-users, including dynamic messaging for admins on unsupported shortcodes, and a clever regex that detects and alerts you if your theme (or child-theme) is deregistering jQuery...which causes Fancybox to break. Additionally, security is enhanced with the addition of blank index.php files in each folder, preventing bots from scanning your server's directory tree.

NEW in Version 1.1 (first major release):

  1. Fancybox title now included in image height calculations (Basic and Premium)
  2. New options: WordPress's included jQuery or go Google-hosted (Basic and Premium)
  3. Support for the Thickbox effect (Basic and Premium)
  4. Support for the Shutter effect (Basic and Premium)
  5. Support for JW Image Rotator slideshow integration (Premium)
  6. Support for AJAX pagination on [imagebrowser id=x] (reqs. Shutter) (Premium)
  7. Fancybox gets extra fancy...auto-resizes when the browser is resized (Premium)

This first major release for Optimizer sees a number of new additions and features... Fancybox now includes space for a single-line title in its image height calculations, vastly improving vertical alignment of the lightbox. Also, Optimizer now lets you choose between using WordPress's included jQuery (for greater compatibility), or the Google-hosted version (for faster page loads). Support for the Thickbox and Shutter effects has also been added thanks to user requests.

On top of this, the Premium version now includes AJAX pagination when using Shutter on the [imagebrowser id=x] shortcode, supports the JW Image Rotator for slideshows and features a super-fancy, auto-resize function that resizes Fancybox when the browser window is resized!

NEW in Version 1.0.8:

  1. Tested fully-compatible with WordPress 3.4 (Basic and Premium)
  2. Improved compatibility with other plugins and themes (Basic and Premium)
  3. Display fix for Fancybox when no title is available (Basic and Premium)
  4. Latest jQuery 1.7.2 (Basic and Premium)

This version adds the jQuery.noConflict(); method for improved compatibility with plugins and themes using other javascript libraries/frameworks including script.aculo.us, Prototype and MooTools. It also includes a fix for Fancybox/NextGEN Gallery integration where a small white line would appear underneath the lightbox when no title was set.

NEW in Version 1.0.7:

  1. Improved compatibility with other scripts and plugins. (Basic and Premium)
  2. Minor bug fix in admin message. (Basic and Premium)

This version enhances compatibility with other plugins and includes a few minor improvements.

NEW in Version 1.0.6:

  1. Fully-automated Fancybox installation! (Basic and Premium)

This version features completely automated Fancybox integration with NextGEN Gallery, so now you can be up and running even faster.

NEW in Version 1.0.5:

  1. Precision matching with WordPress's built-in shortcode finder.
  2. NextGEN Gallery Optimizer Premium (an optional upgrade for a small donation).

This version uses WordPress's native get_shortcode_regex() function for EXACT shortcode matching, ensuring scripts and styles don't load unexpectedly unless the FULL shortcode is present. If WordPress doesn't detect a shortcode, neither do we!

Also, this update introduces the new NextGEN Gallery Optimizer Premium version, which adds support for ALL TEN of NextGen's shortcodes, support for the [show as slideshow] link, the removal of NextGEN's version number comment and more.

NEW in Version 1.0.4:

  1. Easier set up

This version automatically redirects first time users to the options page on activation and sets a default stylesheet for easier set up.

NEW in Version 1.0.3:

  1. Optimized code for better compatibility and page load speed
  2. Improved settings page

This update results in faster page loads on gallery pages by avoiding duplicate scripts. It reduces the chance of conflicts with other plugins and makes setting up Fancybox even easier.

NEW in Version 1.0.2:

  1. Support for WordPress Pages
  2. Fancybox overlap fix
  3. Fix for Fancybox not working in IE6 & IE8
  4. Latest JQuery

This update lets you display galleries on both Posts AND Pages in style, but only load code when they're present.

It also fixes an issue where some page elements overlap Fancybox and prevent the close button from functioning (in particular the title text, header image and menu bar in Twenty Eleven).

It fixes the "Fancybox not working in IE6 & IE8" issue by automatically updating the Fancybox stylesheet to use the correct file paths, and we're now running Fancybox on JQuery version 1.7.1, resulting in faster page loads where galleries are present.

Requires: 3.8 or higher
Compatible up to: 4.1.1
Last Updated: 2015-2-23
Active Installs: 10,000+


3 out of 5 stars


3 of 8 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 40,5,2 0,1,0 50,2,1
100,1,1 33,3,1 0,1,0
29,7,2 60,5,3 100,1,1
67,3,2 50,4,2