How can I disable to create folders for every years and months in uploads folder?
I mean there is a lot of folder under "wp-content/uploads", and the majority of them are empty. Why create WP these folders?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can disable this by going to Settings -> Media
If you uncheck the setting all the future media uploads will directly into
Why create WP these folders?
WP doesn't create empty folders, I assume those folders are created when you have uploaded media and now they they are empty because you might have mass deleted media files for those months. WP doesn't delete folder once there are no media files(I mean once you have deleted all corresponding media files).
My opinion is that it's not a big deal that even if we have empty folders.
To add to @bravokeyl's answer, the reason to the creation of those empty directories is a minor bug in wordpress code that prepares a folder to which it will be able to upload files into, at an API which is not always used as part of the upload process. But except for being annoying to the eye, those empty folders do not have any impact on performance or anything else