Hello @liquidace,
Yes, this can be achieved with a plugin. Here are three options to choose from that offer the ability to create subfolders, change URLs, and manage your media library:
Hi Niall
Thanks for the response but I’ve done some more research and have installed all these plugins but they do the same thing. They all create folders put don’t actual change the premalink URL. I’m reading this can’t be done easily within wordpress.
Thanks
I tested some that claim or imply that they change URLs. And you’re right, they don’t change the URLs! Most appear to have almost identical interfaces, so I’m guessing they’re derived from a single source. Another just overloaded the resources on my shared hosting account!
In general, there’s little need for changing the URLs of static content like images and documents in WordPress, which is why it’s hard to find this functionality.
I recommend using an open source document management system or file management system if you’re in need of hosting a document repository. Here’s a list I’ve tested or come across:
There are also free but not open source options you could use.
You’ve read correctly, it’s not easily done. While I don’t think you’d want to tackle what’s involved, for the record, the ‘pre_move_uploaded_file’ filter is used to preempt the moving from temp upload folder to WP uploads folder process. The filter callback would handle it instead.
The ‘wp_handle_upload’ filter is also used to modify the file’s location data so it is correctly recorded in attachment post meta data. The file’s link will then be correct. This does not alter the permalink of any attachment page, only that of the file itself.