1

I'm upgrading a site where there are 57,426 files in the /upload directory. I need to sort them as /upload/year/month/filename.ext because this flat non-hierarchical dir is a mess.

There's no image attached to the post content.. every image is a featured image.

How can I move all these files and keep them tied with a post? Any script I can use?

2
  • 1
    That's kind of a bad idea and is hard too, specially when the search engines want to update 57k file paths. You'll get tons of 404 search engine referrals since then. By the way, there shouldn't be a problem with having that much file counts in a folder. The days of poorly limited file systems are over.
    – Johansson
    Commented Mar 14, 2018 at 1:35
  • Page is not accessible outside of our network so I don't care about search engines. Anyway... the whole upgrade marathon started when the wordpress cannot upload new files. As soon as I moved some old files manually the upload was working in that moment. So I think the server has its own limitations.
    – 5ulo
    Commented Mar 14, 2018 at 8:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.