Fixing image names for a site being restored

The WordPress site went down last week and is being restored. When a image(image1.jpg) was uploaded a week ago using the back-end of WP, it likely was resized during the upload process and was stored with a name like "image1-330x450.jpg" which was being referenced in the posts. There are 800 such images.

  1. How can this be fixed because manually looking at each post's HTML, finding the image name, renaming the image from the backup files, then uploading it again is tedious and time-intensive?

  2. Also, there are many image thumbnails which used to be visible in Media library but now are not. How can this be fixed?

Any advice would be appreciated.

  • For #1, why rename the images? They should all retain their names - both on the server and the DB. Same goes for the paths for all the images - provided the domain didn't change. – montrealist Jan 26 '16 at 23:27
  • When a picture(image1.jpg) was uploaded from the user's computer it was named image1.jpg. During upload, the user specified some size(330x450) for it which WordPress(WP) changed, then WP likely stored it as image1-330x450.jpg. I restored the image1.jpg to uploads folder in wp-content, but the posts do not have images, because they expect an image with name image1-330x450.jpg when I looked at their HTML. User claims he did not name his image image1-330x450.jpg but as image1.jpg so to ensure posts have pictures, the images need to be renamed. Am I missing something? – p_s Jan 26 '16 at 23:51
  • You always want to restore ALL the images under wp-content/uploads, as they were originally. – montrealist Jan 29 '16 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.