I am working on a client's site. It has about 8GB of images in the uploads folder. Unfortunately, from day one, years ago, uploaded media files were not set to be organized into month-, year- based folders. This 8GB of images are all lumped in one single folder(!). This causes untold headaches anytime I need to do anything on their uploads folder. Is there any recommended approach to efficiently reorganize the uploads folder, so that all these images are broken down into more manageable subfolders? Does anyone know if it is possible to retroactively place uploaded media into -month, -year based folders? Thanks so much for your input!

  • Not so easy. You need a script that: checks the date of the post/page the content is attached to, uploads the files in proper year-month subfolders, inserts the attachment via wp_insert_attachment and registers the metadata of the attachment via wp_generate_attachment_metadata. – Stefano Tombolini Feb 22 '18 at 7:14
  • Changing the Settings in Media (organize by year-month) is not retroactive unfortunately. – Stefano Tombolini Feb 22 '18 at 7:16
  • Stefano, thank you so much for your answer. I was hoping someone had already dealt with all the complexities of this issue and had a plugin or something similar to share. I will keep reviewing and playing with media management plugins to see which one gets the closest to what I need. – Mauricio Feb 22 '18 at 21:37

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.