WordPress stands out to be one of the best content management systems. It allows you to host your website and publish your content easily and quickly.
Although WordPress tends to be quite reliable, this system isn’t fail-proof. A common problem that users have to deal with is the WordPress failed to write file to disk error. It sometimes pops up when the user uploads something to their site, such as a photo or a post.
The WordPress failed to write file to disk error is common yet very easy to fix. This guide will show you how to deal with this problem and get your posting schedule back on track!
- Why Has WordPress Failed to Write Files to Disk?
- #1 Check Temporary Folder
- #2 Modify Upload File Permission
- #3 Check Quota Limit
- #4 Upgrade Hosting Plan
Why Has WordPress Failed to Write Files to Disk?
There are many different reasons why WordPress fails to write a file onto your disk. But most of the time, the source of the issue will fall into one of these three cases.
The temporary folders used by WordPress may have run out of capacity. This is a fairly rare case, but it does happen from time to time.
Another explanation for this error is that the upload folder’s permission settings are incorrect. And this one is the most popular reason by far.
The third and last common diagnosis is simple. You probably exceeded the upload limit of your hosting service.
Fortunately, there are easy fixes to all three of these cases, which we’ll show you in the next section.
4 Ways to Fix WordPress Failed to Write File to Disk
Depending on the source of the issue, there are four methods that you can use to solve it. As we mentioned earlier, they are fairly easy to do and don’t require much technical know-how to pull off. No need to worry!
#1 Check Temporary Folder
Whenever you upload something onto WordPress, like photos or text, they won’t go to your uploads folder directly. First, the system deposits the files into temporary folders in WordPress servers. And it’s from there that they are transferred over to your uploads folder.
If the temporary folders run out of space, there’s no way for your files to reach your uploads folder. This results in the “Upload: Failed to write file to disk” error.
Unfortunately, in this case, the problem comes from the server side (hosting provider) rather than the client side (your side). So, you should contact your hosting provider and get them to look at the temporary folders and clean them out.
There comes a time when your temporary folders are missing. If you encounter the “Missing a Temporary Folder” error, check out our guide on how to fix it.
#2 Modify Upload File Permission
When you write (upload) a file into a folder in WordPress, the system will check the folder’s settings to see if you’re allowed to write into it. If you don’t have the right user permissions, you won’t be able to write into the folders. This leads to the “Upload: Failed to Write File to Disk” error message.
Other than folders, the same thing applies to files, too. Files (photos, texts, etc.) also have permission settings. Not having the right permission prevents you from modifying them.
The solution is rather simple: change the permission settings of the folders or files. There are three ways to do this.
2.1 Via SSH
SSH (Secure Shell) allows you to remotely access your web server and interact with it through a command-line terminal.
However, not everybody knows how to use the terminal, so this method will require a bit of technical knowledge. Fortunately, you only need to know the basic UNIX commands to get through this.
You must first access the WordPress installation folder to change the upload file permission. Typically, it is located in the public_html folder. If this is the case, you can copy and paste the following command into the terminal.
Next, you will want to change the permission of the content folder. Run this command.
chmod 755 wp-content
This command changes the permission of the folder /wp-content to “755”. This number represents the top-level admin permission for the folder. It gives you the ability to read, write, and execute commands in the folder.
If you want to give yourself the same power over all files, add “-r” before the “755”.
chmod -r 755
Retry your upload again to see if it works!
2.2 Through FTP Client
Many people use FTP (File Transfer Protocol) client as an easy way to upload files from computers to WordPress. If you’re part of this crowd, then good news: it’s pretty easy to change files and folders’ permission settings.
Fire up your FTP client and navigate to WordPress’ installation folder (go to public_html, then wp-content).
You should now see a folder with the name uploads. That’s where all your files will go when uploaded into WordPress. The problem is that this folder is probably set to the wrong setting. So you can’t add anything to it.
Select the File Permissions dialog in your FTP client, and scan for a box that says Numeric Value. Type in the number “755”. It will give you full access to the folder.
Depending on your client, there should also be an option that says Recurse into subdirectories. Tick that box. It will apply the permission set to every folder and file within the uploads folder.
Choose Apply to directories only before you click Ok to finish the job.
That should be it! Perform a short upload test to see if the fail to write file to disk WordPress error still persists.
You can refer to our guide for other ways to change files and folders’ permission settings.
2.3 With Hosting File Manager
A Hosting File Manager is pretty similar to an FTP client. It helps you upload files to WordPress and manage them through a control panel.
The process is the same as with the FTP client.
Fire up the Hosting File Manager that you’re using, then navigate to WordPress’ installation folder (public_html, then wp-content). You will now see the uploads folder, our target.
Find the Permissions tool in your manager. Each program is different, so we can’t give you detailed pointers here. If you can’t find it, check the support documents for the program.
Set the permission to “755”, and you’re done!
#3. Check Quota Limit
Your quota limit could potentially be a problem. Web hosting services usually give you a limited amount of disk space. If you upload too many files and run out of quota, the server will prevent you from uploading more.
The simplest way to fix this is to delete some old files to make way for newer ones. Or, you can upgrade to new hosting plans that give you a larger quota to work with.
#4. Upgrade Hosting Plan
It can be expensive, but if you have used up so much disk space that you get the “Upload: Failed to write file to disk” error message, then it’s probably time you upgrade to a better plan. With an increased quota, you can upload more data without worrying about running out of space.
Some hosting services have plans that offer unlimited disk space (so no quota at all). However, these plans can be pretty pricey.
Make Sure No Problem Occurs on Your Site
Generally speaking, the Failed to write file to disk WordPress error is pretty simple to fix. All four of the methods we showed you earlier don’t require a lot of technical knowledge to do. Some only need you to place a call!
Depending on the source of the issue, you can pick the solution accordingly out of the various options above. But considering how this problem most often stems from incorrect permission settings, you should inspect your WordPress system using the SSH or FTP client first to see if everything is in working order.
Then, if that doesn’t do the trick, try the other methods until you find one that works against your case!
Hope this guide has been useful for you. Don’t forget to subscribe to our website for more detailed tutorials!