How to Change the WordPress Uploads Folder to a Year/Month/Day Structure

May 9th in Wordpress Plugins by .

In the past few months, we have covered a bunch of reasons you should avoid putting thousands of thumbnails and image files in any given folder on your server. In fact, many web hosts have rules discouraging their customers from doing that. WordPress already lets you organize your uploads into month- and year-based folders, but if you post too many articles on a daily basis or your theme generates a ton of thumbnails, you will need to change that structure.

🛠️ Divi Builder drag & drop page builder for WP

We have been using a year/month/day directory structure for a while without any issues. Here are two ways to change the WordPress uploads directory to such a structure:

custom-upload-directory

Custom Upload Dir: an easy-to-use plugin that gives you a lot of flexibility when it comes to creating smart folder structures. It has been compatible with most themes we have tested.

Modify your functions.php file: the above plugin is quite versatile, but we found a couple of themes that were still uploading files outside the defined folder structure. We were able to solve that by adding the above code to our functions.php files. Keep in mind that you will need to have the Settings > Media > Organize my uploads into month- and year-based folders option enabled for this to work.

Have you found better ways to organize WordPress files on your server? Please share them here.

You may want to check out:
*some of our articles and lists might include aff links to fund our operations. Please read our disclaimer on how we fund Exxponent.

Follow WP Solver on Pinterest

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: