How to change default image uploads folder in WordPress

In WordPress “wp-content/uploads/” is the default folder location for storing uploaded photos and other media files. While this is ok for few users, others may want to make it more pleasing and accessible by using custom folder location for uploads like: basicwp.com/images/ or basicwp.com/uploads/ or basic.wp/assets/ and so on. You can easily make this change for new and existing WordPress websites, though this is more recommended for new WordPress install.

Change Uploads folder location in WordPress 3.5

[Updated on Jan 04, 2013] Latest WordPress 3.5 update has removed option to enter custom folder path for uploads. All new WordPress blogs by default will use “wp-content” path for images. WordPress may have removed this option from the user interface to avoid confusion. One can still use custom uploads folder location using advanced method of editing “wp-config” file.

1. Open wp-config.php file of your blog (using ftp access). Then add define uploads snippet to the wp-config.php file for custom uploads folder location. Be careful, this is advanced step – wrong editing can bring your own website down. 

2, If you want upload folder to be “images” under root and outside wp-content folder, then add following code to wp-config.php file.

1
2
/** Custom folder location for image uploads. */
define( 'UPLOADS', ''.'images' );

If you want custom folder “images” within (under) already existing “wp-content” folder, then use following code:

1
2
/** Custom folder location for image uploads. */
define( 'UPLOADS', 'wp-content/'.'images' );

Please note, “organize my uploads into month and year based folders” option is still available in new WordPress 3.5 version. Also, if you were using different uploads folder location prior to update to WordPress 3.5 – old setting of custom uploads folder will remain even after update.

Use “Upload Url and Path Enabler” plugin

Upload Url and Path Enabler plugin enables setting fields to change the media upload path and url. Once upload path option is visible using this plugin, you can set any custom folder for storing uploaded files on your WordPress website.

Modify default “uploads” folder location in WordPress [Old]

1. In WordPress dashboard, goto Settings > Media option to open “Media Settings” page. Scroll down to bottom and look for “Uploading Files” section. Type the name of the folder that you want to use in place “wp-content/uploads“. For example: type “images” (without quotes).

2. In second box, type full path of new images folders, for example: type “http://www.basicwp.com/images” (without quotes). Click to check “Organize my uploads into month- and year-based folders” option and then click on “Save changes” button.

Using sub-domain - WordPress also allows you to use sub-domain like (http://images.basicwp.com) as default folder for storing images and other media uploads. Just enter required sub-domain in “Full URL path to files” box to get started.

Once you have made changes to media folder settings, make sure you confirm on them by creating test post. Go to the editor mode, upload few images in a test post and then preview post to check if images are appearing fine (now stored in different custom uploads folder).

Possible problems while changing “uploads” folder

1. Incorrect full URL path - While above settings should work in majority of setups, it may throw error depending on the absolute website path on the server. Open your cpanel or server panel and look for exact path, you may have to use something like: “/home/username/public_html/images” for full URL path.

2. Folder Permissions - Incorrect permission settings for selected folder for uploads can also cause problem. Make sure selected folder permission level is setto 777 (write-able directory). You can do this by from folder properties by accessing through an FTP program.

SHARE

Comments

  1. Hi!
    This will be the first website to have updated since WordPress 3.5, why it is very hard to find any details on this.
    However, I have tried your tips on my add-on domain.. I created a subdomain named “media.example.com” and posted the css tweak just below the last lines of wp-config.php, and of course renamed it from ‘images’ to ‘media’.. Do you have any idea? :o

  2. Hello,

    If I create a new folder in a subdomain and move all my images there, will this create a lot of 404 errors because the images are not in the folder Google had indexed them?

Speak Your Mind

*

Subscribe to our mailing list

* indicates required
Close