Remote Media Bridge
A lightweight WordPress plugin that serves missing local uploads from a remote media library, avoiding large production media copies in development and staging.
by Remote Media Bridge Contributors · github.com/pavlo-bondarchuk/remote-media-bridge
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/pavlo-bondarchuk/remote-media-bridge/archive/refs/heads/main.zipReadme
Remote Media Bridge
Remote Media Bridge lets a development, staging or temporary WordPress site display media from another site's uploads directory without copying the uploads files.
Why it exists
A WordPress database can be cloned quickly, but its uploads directory may contain gigabytes of images and documents. Copying that directory to every developer machine, staging site or temporary environment is slow, wasteful and often unnecessary. Skipping it entirely leaves attachment images and other media broken.
Remote Media Bridge solves this by keeping WordPress attachment records and metadata local while serving the corresponding files from a configurable remote uploads directory. Development and staging environments remain small and quick to deploy without losing their production-like media.
Inspiration and independent implementation
The functional idea was inspired by
codelight-eu/wp-media-from-production:
use production media when a local WordPress clone does not contain the file.
Remote Media Bridge is an independent clean-room implementation. It uses its own name, PHP namespace, settings model, URL mapper and WordPress integrations. No source code was copied. It also adds an administration screen, deployment constants, local-first and always-remote modes, and coverage for responsive images, the media editor, blocks, widgets and REST attachment responses.
How it works
- WordPress keeps using its local media database and attachment metadata.
- Existing local files can be preferred.
- Missing local files are mapped to the configured remote uploads URL.
- An optional mode maps every uploads URL to the remote source.
- New uploads continue to be written locally.
- The plugin makes no remote
HEADrequests; local fallback uses only a local filesystem check.
Setup
- Activate Remote Media Bridge.
- Open Settings → Remote Uploads.
- Enter the full remote uploads base URL, for example:
https://production.example/wp-content/uploads. - Choose whether existing local files should remain local.
- Enable remote uploads and save.
The copied database must contain the media attachment records and attachment metadata. This plugin replaces file delivery URLs; it does not recreate missing database records.
Configuration constants
The UI settings can be overridden per environment in wp-config.php:
define( 'REMOTE_MEDIA_BRIDGE_ENABLED', true );
define( 'REMOTE_MEDIA_BRIDGE_URL', 'https://production.example/wp-content/uploads' );
define( 'REMOTE_MEDIA_BRIDGE_PREFER_LOCAL', true );
REMOTE_MEDIA_BRIDGE_PREFER_LOCAL set to false forces all uploads URLs to
the remote base URL.
Scope
The plugin maps only URLs that point to the current installation's uploads path. Third-party URLs are left unchanged. It supports attachment URLs, responsive image sources, the media library/editor response, rendered blocks and content, widgets, and media REST responses.