How to Change the Default WordPress Uploads Folder

solution for: Unable to upload media – Is its parent directory writable by the server? error
Unable to create directory – Is its parent directory writable by the server
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.

Seen many threads about the wordpress error while uploading the images to media.

I hope this could help in struggling with the same issue.

  • You shouldn’t need anything in the .htaccess file.
  • No need to check that you have ‘write’ permissions to the parent-directory’ message’, whenever I attempted to upload a file.
  • Just need to write one of code

add a line to wp-config.php after “require_once(ABSPATH.’wp-settings.php’);” see below

Once applied, this fixed the entire problem, and my tester conformed that the correct paths were now being used. It had NOTHING to do with file permissions!

It seems that prior to WP 3.5, users were able to set the UPLOADS directory in a ‘Settings’ field, but this field is no longer present in WP 3.5+, and the ‘UPLOADS’ constant is normally only set at ‘install time’. So when the site was ‘moved’ to a new server, my uploads directory was left pointing to a legacy (now defunct) value. Adding the line above to wp-config.php restores the value to a present (good) path.

Bad-Upload-Directory-Data-generic

You may also like...