Reverting Images
How to restore original images after processing.
Every image processed through Picture Optimizer can be reverted to its original state with one click. The revert system restores the original file, undoes all URL changes, and removes redirect rules.
How to Revert
- Go to Media Library in WordPress
- Find the processed image (it will show a "Processed" status)
- Click Revert to Original in the row actions
The plugin will restore the original image and confirm success.
What Gets Restored
File Restoration
- The original file is copied back from the backup directory (
image-forge-originals/) - The processed file and its thumbnails are deleted
- WordPress regenerates thumbnails from the restored original
- The attachment MIME type is restored if the format had changed
URL Reversal
- All URL replacements made during processing are reversed — new URLs in post content, post meta, and options are changed back to the original URLs
- The replacement map stored in
_image_forge_url_replacementsis used to perform the reverse search-and-replace
.htaccess Cleanup
- The
RedirectMatch 301rule added during processing is removed from.htaccess - The redirect block is cleanly maintained — if all redirects are removed, the entire
# BEGIN/END Picture Optimizer Redirectsblock is removed
GUID Restoration
- The attachment
guidcolumn is updated back to the original URL
Action Hook
After revert, the plugin fires:
This allows CDN plugins or custom integrations to purge caches for the restored URL.
What Is Preserved
After reverting, the following data is kept for reference:
_image_forge_metadata— The AI-generated metadata remains stored (can be re-applied later)_image_forge_status— Set torevertedto indicate the image was processed and then reverted
Re-Processing After Revert
A reverted image is treated as unprocessed by the smart skip system. If you select it for processing again, it will go through the full pipeline without being skipped.
Reverting is completely safe. The original file is never modified — it's stored as a pristine copy in the backup directory until you revert.
