0

Wordpress seems to like storing files by year/month. This is nice, but not good enough for busy websites with loads of content. It'll be much nicer to have the folders reflect the exact same structure as the permalinks for them:

/wp-content/uploads/custom-post-type/category/postname-1.jpg
/wp-content/uploads/books/fiction/the-nun-1.jpg
/wp-content/uploads/books/romance/the-italian-spring.jpg

And so on. Is it possible to do this with some simple customized function in functions.php, or via some plugin?

Thanks for any pointers.

1 Answer 1

1

There is another thread discussing this, with multiple answers. You might check to see if they address your desires. They offer some code, and an available plugin solution.

2
  • Thank you. This is a very good plugin. Will need to see how to make it play well with EWWW image optimisation and Offload S3.
    – Khom Nazid
    Sep 1, 2019 at 2:31
  • Just to add, in case this helps someone. Offload S3 won't work with this. I removed that plugin, and just ensured that my /uploads folder is upward-copying (synced one way) to S3 via rclone. Cloudfront meanwhile has both S2 and uploads as an 'origin group'. This has all that I need. Love this plugin, thanks!
    – Khom Nazid
    Sep 3, 2019 at 1:47

Your Answer

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

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