You try to make an urgent update to your site, but it fails. Nothing can be more annoying for website owners than getting errors during site management.
Majority websites are based on CMS software. WordPress is one commonly configured CMS for websites. It comes with its share of errors too.
In our role as Outsourced Tech Support services for web hosts, WordPress errors are a commonly resolved issue for customers who report website issues.
Today, we’ll see what causes ‘failed to write file to disk WordPress error’ in WordPress sites and how we fix it.
‘Failed to write file to disk WordPress error’ – When do you see it?
This error usually happens when WordPress site owners try to upload images or files to their site using the WordPress admin area interface.
One of these error messages can show up:
WordPress failed to write to disk
WordPress has failed to upload due to an error failed to write file to disk
Unable to create directory wp-content/uploads/2018/10. Is its parent directory writable by the server?
The exact error on the WordPress panel show up as:
Today, we’ll see the common causes for this upload error and how we fix them.
Causes for ‘Failed to write file to disk WordPress error’
In our experience handling failure to write errors, we’ll see the major causes we’ve come across.
1. Incorrect folder or file permissions
For every site to work fine, the files and folders in it should have the correct ownership and permissions. Whenever the webserver does not have enough permissions to write to the upload folder, it will give ‘Failed to write file to disk’ error.
In certain scenarios, some plugins for backup and restore, improper server migrations, WordPress update or human errors can also lead to such permission issues.
2. Temporary folder errors
WordPress runs on PHP. When files are uploaded, they are first saved to a temporary folder, before uploading to the website folder.
The location of this temporary folder is defined in the PHP and related configuration files. This temporary folder can get filled up due to huge uploads or upload process getting disrupted in between.
If this folder is full or have permission issues, the uploaded file cannot be saved and will throw errors. Wrong path to the temporary folder in the configuration file can also lead to write errors.
3. Quota limit exceeded
Every user has a quota allotted to their account in the server. In shared hosting, the users are billed based on the storage allotted to them.
Many website owners choose low storage plans for their sites, inorder to save costs. But this storage can get easily filled up, especially when there are subdomains and huge uploads.
When a user reaches his quota limit, he cannot upload anymore files to the account. That is when he sees “failed to write file to disk” error in his WordPress site.
4. File system errors
Lack of disk space in the entire server can lead to write errors in sites. We have seen cases where the / folder or /tmp folder in servers getting filled up due to various reasons.
In some servers, we have also seen the hard disk going bad and turning into read-only mode, which prevents any write operations and throws up errors for sites and services.
How we fix ‘Failed to write file to disk WordPress error’
1. File permissions
The first thing we check is the folder and file permissions of the WordPress installation of the site. The folder ‘wp-content’ is the one that contains the uploaded files.
For WordPress uploads to work fine, this folder and subfolders must have 755 permissions and files need 644. And, this can be set via FTP, File manager or command line via SSH.
To avoid permission issues that arise during account migrations over servers, we follow an extensive checklist and do pre-migration and post-migration checks.
2. Temporary directory settings
If folder permissions are fine, we examine the WordPress site logs and see what else is the issue. We examine the settings and confirm that the temporary directory is set fine.
The permissions and ownership for this temporary folder is verified to be correct. If the temporary folder exceeds its size limit, we clear it and remove files that maybe present due to incomplete uploads.
3. Quota checks
We examine the disk quota and usage of the user and confirm them to be within limits. In cases where the disk quota exceed the limits, we scan and find out what is using up the space.
If unwanted files or trash is consuming the space, we clear and create space. Otherwise, we initiate plan upgrade for the site and allot more storage to the account.
4. File system checks
Similarly, we examine the file system disk space utilization and ensure that there is no lack of space. To rule out other hard disk errors, we verify the server logs in detail.
For servers we manage, we get notifications whenever a disk issue occurs, and our 24/7 team of engineers promptly resolves such issues to ensure websites are not affected.
5. Plugins or hacks
In rare cases, it is also possible that some WordPress plugins or any hack attempt by malicious users can affect the folder permissions and cause write errors. A wrong format of filename can also be a reason.
In the servers we manage, we conduct periodic audits and security scans to prevent such hack attempts or malicious software from affecting website functionality.
Conclusion
WordPress errors are a commonly encountered category of website errors. Today we saw why ‘failed to write file to disk WordPress error’ happens in websites and how our wordpress support team prevent it.
Unable to create directory wp-content/uploads/2019/02. Is its parent directory writable by the server?
Hi Jawad,
This error is permission/ownership related.
If you are on a CentOS/Apache server, it should be 644 for the files and 755 for folders. Ownership must be user:user.
If you still find it difficult, let us know your OS, Admin suite and Web server. We’ll help you out.
set correct path in wp-options upload path in database
Unable to create directory wp-content/uploads/2019/08. Is its parent directory writable by the server?
Hello Ashley,
Can you please verify the permissions and ownership of the folder? If you still have the error and need help, we’ll be happy to talk to you on chat (click on the icon at right-bottom).
Hi!
I try to build a new website on an existent domain name with GoDaddy and have the same issue as showed above but as a beginner do not know how to solve the issue. Is it possible to get any help? Thank you.
Hello Victoria,
Our Engineers can definitely help with your WordPress error. We’ll be happy to talk to you on chat (click on the icon at right-bottom).
i have the same probleme ans i trayed all sollution; finaly it fixed with a new upload of wordpress zip to ftp server because some files was missing
Unable to create directory uploads/2022/10. Is its parent directory writable by the server?
Tried all the solutions that I could find on the web. Issue is still unresolved. Kindly assist with this issue. It’s very urgent.
Hi,
Our Experts can help you with the issue, we’ll be happy to talk to you on chat (click on the icon at right-bottom).
Unable to create directory wp-content/uploads/2022/12. Is its parent directory writable by the server?
Hi,
Our experts can help you with the issue.Please contact our support team via live chat(click on the icon at right-bottom).
How do you change the permissions with FTP, File Manager or command line via SSH? there’s no instruction on doing that. I’m using Xampp on Mac with Ventura, which comes with ProFTPD, and I can’t find a way to change its permissions.
Hello Abubakar,
To change permissions on files and directories in XAMPP with Ventura (ProFTPD) on macOS, use an FTP client or SSH command line with the chmod command.