Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To add a lightbox to a WordPress gallery, use the Gallery block’s built-in Enlarge on click setting. Visitors can open an image in a larger overlay without leaving the page, then move through the gallery images.

Add a Gallery block and choose its images

  1. Open the page or post in the WordPress block editor. Add a Gallery block from the block inserter, or type /gallery and press Enter.
  2. Upload images or select existing images from the Media Library.
  3. Arrange the images in the order you want. Use the image controls or List View to adjust their order.

Enable the lightbox effect

  1. Select the Gallery block itself so its gallery-wide settings appear.
  2. In the block’s Link options, select Enlarge on click. WordPress describes this as opening an image in a larger lightbox without leaving the page; visitors can move forward and backward through gallery images. See WordPress Gallery block documentation.

That is all that is required for the built-in Gallery block lightbox; you do not need to install a plugin for this option.

Adjust the gallery layout and navigation

While the Gallery block is selected, set the number of columns, image resolution, and whether images are cropped to fit. When Enlarge on click is enabled, you can also choose whether the lightbox navigation buttons display icons, text, or both. Preview the page and check the gallery in the context visitors will see.

Know how image and theme settings differ

Single Image block

The Image block also has an Enlarge on click option, but it applies to an individual image rather than the Gallery block’s gallery-wide behavior. See WordPress Image block documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Theme-level setting for core Image blocks

Theme developers can configure lightbox behavior for the core Image block with settings.blocks.core/image.lightbox in theme.json. WordPress Developer Resources documents this setting as available since WordPress 6.4: enabled controls whether lightbox behavior is enabled, while allowEditing controls whether users see the per-image editing option. This setting is scoped to core/image; it should not be treated as a setting for every Gallery plugin or other gallery implementation. See WordPress Developer Resources: core Image block settings.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to consider a plugin

Consider a plugin only if you need behavior beyond the built-in setting or your existing gallery does not expose it. Check that the plugin supports the blocks and WordPress version used on your site, and look for interactions with native click behavior before enabling both.

  • Lightbox for Gallery & Image Block: Its WordPress.org listing describes support for the standard Gallery and Image blocks. The listing representation reports version 1.16.1, more than 20,000 active installations, and testing up to WordPress 7.0.6; these directory details can change and are not measures of quality or suitability. Check the current listing before installing: WordPress.org plugin listing.
  • EC Lightbox: Its listing describes a workflow that involves adding a class and adjusting Gallery block link settings. It warns that WordPress-native click/lightbox behavior can override the plugin if left enabled. The listing names WordPress 5.0+ and PHP 7.0+ requirements and recommends a block-based setup; verify current compatibility and follow the plugin’s own instructions: WordPress.org EC Lightbox listing.

Plugin setup is separate from the native Gallery block steps above. No plugin is necessary when the built-in Enlarge on click option meets your needs.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.