/* Custom Folder for Uploads */
define('UPLOADS','wp-media');
The default media uploads folder is WordPress is under wp-content/uploads/year/month/file.ext.
In order to change WordPress media upload directory, you need to have ‘File Manager/ FTP’ access to your hosting account.
Modify and add the mentioned code to your wp-config.php. For our site, we upload media to the folder named ‘wp-media‘ located in the root directory. We use the above code.
If you want to add media to subfolders, add the relative path. For example,
define(‘UPLOADS’,’A/B/media’);
Where, A is the folder in root directory, B is the sub-folder and ‘media‘ is the folder in which the media is stored.
If you use date/year organized folders, they will be automatically created inside the ‘media’ folder when you upload new media.
How to Move Existing Media to the New Media Uploads Folder?
The moment you change the uploads directory though wp-config.php, and if you have existing media, all your sites images will be broken!
That is because the database cannot find the location of the media inside the new uploads folder. So, lets satisfy the database.
Simply copy the contents inside the default uploads folder to the new uploads folder. (Copy as is. Do not change the folder names)
For example,
Old: wp-content/uploads/2020/01/image.png
New: ../path to new-folder/2020/01/image.png
This will correct all your broken images. Once everything works fine, delete the old ‘uploads’ folder and save some space.