Restore media is a WordPress ability from Imagify — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Restore media
DestructiveRestores a previously optimized media attachment back to its original file using the stored backup.
Requires the Imagify plugin on WordPress 6.9+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). Most abilities are gated by the Imagify 'manage' capability, resolved through Imagify's own capability abstraction (honors the imagify_capacity filter and multisite network-admin logic; equivalent to manage_options by default); the bulk-optimize, generate-missing-nextgen, and restore-media abilities instead check the WordPress 'manage_options' capability directly.
What it does
This ability restores a single WordPress media attachment (or custom-folder file) to its original, pre-optimization state by calling the plugin's existing AbstractProcess::restore() method, which requires that the 'keep backup of original images' setting was enabled at optimization time. It resolves the correct optimization process for the given media_id (trying the WordPress media-library context first, then falling back to the custom-folders context), verifies the media is actually optimized, and returns an error if no backup is available or the media can't be found. On success it reports the restored original file's size in bytes.
See it in action
You ask your AI assistant
"Restore media attachment #4821 back to its original, unoptimized file."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| media_id | integer | Yes | The WordPress attachment ID to restore. |
Returns
An object with 'status' (success or error), 'restored_size' (the restored original file size in bytes, or null on error), and 'error_message' (null on success).
Permission
The current user must have the WordPress 'manage_options' capability (checked directly via current_user_can(), not routed through Imagify's capability abstraction).
More Imagify abilities
Bulk optimize
Schedules a bulk image-optimization run across the WordPress media library or Imagify's custom folders.
Generate missing next-gen versions
Queues generation of missing WebP/AVIF versions for every already-optimized image on the site.
Get account status
Reports the connected Imagify account's plan, quota consumption, and API key validity.
Get media optimization status
Retrieves the optimization status and size metrics for a single media library attachment.
Get next-gen format coverage
Reports how many optimized images are still missing a next-gen (WebP/AVIF) version and which next-gen format is configured.
Get optimization statistics
Returns aggregate optimization savings for both WordPress media and custom (non-Media-Library) folders.