I have a media library containing 500 images. I need to make some modifications to these images in Photoshop (batch resizing and color correction). I'm looking for a way to simply overwrite the files in the 'wp-content/uploads' directory without having to re-upload them via the media library. The file names will stay the same. I also want to be able to retain the title, alt, caption and description associated with the old image files.

What would be the most efficient way of going about this?


Well, I think the easiest way would be the following:

  • Download your wp-content/uploads/ folder so you have all images on your hard disk
  • Remove the images WordPress has automatically generated (the ones with -*x*.jpg, maybe read this if you have SSH access as a filename)
  • Optimize your base images with Photoshop
  • Reupload the images into the wp-content/uploads/ folder
  • Use a plugin like "Regenerate Thumbnails" (I use that one often) to rebuild all the necessary images

This should work, but I have not tested it.

Important! Do not change the filenames of your base-images, otherwise WordPress will not find them after reuploading. (Yeah, seems obvious, mentioned it just for clarification...)

  • Thanks! I'm going to give this a try. Do you happen to know if WP stores the image dimensions from media library items in the database? – Steed-Asprey Oct 28 '15 at 12:37
  • Actually it is saving that in the wp_postmeta table, yes. It´s serialized and saved as _wp_attachment_metadata. – flomei Oct 28 '15 at 20:59
  • 1
    This sorta worked! I could not get the SSH script to delete the files for some reason, so I used this plugin: wordpress.org/plugins/force-regenerate-thumbnails – Steed-Asprey Nov 1 '15 at 18:55
  • I´m glad it worked for you. – flomei Nov 1 '15 at 20:41

Try to download the uploads folder all together or you will lose the quality of the images, then re-upload them with the same name and description to the same folder

  • 1
    While I tend to agree with you, can you please elaborate on the answer a bit. – s_ha_dum Oct 27 '15 at 20:03
  • I'm not sure this method will work since I'm be resizing the images, right? – Steed-Asprey Oct 27 '15 at 20:05
  • @s_ha_dum you have to download it from the uploads folder or download the uploads folder all together then modifying it, because of this way you wont lose your image quality – bbadawee Oct 27 '15 at 23:26
  • 1
    @bzhar93 : edit your answer instead of posting clarifications in the comments. – s_ha_dum Oct 27 '15 at 23:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.