WordPress media directory is the location of the folder on a web-host where media files like images are uploaded. By default, files are uploaded to /wp-content/uploads/ folder. The uploaded files are also organized into month and year based folders. That means when we upload an image.jpg in the month of May 2015, it is placed in the folder, /wp-content/uploads/2015/05/image.jpg.
To change the said upload folder, we just need to add one line in the file wp-config.php. To remove the year and month based folder arrangement, there’s a simple option in WordPress admin settings.
Removing Year/Month Based Folder Organization
- In WordPress Admin, go to Settings > Media.
- Under Uploading Files, remove the checkbox that says Organize my uploads into month- and year-based folders.
- Click Save Changes.
Changing WordPress Media Upload Folder
Access your wp-config.php file using FTP or a file manager, edit it and add one of the following lines:
To upload the files within a sub-directory of /wp-content/
[php light=”true”]define( ‘UPLOADS’, ‘wp-content/images’ );[/php]
- Future images will be uploaded to /wp-content/images/
To upload the files in a directory that is not placed inside /wp-content/
[php light=”true”]define( ‘UPLOADS’, ‘images’ );[/php]
Future images will be uploaded to /images/
Notes:
- You normally add the code at the end of wp-config.php file.
- The changes will only impact images uploaded after this. Old files will be located in the default /wp-content/media/
- The path that you enter is relative to the WordPress installation directory.