Switching from other plugins

Gallery Z imports galleries from Envira Gallery, NextGEN Gallery, Modula and FooGallery. Each gallery becomes a draft page with a Filterable Gallery of core Image blocks – and the tags become filter categories. Nothing in the old plugin is changed or deleted.

How the import works

  • The importer reads the other plugin’s data straight from the database, so the old plugin doesn’t need to be active – its galleries just have to still be in the database.
  • Each gallery becomes a draft page called “<title> (imported)”: a Gallery Filter (when the images have tags) above a Filterable Gallery of core Image blocks.
  • Tags and filters become Gallery Categories on the images. Existing categories with the same name are reused.
  • Your images stay where they are: Envira, Modula and FooGallery already use the Media Library. NextGEN keeps its own folders, so its files are copied into the Media Library once.
  • Nothing is published until you publish the draft, and the old galleries are left untouched.

Import in the admin

  1. Go to Tools → Gallery Z import. It lists the galleries found for each plugin, with their image count and, if already imported, a link to the page.
  2. Galleries that haven’t been imported yet are ticked. Untick what you don’t want.
  3. Click Import. The results link to each new draft page.
  4. Open a draft, check the layout and categories, and publish it.

Running the import again skips galleries that were already imported. Tick Re-import galleries that were already imported to update their pages from the source instead.

What carries over

From the old galleryIn Gallery Z
Images, in gallery orderImage blocks in a Filterable Gallery
Captions (or titles, where the caption is empty)Image captions, as plain text
Alt textAlt text
Per-image links and “open in new tab”Image links; the gallery’s click behavior becomes Link
Lightbox on (and no custom links)Click behavior Lightbox
ColumnsColumns (up to 8)
Row height of justified galleriesRow height
Masonry or creative layoutMasonry
Justified or automatic layoutJustified rows
Any other layoutGrid
Tags and filtersGallery Categories, plus a filter above the gallery

Where the data comes from

PluginGalleriesBecome categories
Envira Galleryenvira postsImage tags (envira-tag, from Envira’s Tags addon)
NextGEN GalleryNextGEN’s own gallery and picture tablesPicture tags (ngg_tag)
Modulamodula-gallery postsModula filters on each image
FooGalleryfoogallery postsFooGallery attachment tags and categories

NextGEN galleries are imported as a grid with a lightbox; NextGEN’s alt text becomes the alt text and its description the caption.

WP-CLI

The same import from the command line – handy for many galleries or a staging run:

wp gallery-z import list
wp gallery-z import <envira|nextgen|modula|foogallery|all> [--ids=1,2] [--force] [--dry-run]
ArgumentWhat it does
listShows the galleries found, their image count and the imported page, if any
envira, nextgen, modula, foogallery, allImports from one plugin, or from all four
--ids=1,2Only these source gallery IDs
--forceRe-imports galleries that were already imported, updating their pages
--dry-runShows what would be imported, without changing anything
wp gallery-z import all --dry-run
wp gallery-z import envira --ids=12,15 --force

Imported pages remember their source in the _gallery_z_imported_from post meta, e.g. envira:123. That is what makes re-runs skip them.

Replacement shortcodes

Old posts often embed galleries with a shortcode. Turn on Shortcodes on the import page (it is off by default), and these render the imported Gallery Z gallery instead – even while the old plugin is still active:

  • [envira-gallery]
  • [modula]
  • [foogallery]
  • [ngg src="galleries"], [ngg_images] and [nggallery]

Import first, then switch the shortcodes on. With the option on, Gallery Z takes over these shortcodes completely: a shortcode whose gallery hasn’t been imported renders nothing. The imported gallery shows even while its page is still a draft.

NextGEN shortcodes for albums or tags ([ngg src="albums"], [ngg src="tags"]) are not handled.

What is not carried over

The importer brings over the photos, their text and links, and a sensible layout. It does not try to recreate another plugin’s look. Expect to redo:

  • Sliders – slider-type galleries arrive as a grid; switch the layout to carousel yourself.
  • NextGEN albums (galleries of galleries).
  • Pagination and “load more” settings.
  • Lightbox themes and lightbox settings beyond on or off.
  • Spacing (margins, gutters) and hover effects.
  • Caption formatting: caption HTML becomes plain text.

After the import, pick the look you like with the gallery’s caption presets and the filter’s presets. When you are happy, you can deactivate the old plugin; keep the replacement shortcodes on if old posts still use them.

Not sure yet? Run wp gallery-z import all --dry-run first: it lists what would be imported and changes nothing.