Skip to content
GPLWP Guides

How to create deep links to WordPress gallery images

Media & Galleries Time About 20 minutes 6 steps Updated 26 Oct 2026

MEDIA & GALLERIES
The short answer

WordPress can link gallery images to their media files or attachment pages, but it does not provide a universal deep-link URL that opens a chosen image in every lightbox. Use a manual image-page workaround, or a gallery addon that creates unique image URLs.

The route
  1. 01Decide what link you need
  2. 02Try the built-in gallery link
  3. 03Build image pages manually
  4. 04Check your gallery plugin
  5. 05Enable Envira image deep links
  6. 06Test links before sharing

What you need

  • Admin access to your WordPress site
  • An existing WordPress gallery or gallery plugin
  • The image URLs or image files you want to share

Decide what link you need

First decide whether you need a link to the original image file, an attachment page, or a URL that opens one image inside a gallery lightbox. These are different destinations. The standard WordPress gallery can link images to a media file or attachment page, but that is not the same as a lightbox deep link.

If visitors must land on a particular image while keeping the gallery controls available, you need a gallery feature that supports unique image URLs.

Try the built-in gallery link

Edit the page containing your Gallery block, select the gallery, and choose the individual image you want to configure. In the image or gallery settings, set the link destination to the media file or attachment page if one of those is sufficient.

Copy the published URL and test it in a private browser window. A media-file link normally opens the image itself, while an attachment-page link opens a WordPress page. Neither destination reliably reopens the image in the gallery lightbox.

Build image pages manually

If you need a separate URL for each image but do not want a gallery addon, create a page or post for each important image. Add the image and its description to that page, then link each thumbnail to the matching page using individual Image blocks or custom links.

This works without a specialist gallery feature, but it creates more pages to maintain. You also lose the normal lightbox experience unless you add separate lightbox behaviour, and changing gallery images later means checking every link by hand.

Check your gallery plugin

If your site uses a gallery plugin, look in its Lightbox, Sharing, URL, or Advanced settings for terms such as deep linking, permalink, direct link, or copy link. The exact control depends on the plugin, so do not assume that a setting called lightbox creates shareable URLs.

Open one image, copy its generated link, and paste it into a new browser window. A correct deep link should open the chosen image rather than only the gallery's first image or the raw upload file.

Enable Envira image deep links

If you use Envira Gallery, install and activate the Envira Gallery Deeplinking Addon. Edit the gallery, open the Lightbox tab, enable Lightbox, then enable Deeplinking and publish or update the gallery. Envira documents this feature as creating a unique URL for each image that opens that image in the lightbox.

Open the gallery on the front end, select the required image, and copy its unique URL from the browser. Share that URL rather than the gallery page or the image file URL.

Test links before sharing

Test each URL while logged out, in a private window, and on a mobile device. Check that the intended image opens, the lightbox navigation still works, and the browser back button returns visitors to the expected page.

If the addon option is missing, confirm that it is activated, clear the relevant plugin cache, and refresh the gallery editor. Envira lists an active addon, cache clearing, and an editor refresh as the first checks when the deeplinking option does not appear.

For a site already using Envira, the Deeplinking Addon is the quickest route when shareable, indexable URLs for individual gallery images matter. It is not necessary if a media-file link or manually created image page meets your needs.

The fast route

Let Envira Gallery Deeplinking Addon do it

Adds unique, indexable URLs for individual gallery images and albums; choose it when shareable, SEO-friendly gallery links matter.

Get Envira Gallery Deeplinking Addon

Sources

  1. wordpress.org /documentation/article/the-wordpress-gallery-classic-editor/…
  2. enviragallery.com /docs/deeplinking-addon/?utm_source=openai

Questions

Can WordPress create a unique URL for every gallery image by itself?
Not as a universal lightbox deep-link feature. WordPress can link gallery images to their media files or attachment pages, but those links do not consistently reopen a selected image inside the gallery lightbox. For true image-level lightbox URLs, use a gallery plugin or addon that explicitly supports deep linking.
Is a link to the image file the same as a gallery deep link?
No. A link to the image file opens the uploaded JPG, PNG, WebP, or another media file directly. A gallery deep link points to a web URL that identifies one image within a gallery and can reopen the gallery lightbox at that image. Use the file link only when the raw image is the destination you want.
Can I make deep links without installing a plugin?
Yes, but the manual method usually means creating a separate page or post for each image and linking gallery thumbnails to those pages. It gives you distinct URLs, but it requires more maintenance and does not automatically preserve the gallery lightbox experience. For a small number of images, this can be perfectly adequate.
Why does my deep link open the gallery but not the selected image?
The URL may be the gallery page rather than the image-specific URL, or the gallery feature may support a lightbox without supporting deep linking. Copy the address after opening the selected image, then test it in a private window. If the setting is missing, verify that the relevant addon is active and clear the gallery or plugin cache.
Do I need the Envira Deeplinking Addon for every WordPress gallery?
No. You need it only when you use Envira Gallery and want its image-specific lightbox URLs. A basic WordPress gallery can link to media files or attachment pages, and another gallery plugin may provide its own deep-link feature. Choose the addon when individual, shareable gallery URLs are more useful than simple image links.