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.

Create a custom media uploads folder for your site.

Change Default Media Folder

Open your wp-config.php file, locoed at the root of your WordPress installation, and add the following snippet:

define(‘UPLOADS’, ‘wp-content/myimages’);

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.

Create a custom media folder for your WordPress site.

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.

Щелкните ниже, чтобы поставить оценку!
Всего: 0 В среднем: 0

Написать комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *