How to fix WordPress Media error Unable to create directory uploads..

You may face something like the following upon uploading an image using your WordPress –> Media section


“foto-0012.jpg” has failed to upload.
Unable to create directory uploads/2022/02. Is its parent directory writable by the server?

Fix 1:

Double check you have files/folders permissions 644/755 accordingly

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;

Fix 2:

Update your WordPress wp-config.php file with the following line just after “<?php>” tag:

define( 'UPLOADS', 'wp-content/uploads' );

PS. This should also fix LiteSpeed Cache Image Optimization issue related to generation of webp files


Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *