Plugin Directory

NextGEN Gallery Optimizer

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

NextGEN Gallery Optimizer

NextGEN Gallery Optimizer improves your site's page load speed, by preventing NextGEN's scripts and stylesheets from loading on posts and pages without NextGEN Gallery content.


If you're using NextGEN v2 (v2.0.0 to v2.1.15), Optimizer also provides you with complete granular control of the scripts and stylesheets that load on posts and pages with NextGEN Gallery content. For a live example of these settings in action, please view the source of Optimizer's homepage (a NextGEN v2 gallery page with AJAX pagination) in your browser.

If you're using NextGEN Legacy (v1.6.2 to v1.9.13) or NextCellent Gallery (v1.9.14 to v1.9.26), Optimizer will intelligently fine-tune all your posts and pages with NextGEN Gallery content automatically... detecting every shortcode and setting, to only load the scripts and stylesheets required on each page.

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 appropriate posts and pages with NextGEN Gallery content. The result? Gorgeous galleries and a speedy site.

Optimizer v2.1.2 currently supports (and is tested compatible with) NextGEN Gallery (v2.0.0 to v2.1.15), NextGEN Legacy (v1.6.2 to v1.9.13) and NextCellent Gallery (v1.9.14 to v1.9.26).

NextGEN Gallery Optimizer Pro

Upgrade to Optimizer Pro for the new NextGEN Gallery Deactivator feature.
A whole new level of speed optimization.
Only load NextGEN’s PHP code on posts and pages with NextGEN Gallery content.

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 & styles from loading on non-NextGEN posts/pages.
  3. Additionally fine-tunes NextGEN's scripts and styles on NextGEN posts/pages.
  4. 1-click install of the Enhanced Fancybox Lightbox to display your images in style.

NEW in Version 2.1.2:

  1. Tested fully compatible with NextGEN Gallery up to v2.1.15.
  2. Tested fully compatible with NextCellent Gallery up to v1.9.26 (unchanged).
  3. Tested fully compatible with WordPress up to v4.3.
  4. Updated all in-plugin documentation to reflect our new "tested up to" compatibility.
  5. Added detection of base_url query string parameter pages in NextGEN Gallery Deactivator (Pro).
  6. Added detection of NextGEN's "Manage Gallery" meta links in NextGEN Gallery Deactivator (Pro).

NEW in Version 2.1.1:

  1. Tested fully compatible with NextGEN Gallery up to v2.1.0.
  2. Tested fully compatible with NextCellent Gallery up to v1.9.26.
  3. Tested fully compatible with WordPress up to v4.2.2.
  4. Updated all in-plugin documentation to reflect our new "tested up to" compatibility.
  5. Added 256x256, 128x128 and svg plugin icons for the new WordPress plugin installer screen.

NEW in Version 2.1 (at a glance):

  1. Now fully compatible with the major update of NextGEN Gallery v2.0.71 (up to v2.0.77).

  2. Now fully compatible with the major update of NextCellent Gallery v1.9.25 (up to v1.9.25.3).

  3. Now fully compatible down to WordPress v3.7.

  4. Tested fully compatible with WordPress v4.1 and v4.1.1.

  5. Now fully compatible with the NextGEN Plus (v1.1.3) and NextGEN Pro (v2.1.4) premium add-ons.

  6. Improved plugin descriptions and documentation throughout.

Please see Optimizer v2.1's development blog post for the full list of improvements and additions.

NEW in Version 2.0 (at a glance):

  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 see Optimizer v2.0's development blog post 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.7 or higher
Compatible up to: 4.3.1
Last Updated: 3 months ago
Active Installs: 10,000+


3.1 out of 5 stars


1 of 1 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