Our WordPress site has thousands of images and most of them are not used for any content anyomore.
The images take about 90% of our total storage so I wanted to get rid of them.
I used a plugin called
cleaner that was claimed to delete unused images from WordPress. The plugin deleted the unused images but also deleted some of the images that were used in gallery. Somehow those images were registered as not used so the plugin deleted them.
Now I cannot see any of the images in the gallery. The whole gallery is empty and I cannot add the images back to the system because WordPress won't recognize them since they've been removed from the database.
Thankfully I had made backups of the files and also the database. So I copied the image back to the original places without overwriting the existing images.
The WordPress wasn't showing the images on the media manager and also the gallery was still empty. So I went and restored just the
wp_postmeta table from the backup database. The gallery still won't show any images and I cannot find any deleted images on the media manager.
I was suggested the
wp_postmeta stored the media files' information.
I could restore the whole database but the website has been updated with new content and going back is not a choice.
Is it possible to revert back the images if I have the old database and old images intact? So that the gallery would show images and the new content stayed intact?