Connect with us

Wordpress Plugins

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

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.

Tip: 20 ways to drive more traffic to your site

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.

Continue Reading
You may want to check out:
*some of our articles and lists include affiliate links to fund our operations (e.g. Amazon, Elegant Themes, Envato). Please read our disclaimer on how we fund Exxponent.
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in Wordpress Plugins

To Top