How to Change the Default Media WordPress Uploads Folder Properly

Change WordPress Media Uploads folder

WordPress, by default, saves all media files under the directory called "uploads." For example you can see an uploaded image file in your site under the following path:

http://www.example.com/wp-content/uploads/2018/01/image-file-name.jpg

For some reasons, you might want to change the default WordPress media uploads folder (for example, to such a folder as "/images".)

To change the default uploads path, you just need to add one line of code to your wp-config.php file. You can add it using the "File Manger" tool available in cPanel or via FTP.

For example, when using Bluehost, please login to you hosting account and open the "File Manager" utility available under “Hosting > cPanel > Files > File Manager”.

Please go the directory where your WordPress is installed. To modify the wp-config.php file located under your WordPress installation root directory (normally “/public_html”), please right-click on the wp-config.php file and then click "Edit" on the context menu.

Now, please add the following line immediately above the line "/* That's all, stop editing! Happy blogging. */"

define( 'UPLOADS', ''.'images' );

Of course, if you are convenient to use FTP, you can edit the wp-config.php file via FTP. I normally use FileZilla, a free FTP client application to access FTP.

Media files will be uploaded under the "images" folder. Please change "images" as you wish (such as to "files".)

You can also change the way the uploaded media files are organized. The files, by default, are sorted into years and months. It's possible to change your file organization so that all media files are dumped in the one folder.

Please go to Settings > Media and uncheck “Organize my uploads into month- and year-based folders.

Now all media files will be saved under the folder you specified in the wp-config.php file and the URL of a media file will be www.example.com/images/media-file-name.jpg instead of www.example.com/images/2018/01/media-file-name.jpg.


Leave a Comment

3s