An issue commonly faced by many WordPress developers is the Is its parent directory writable by the server? error.
The first instinct of many developers is to double-check the permissions of the uploads folder on the server. And while this may be enough to fix it in some cases, there are several other reasons for this error to occur. For instance, there is a chance for this error to appear if you’ve recently migrated your WordPress site to a new web hosting provider. No matter what’s causing the error, in this tutorial, you will learn how to fix it in a matter of minutes.
Option 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. For example at Hostinger WordPress hosting full path to WordPress uploads directory would be similar to:
You can use File Manager or FTP client to check whether or not the path to uploads directory is correct. Simply navigate to the said folder and check it’s path. With Hostinger File Manager you can see the path on the top left side of the screen:
Once you are sure that uploads directory in WordPress settings is correct press Save button and try to upload files again.
You can also achieve this by editing WordPress config file, especially if you’re unable to see the uploads directory field in WordPress admin area. Use File Manager or FTP and open up the wp-config.php file for editing. And add the following code:
define( 'UPLOADS', 'wp-content/uploads' );
This code should be included before this line:
require_once(ABSPATH . 'wp-settings.php');
Now try to upload media files again. If you still get error proceed to Option 2.
Option 2 – Changing Folder Permissions
Still getting the Is its parent directory writable by the server? error even after following Option 1? Well, you may be better off trying 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.
Performing this will not only reset the permissions of the uploads folder to 755, but also do so for sub-folders inside this parent folder. As mentioned in the introduction to this tutorial, resetting the folder permissions can solve this error in a few cases.
Finally, if both of these methods don’t work, you can try this slightly quirky workaround: change the permissions of the uploads folder from the default 755 to 777.
This will give everyone access to read/write into the folder. Now, upload a file in that folder. Afterwards, revert the permission back to 755.
Option 3 – Fixing Is its parent directory writable by the server? Error on VPS
Before you begin with this method see our tutorial on how to change permissions and owners via command line.
If you are hosting your WordPress on VPS and have SSH access, you can try this solution. Do note that this is for a Linux VPS running Apache web server.
Before we begin, let’s understand some background: by default, your Apache web server uses the www-data user and www-data group to access files and folders. There is a possibility that the uploads folder is not actually owned by www-data, which would naturally prevent it from writing to the folder. What you want to do is make this user the owner of the uploads directory.
To do this, you must use the shown Linux command:
- First of all, connect to your VPS via SSH (chick for tutorial).
- Navigate to wp-content folder. We assume that your WordPress is installed in public_html directory:
- Now change owner and group to www-data:
chown -R www-data:www-data plugins
Just like on shared hosting account, it’s possible that folder permissions are not sufficient for WordPress to write inside plugins folder. While you are inside wp-content folder, run the following command:
chmod 755 -R uploads
This command will set permissions for plugins and all subdirectories inside it to 755.
This solution works if you switched over to a new hosting provider, as configurations between hosting services might vary.
Getting the Is its parent directory writable by the server? error can be discouraging, especially if you’re only go-to move is changing permissions of the uploads folder. In this tutorial, we saw how to fix this error using multiple techniques. By following the steps in this guide, you have hopefully gotten rid of this error.
If you liked this WordPress tutorial, be sure to check others here.