How to display EXIF metadata in WordPress galleries
The default WordPress gallery does not display EXIF metadata. You can add it with a custom shortcode or template that reads each attachment’s image metadata, but a gallery addon is quicker and easier if you want camera settings, capture details, or GPS data shown consistently.
- 01Check the source images
- 02Choose the fields to publish
- 03Know the native limitation
- 04Build the manual route
- 05Preserve missing metadata
- 06Use the fast gallery route
What you need
- Administrator access to WordPress
- Original images containing EXIF metadata
- A gallery already created or ready to create
- A child theme or code-snippet method if using the manual route
Check the source images
Open a few original JPEG or TIFF files in a desktop photo application and confirm that the fields you want to show are present. Common fields include camera make and model, aperture, shutter speed, ISO and capture time. WordPress can read image metadata during upload, but an image with no EXIF data cannot display it later.
Decide whether GPS coordinates should be public. Location data can reveal a home address, private event venue or the exact place where a photograph was taken.
Choose the fields to publish
Keep the display useful rather than showing every available tag. Camera model, lens, aperture, shutter speed, ISO and focal length are usually suitable for photography portfolios. Treat GPS coordinates, timestamps and creator information separately because they may disclose private or sensitive details.
Plan whether the metadata should appear below each thumbnail, inside the lightbox, or in both places. Gallery tools commonly provide separate controls for these views.
Know the native limitation
The built-in WordPress gallery shortcode displays images and captions, but it has no standard setting for printing EXIF fields beside each image. WordPress does store attachment metadata, including an image_meta array, and its image-processing functions can read fields such as aperture, camera, ISO and shutter speed. Displaying those values still requires custom output or a plugin.
Build the manual route
For a code-based solution, have a developer create a shortcode or gallery template that loops through the image attachment IDs, reads the attachment metadata, selects approved fields and prints them with escaped HTML. The implementation can use WordPress attachment metadata rather than reading arbitrary files directly, or read the original image when a field is not available in the stored metadata.
This route is fine for a small, fixed gallery, but it needs maintenance when your theme, gallery markup or image workflow changes. It also will not automatically provide gallery and lightbox settings, mobile layout controls or a friendly field selector.
Preserve missing metadata
If the original file contains EXIF data but the generated gallery sizes do not, check how image processing is configured. WordPress documents the image_strip_meta filter for controlling whether metadata is stripped from resized images; returning false can preserve EXIF, XMP and IPTC data in generated sizes. This should be handled by someone comfortable with PHP and tested after WordPress updates.
Do not preserve or expose GPS data by default. Also remember that changing this setting affects image privacy and may increase the amount of metadata stored in public files.
Use the fast gallery route
For the quickest setup, install and activate the Envira Gallery EXIF Addon, then create or edit an Envira gallery. Open the gallery’s EXIF settings, select the fields to show in gallery and lightbox views, configure the mobile display if needed, and publish or update the gallery.
If the data is missing, first confirm that the source files contain EXIF information. Then check that the gallery uses a specific column count rather than an automatic column setting, confirm that the server can run exif_read_data(), and remember that images uploaded before the addon was activated may need to be uploaded again.
Let Envira Gallery EXIF Addon do it
Adds customizable camera, settings, and GPS details to Envira galleries for photographers who want technical image context.
Sources
- enviragallery.com /docs/exif-addon/?utm_source=openai
- developer.wordpress.org /reference/functions/gallery_shortcode/?utm_source=openai
- developer.wordpress.org /reference/functions/wp_get_attachment_metadata/?utm_source=…
- developer.wordpress.org /reference/hooks/image_strip_meta/?utm_source=openai
- enviragallery.com /how-to-display-exif-data/?utm_source=openai
Questions
- Can the default WordPress gallery display EXIF metadata?
- No. The default gallery shortcode displays images, links and captions but does not provide a standard control for showing EXIF fields. WordPress can read and store image metadata, so a developer can add a custom shortcode or template, but displaying camera settings in a normal gallery requires custom code or a gallery extension.
- Why is EXIF metadata missing after uploading an image?
- EXIF may be missing because the original file never contained it, because an image editor removed it, or because WordPress stripped metadata while creating resized copies. Check the original file first, then review image-processing settings and the documented <code>image_strip_meta</code> filter if you need metadata preserved in generated sizes.
- Can I display GPS coordinates in a WordPress gallery?
- Yes, a suitable gallery extension or custom template can display GPS information when it exists in the image metadata. Consider the privacy risk before enabling it: public coordinates can identify a home, workplace, private event or exact shooting location. Show GPS data only when the photographer has deliberately chosen to publish it.
- Why does EXIF show in the lightbox but not the gallery?
- Gallery and lightbox views can use separate EXIF display settings, so enabling one does not always enable the other. With Envira’s addon, check both view settings and the mobile options. Also check the gallery column setting, because the documentation notes that automatic columns can prevent EXIF from appearing in the gallery view.