MediaHub 1.7: smarter install and uninstall
Version 1.7 rethinks how MediaHub installs and uninstalls. There is a single-click install of all three modules, a pre-uninstall audit, typed confirmation, and a keep-assets mode for when you want to remove he module but keep your media files intact.
Peter Knight
25 March 2026
Like most ProcessWire modules, MediaHub is essentially a few modules working together: MediaHub (the core), ProcessMediaHub (the admin UI), InputfieldMediaHub (the picker field).
Until now, installing and uninstalling all three required doing each one separately, in the right sequence, without forgetting a step. And uninstalling had no safety net: one click on the checkbox, and everything was gone.
Version 1.7 is an attempt to streamline both of those things.
Single-step installation
ProcessWire has a module dependency mechanism called installs. When a module declares it in getModuleInfo(), ProcessWire automatically installs the listed modules alongside it, in dependency order on installation and in reverse order on uninstall.
MediaHub 1.7 adds this to its core module:
public static function getModuleInfo(): array {
return [
'title' => 'Media Hub',
'version' => 170,
'installs' => ['ProcessMediaHub', 'InputfieldMediaHub'],
// ...
];
}
The result: find MediaHub in the modules list, click Install, and ProcessWire handles the rest. You don't need to think about module order, and you can't accidentally install them in the wrong sequence. It's the same mechanism that ProcessWire's built-in FieldtypePage and InputfieldPage pair uses.
The same applies on uninstall. ProcessWire calls ___uninstall() on each module in reverse order: InputfieldMediaHub first, then ProcessMediaHub, then MediaHub, cleaning up each module's own artifacts before moving to the next.
Unknowingly, I was using this mechanism for many years, but never had to consider it until I created MediaHub.
Uninstall safety
MediaHub assets are standard ProcessWire pages. Each asset page has a file directory at site/assets/files/{page_id}/ containing the original upload and any size variations ProcessWire has generated. Deleting those pages deletes those directories. For a library with a few hundred images, that can mean a lot of data gone in a single action.
The previous uninstall behaviour was simple: tick the checkbox, click Submit, and everything is deleted. There was no warning, no review, and no confirmation step. That may be perfectly acceptable. Module uninstalls do not usually happen by accident, they are limited to superusers, and when you uninstall a module, you generally expect its artefacts to be removed from the CMS.
MediaHub, in my view, is a little different. It handles user files and media, and there may be situations where you want to uninstall the module without necessarily losing the images and files stored in the media library.
MediaHub 1.7 introduces a three-step safety process before the uninstall checkbox takes effect: an audit, a mode selector, and a typed confirmation phrase. I’ll walk through each of them in turn.
Pre-uninstall audit
The Uninstall Preparation panel in module config runs getUninstallAudit() and displays the results before you commit to anything:
- Asset, crop, tag, and collection page counts
- Total pages in the MediaHub tree
- Estimated disk usage across all asset file directories
- Every template, field, and database table that will be removed
The counts update live as you change the mode selection, so you always know exactly what the current setting will affect.
Two uninstall modes
Uninstalling MediaHub works like uninstalling any other ProcessWire module. It removes everything the module owns. That is the expected behaviour and the right default. Remove Everything deletes all assets, crop, tag, and collection pages, which causes ProcessWire to remove their site/assets/files/{page_id}/ directories. Templates, fields, fieldgroups, and database tables are then dropped. Nothing remains as you might expect.

Because MediaHub stores assets as standard ProcessWire pages, there is a second option: Keep Assets (Remove Module Only). This removes all module infrastructure (templates, fields, fieldgroups, tables, admin pages) but leaves the asset pages and their files on disk. Rather than deleting pages, it detaches their templates via a direct SQL update so ProcessWire can drop the templates without removing the page rows or their file directories.

This is not a general-purpose safety net. It is a deliberate migration option for situations where you need the module gone but want the uploaded files intact, for migrating to standard ProcessWire image fields, building a custom replacement, or handing files off to another system.
Typed confirmation
Selecting a mode and reviewing the audit isn't enough to proceed. You also have to type DELETE MEDIA HUB into the confirmation field and click Submit. This stores a session value that the uninstaller checks before doing anything destructive. The check is superuser-only; non-superuser accounts cannot trigger the uninstall regardless of how they reach the endpoint. If you navigate away and come back, the confirmation expires and you have to go through the panel again. The standard ProcessWire uninstall checkbox alone cannot trigger the destructive operations.
What gets removed in each mode
| Artifact | Remove Everything | Keep Assets |
|---|---|---|
| Asset, crop, tag, collection pages | Removed | Kept (templateless) |
| Files on disk | Removed | Kept |
| Templates | Removed | Removed |
| Fields and fieldgroups | Removed | Removed |
| Database tables | Dropped | Dropped |
| Admin pages | Removed | Removed |
Upgrading from an earlier version
If you have MediaHub installed already, the 1.7 files are a drop-in replacement. Copy the updated module folder into site/modules/MediaHub/, go to Modules > Refresh, and ProcessWire will pick up the new version. No database migrations are needed as there are no schema changes in 1.7.
After refreshing, the Uninstall Preparation panel will be available in the MediaHub module config page. The old uninstall checkpoint (typing the confirmation phrase) is unchanged; the mode selector and expanded audit are additions on top of it.
Download
MediaHub 1.7 is available from the downloads page. The full changelog is in the documentation.