I have up until now organised my media files into month and year folders. Can I uncheck the box in media settings to lose the year/month folder structure?
Yes you can uncheck the box. There is no problem with doing this and there will be no issues such as broken links to images.
The reason there is no problem is that the change is not applied retrospectively. It only affects new media uploads. Existing files stay where they were in the month/year based folders and the links to those files remain unchanged.
Reorganizing Existing Images Is Not Easy
A word of warning. If you want to reorganize the uploads area by moving all existing images into a single uploads folder then this operation is non-trivial. Moving the files is straightforward however changing all the link references to the images in the media library and elsewhere is not.
To further complicate this, some references are held in the database in serialized arrays so they cannot be directly manipulated by SQL. The required process is to read the serialized array from the database, unserialize into an array, change the URL to remove the year and month sub-folder paths, re-serialize the array and then save in the database. This process could be mitigated by leaving links unchanged and using redirects however this adds another layer of inefficiency and complexity. Typically it is just not worth the effort to go through this process.
Alternatives To Storing Images In The Media Library
My personal preference is not to use the Media Library at all and instead place images on Amazon S3.
I value the benefits of having more control over the images on my site by not placing them in the Media Library.
- optimized images
- cache headers set appropriately
- better database performance
- simpler backup strategy
- much easier site moves
- same images files can be used for staging and live sites
- greater efficiency when adding images
- less clutter
On most of my sites I end up with just a handful of files in the Media Library such as slider images where a plugin necessitates the placement of the file in the Media Library if it cannot operate using files on a remote CDN.