When you see the Upload: Failed to Write File to Disk WordPress error whilst trying to upload photo for that awesome post you just put together, the only reaction can be pure frustration. And while it is never desirable to experience errors in WordPress, this one is pretty easy to fix. In this tutorial, we will discuss various causes of the error, and show you how to fix it with easy-to-follow steps.
What you’ll need
Before starting this tutorial you’ll need the following
- Access to your hosting account or VPS
Table of Contents
- Why You Get Upload: Failed to Write File to Disk Error
- Option 1 – Checking Uploads Folder Permissions
- Option 2 – Checking Quota Limit
- Option 3 – Checking Temporary Folder
Why You Get Upload: Failed to Write File to Disk Error
The Upload: Failed to Write File to Disk WordPress error can surface due to a number of reasons. The most typical cause of the error is incorrect folder permissions. But besides incorrect permissions, this error can also ocurr due to your website exceeding the quota limit of the hosting service. Finally, in some rare cases, you might be experiencing this error due to the filed capacity of the temporary folder of WordPress. Needless to say, all three cases of the error are fixable, and we will show you the solutions to each and every one of them in the following steps.
Option 1 – Checking Uploads Folder Permissions
As stated above, this is the most common cause of the Upload: Failed to Write File to Disk WordPress error. Whenever you try to write (upload) files to any one of the folders on your website, the web server checks whether the folders are allowed to write those files. If any folder does not have the appropriate permissions, the web server is unable to write files to that folder. The same goes for making changes to particular files, as they also have permissions which determine the interact-ability with that file. There are three methods of modifying folder permissions on your web server:
Option 1.1 – Changing Permissions with FTP Client
You can change permissions of files/folders of your website using FTP clients like FileZilla. First, connect to your hosting using FileZilla. Then, hover over to wordpress installation folder (usually it’s public_html) and to wp-content folder. Now right-click on the folder Uploads. Select File Permissions. You will now see a new dialog box open up; in the Numeric value section, enter 755. Now, check the Recurse into subdirectories option. This will apply the same permission to all folders inside Uploads. Finally, choose Apply to directories only in the sub-menu. Finish by clicking OK.
Keep in mind that sometimes, merely changing folder permissions does not work – you have to change permissions for files residing inside the folder as well. You can achieve this using FileZilla as well. Once again, right-click on the wp-content folder and choose the File Permissions option. Next, enter 644 in the Numeric value field. Finally, check ‘Recurse into subdirectories’, and this time, select Apply to files only. Click OK to save your settings.
Option 1.2 – Changing Permissions with Hostinger File Manager
If you’re using a hosting service like Hostinger, you can change folder permissions easily through the cPanel provided by the service. To do this, login to your web hosting account through File Manager. Then, navigate to the public_html -> wp-content folder. Once inside, you should be able to see the Uploads folder. Right click on this folder, and then hit on the Permissions button. Now, set the permission to 755 (read and write) for this folder, if it isn’t already set. Try to upload image again and if the error still pops up, proceed to changing the permissions on individual files inside the Uploads folder as well, just like in the previous step.
Option 1.3 – Changing Permissions via SSH
IMPORTANT: It’s recommended to check tutorial on how to manage permission and owners via command line before proceeding with this step.
On Hostinger shared hosting or VPS you can change file/folder permissions via SSH (see our tutorial on how to connect to your account or VPS with SSH). To change permissions using SSH, you only need to use the chmod command, like this:
- First of all, access WordPress installation folder. For example, if your WordPress is inside public_html folder, execute:
- Now change permissions to 755:
chmod 755 wp-content
By running the above command, the wp-content folder’s permission will be set to 755. If you want to give the same permission to all files and folders inside this directory, simply add the -R flag before 755 in the command.
Option 2 – Checking Quota Limit
Another cause for Upload: Failed to Write File to Disk WordPress error is if your website has exceeded the space limit of the web hosting service. On Hostinger shared hosting, disk space is unlimited, but many other hosting providers set pretty low limits. Thus contrary to popular belief, exceeding the quota limit of your hosting provided isn’t that uncommon, especially if your website is rich in content. To find out whether your website is exceeding the quota limit, follow our dedicated guide. If that is indeed the case, you would want to delete some unused files on the server.
Option 3 – Checking Temporary Folder
If the error still persists, you can be sure that the temporary folder of your WordPress site is filled to its maximum capacity. WordPress works by uploading your content to a temporary location on the server, and then proceeds to save this content in the Uploads folder. But if the temporary folder doesn’t have room itself, then there is no way for that content to reach the Uploads folder and Upload: Failed to Write File to Disk error occurs.
If this is the case, you will need to contact your hosting provider. Or clean up temporary folder if you are on VPS, for instructions how to clean up disk space on VPS see this tutorial.
Looking for a better way to host your website?
Transfer your website to the fastest web hosting platform with 24/7 dedicated support.
In this tutorial, we saw how to fix Upload: Failed to Write File to Disk WordPress error. The error can be caused by:
- Incorrect file/folder permissions
- Exceeding quota limit of web hosting provider
- Overflow of the temporary folder
Hopefully, by following this guide, you were able to solve this error, and continue saving media content on your WordPress website. Be sure to check out our other WordPress tutorials for quick fixes of WP errors.