Automatically Extracting Metadata from Photos in Wordpress
Wherein we extract EXIF and IPTC metadata from photos in Wordpress
On 75CentralPhotography, in the spirit of transparency (as I previously touched-on here), we display the EXIF data, location and weather conditions for almost all of our photos of the day:

We don't manually add this data to each photo post, instead, we use a Wordpress plugin we built to extract this data from the first photo in each post (which works fine since each post only has one photo). This plugin then stores this data in custom metadata fields on the post so that they can be surfaced in the user interface.
Having knocked around a janky version of this plugin for a while, we finally took some time to solidify it a bit and make it something that we could share publicly, on the off-chance that anyone else might want to share the same data on their photo site. So, here it is: version 1 of EXIFHarvester. Description/release notes are below, but you can download the plugin from the releases page of the Github repository here. Feel free to make any pull requests for improvements!
Release Version 1.0.0
Transform your photography website with EXIF Harvester - a comprehensive WordPress plugin that automatically extracts and organizes rich metadata from your images. From camera settings to GPS coordinates to historical weather conditions, EXIF Harvester captures the complete story behind every photograph.
What is EXIF Harvester?
EXIF Harvester is a powerful WordPress plugin that automatically processes images in your posts and extracts valuable metadata including camera settings, GPS coordinates, timestamps, and even weather conditions from when and where your photos were taken. Instead of manually entering this information, the plugin does all the heavy lifting for you, storing everything in easy-to-access WordPress custom fields.
Key Features
📸 Complete Camera & Technical Data
- Camera Model: Automatically detects and formats camera names with extensive mapping database
- Lens Information: Captures and prettifies lens data with customizable mapping support
- Camera Settings: F-stop, shutter speed, ISO, focal length automatically extracted
- Image Properties: Dimensions, megapixels, aspect ratio calculations
- Smart Mappings: Converts cryptic camera codes (e.g., "ILCE-7RM2") to readable names ("Sony a7RII")
🌍 GPS & Location Intelligence
- GPS Coordinates: Latitude, longitude, and altitude extraction from EXIF data
- Timezone Detection: Uses TimezoneDB API for accurate timezone and GMT offset calculation
- Location Names: Extracts city, state, country from IPTC metadata
- Location Corrections: Built-in database to fix truncated location names automatically
- Hierarchical Place Taxonomy: Automatically organizes locations in a structured WordPress taxonomy
- Geohash & Plus Codes: Generates location codes for advanced mapping integration
🌤️ Weather Data Integration
- Historical Weather: Retrieves actual weather conditions for when and where your photo was taken
- Temperature & Conditions: Uses PirateWeather API for accurate historical data with dual-unit support
- Smart Timing: Converts local photo time to UTC for precise weather lookups using timezone data
- Automatic Retry: Handles API failures gracefully with fallback mechanisms
- Time-aware Processing: Accounts for daylight saving time and timezone boundaries
📅 Comprehensive Date/Time Processing
- Original Timestamp: Preserves exact date/time when photo was taken
- Multiple Formats: Year, month, day, hour, minute in various formats for flexible display
- Day of Week: Automatically determines what day the photo was taken
- Time Context: Morning, afternoon, evening, night classification
- Unix Timestamps: For precise time calculations and API integration
🎛️ Advanced Management Features
- Smart Mappings: Extensive camera and lens databases with pretty names
- Admin Interface: Clean WordPress admin pages for managing all mappings
- Location Corrections: Fix truncated location names with full versions
- Real-time Processing: Manual EXIF refresh from post edit screens without saving
- Bulk Processing: Works on both new posts and updates
- Live Preview Metabox: See extracted metadata instantly in the post editor
Installation
Via WordPress Admin (Recommended)
- Download the EXIF Harvester plugin zip file
- Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Choose the zip file and click Install Now
- Activate the plugin
- Navigate to EXIF Harvester in your admin menu to configure settings
Manual Installation
- Extract the plugin files to
/wp-content/plugins/exif-harvester/ - Activate the plugin through the Plugins menu in WordPress
- Configure your settings under EXIF Harvester → Settings
Configuration & API Setup
Required API Keys
To get the full benefit of EXIF Harvester's features, you'll need API keys for:
PirateWeather API (Weather Data)
- Visit: pirate-weather.apiable.io
- Sign up for a free account
- Copy your API key and paste it in EXIF Harvester → Settings
- Free tier: 20,000 API calls per month
TimezoneDB API (Accurate Timezone Data)
- Visit: timezonedb.com/api
- Register for a free account
- Copy your API key and paste it in EXIF Harvester → Settings
- Free tier: 1,000 API calls per month
⚠️ Important: Without API keys, the plugin will still extract EXIF data, but weather and timezone information will be inaccurate or unavailable.
Basic Setup
- Go to EXIF Harvester → Settings
- Select Post Types: Choose which post types should have EXIF processing (posts, pages, custom types)
- Enable Weather Data: Toggle weather data collection on/off
- Add API Keys: Enter your PirateWeather and TimezoneDB API keys
- Configure Options: Set preferences for processing and display
Advanced Features
- Camera Mappings: Add custom camera name translations in EXIF Harvester → Camera Mappings
- Lens Mappings: Manage lens name formatting in EXIF Harvester → Lens Mappings
- Location Corrections: Fix truncated location names in EXIF Harvester → Location Corrections
How It Works
Automatic Processing
When you save or update a post, EXIF Harvester:
- Finds the first image in your post content automatically
- Extracts EXIF data from the image file using PHP's EXIF extension
- Processes GPS coordinates and looks up accurate timezone information via TimezoneDB
- Retrieves weather data for the photo's exact location and time via PirateWeather
- Applies corrections using built-in mapping databases
- Stores everything in WordPress custom fields for easy access
- Creates place taxonomy terms for hierarchical location organization
Manual Processing with Metabox
Use the "Refresh EXIF Data" button in the post editor sidebar to:
- Re-process EXIF data without saving the post
- Retry failed weather API calls when initial attempts fail
- Update metadata when images are changed or added
- Preview results instantly before publishing
Supported Custom Fields
The plugin creates and populates 35+ custom fields including:
Camera & Technical: camera, lens, fstop, shutterspeed, iso, focallength
GPS & Location: GPS, GPSLat, GPSLon, GPSAlt, location, city, state, country, timeZone, gmtOffset
Date & Time: dateTimeOriginal, dateOriginal, yearOriginal, monthOriginal, dayOriginal, hourOriginal, minuteOriginal, timeOriginal, timeOfDayContext, unixTime
Weather: temperature, wXSummary
Image Properties: photo_width, photo_height, photo_dimensions, photo_megapixels, photo_aspect_ratio
Content: caption (automatically extracted and cleaned)
Location Codes: geoHash, GPCode (Google Plus Codes)
Use Cases
Photography Blogs
Perfect for photography websites where you want to display technical details about each shot automatically without manual data entry.
Travel Blogs
Automatically organize posts by location with GPS data and show weather conditions during your travels for enhanced storytelling.
Portfolio Sites
Professional photographers can showcase technical expertise with automatically extracted camera settings and shooting conditions.
Documentary Projects
Historical or documentary photography projects benefit from precise timestamp, location, and environmental data preservation.
Stock Photography
Enhance image metadata for better searchability and organization in stock photography workflows.
Requirements
System Requirements
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- EXIF Extension: PHP EXIF extension (usually enabled by default)
- CURL: For weather and timezone API calls
- Memory: Sufficient memory for processing image files
Recommended Setup
- TimezoneDB API Key: For accurate timezone detection
- PirateWeather API Key: For historical weather data
- WordPress Cron: Enabled for processing queued items
Developer Features
Hooks & Filters
EXIF Harvester provides WordPress hooks for developers:
- Post save processing: Automatic triggering on content updates
- Custom field mapping functions: For theme integration
- Location taxonomy integration: For advanced location features
- AJAX endpoints: For admin functionality extension
Database Structure
- WordPress Custom Fields: Uses standard WordPress metadata (no additional tables for metadata)
- Three Mapping Tables: Cameras, lenses, and location corrections for data enhancement
- Hierarchical Place Taxonomy: For organized location data
- Clean Uninstall: Optional complete data removal
Security Features
- Nonce Verification: All AJAX requests properly secured
- Capability Checks: Admin functions restricted to appropriate users
- Input Sanitization: All user input properly sanitized and validated
- API Key Protection: Secure storage and transmission of API credentials
Privacy & Performance
Data Handling
- Local Processing: EXIF data extracted locally, only coordinates sent to APIs
- API Efficiency: Smart caching and fallback mechanisms to minimize API calls
- User Control: Complete control over what data is collected and stored
Performance Optimization
- Efficient Processing: Only processes posts with images
- Smart Caching: Avoids duplicate API calls for same locations/times
- Graceful Degradation: Continues working even if APIs are unavailable
Support & Updates
EXIF Harvester includes:
- Comprehensive Error Logging: Detailed debugging information for administrators
- Graceful API Failure Handling: Continues operation when external services fail
- Extensive Default Mappings: Built-in database of popular cameras and lenses
- User-Friendly Admin Interface: Intuitive management of all plugin features
- Clean Architecture: Well-organized code following WordPress best practices
Get Started Today
Transform your photography website with automatic metadata extraction that tells the complete story behind every image. Download EXIF Harvester and let your photos reveal their technical details, capture locations, shooting conditions, and environmental context automatically.
Perfect for: Photography blogs, travel sites, portfolio websites, stock photography, documentation projects, and any WordPress site featuring original photography where metadata matters.