If you are seeing any of the following errors when you try to upload/import media into WordPress’s media library then this tutorial is for you. It will show you how to fix this annoying error.
- Unable to create directory wp-content/uploads
- Unable to create directory /wp-content/uploads/ Is its parent directory writable by the server?
- Unable to create directory wp-content/uploads/2013/02
Try these tips to fixing this issue.
Fix #1 – Changing Uploads Directory In WordPress Settings
If you have moved your WordPress to a new hosting recently. There is great chance that path to your WordPress uploads directory is incorrect. A simple place to begin troubleshooting is to check the WordPress settings section.
To do this, sign in as admin on WordPress. Then, in the Settings tab, select Media. Under the section titled Uploading Files, you should see a field named Store uploads in this folder. Now check the path to Uploads directory.
- Enter wp-content/uploads in the “Store uploads in this folder” text box
- Save the changes by hitting the “Save Changes” button and you are done
Fix #2 – Changing Folder Permissions
Try to reset the folder permissions of your uploads folder. For this, you can use an FTP client, like FileZilla or File Manger as well. Follow these steps to reset folder permissions using FileZilla:
- Connect to your account with FileZilla.
- Go to WordPress installation directory (in most cases it’s public_html) and open wp-content folder.
- Once inside, right-click on the Uploads directory.
- Click on File Permissions, which will prompt open a dialog box.
- Here, find the Numeric value field, and enter 755.
- Check the Recurse into subdirectories option if not already checked.
- Select Apply to directories only from the radio buttons.
- Click OK.
Fix #2 – If your server use UBUNTU
The webserver (Apache) runs as user www-data and group www-data by default on a Ubuntu system. If the files/folders are not owned by this user (www-data) then the webserver will be unable to write changes to them.
Change the filesystem permission on the folder (where the web application wants to write to) to the “parent directory” as mentioned in the error message.
For example, do (prepend with sudo if you’re not the current owner and need to elevate your own permissions in order to do it):
chown www-data /path/to/directory
to make www-data the owner which makes it writeable usually, or another approach via groups:
chgrp www-data /path/to/directory
chmod g+w /path/to/directory
Fix #4: Use This for XAMPP, WAMP or (LocalHost Installs)
If you have installed XAMPP to run WordPress on your local PC for testing and you are seeing this error then try the following.
Reset the ownership of the WordPress instillation to nobody. You can do this by running the a command in the command line/terminal.
- Windows System: Start -> Programs -> Accessories -> Command Prompt
- Mac: Applications ->Utilities -> Terminal
sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wp
Hopefully one of the above solutions should help you fix the unable to create directory error in WordPress.