How to Change the Default WordPress Uploads Folder
There are many different reasons why users might want to change the default upload directory in WordPress.
In terms of performance, it makes it possible to host images on a subdomain, also making backups more efficient. Changing the directory can also create a different URL structure and organization for media files.
Prior to WordPress 3.5, you could change the upload directory path from the Settings menu in the backend, but this is no longer possible.
In today’s Weekend WordPress Project, I’ll show you how to easily change your default uploads folder.
Change Default Media Folder
Open your wp-config.php file, locoed at the root of your WordPress installation, and add the following snippet:
Make sure you add this code before the line:
If the directory doesn’t already exist, WordPress will automatically create it as long as the wp-content folder is writeable. Otherwise you can great the folder yourself via FTP, cPanel etc.
You can also change the way uploads are organized. If you open your uploads folder you’ll notice that files, by default, are sorted into years. You can change your file organization so that all media files are dumped in the one folder. Go to Settings > Media and uncheck “Organize my uploads into month- and year-based folders.”
Not only will it make your URLs simpler, it will also make it easier to see all your files in one place instead of having to sort through month and year directories.