WordPress is a powerful content management system which allows you to upload media files like images into your website. Sometimes, you may encounter a WordPress error with such words “failed to write file to disk error”. Indeed, it is quiet frustrating to experience such error which is in the way to enable certain functions. However, you will probably lose your way to fix the fail to write file to disk error in WordPress due to a lack of the information.
There is no need for you to worry about that error because it is a common one which occurs on a WordPress site. In order to get the error fixed in a quick way, it is necessary to learn the reasons which are responsible for it so that you are able to find a proper solution. At the beginning, we would like to summarize the main reasons behind the error for your general idea.
- You set inappropriate permissions for the files and folder.
- The disk quota has no space for you to add media files.
- The temporary file directory used in PHP during file transfers has no space left.
- A plugin may not work normally.
Solution 1: Get the Permission for the Upload Directory
In most cases, you may set incorrect permissions for uploads folder, which is the most common reason for the error. Because the access to the folder is controlled by your web server, it is impossible for you to write files without the appropriate permissions. In other words, you have no ability to upload media files into your WordPress site due to the incorrect permissions.
To start with, you need to check whether the permissions are set in a correct way for the upload directory via a web-based file manager or a FTP client. Once connected, you need to right click on the wp-content folder and then select the “Change permissions” item. On the result screen, you need to enter 744 or 755 into the Permissions field. Having it finished, you do not forget to click on the Change Permissions button. Note that we are using a web-based file manager.
If everything goes well, you will be given the ability to upload files as long as you set the correct permissions. However, you are on the way to explore more reasons if you still fail to write file to disk.
Solution 2: Get More Disk Space
We cannot rule out the possibility that there is no more disk space available for you to add files. It is common for a beginner to ignore the allocation for the disk space when shopping for a shared hosting plan. The cheap one may come with much limited disk space, which means that it is easy for you to have no room to add media files. If you run a website with rich media, you may exceed the disk space quota.
To check your disk space usage, you will get the detailed statistics when you login to cPanel and take a close look at the left sidebar. If you exceed the quota, you are not allowed to upload files to your WordPress site. To get the problem solved, you can either delete worthless files or upgrade your package if necessary so that you will not reach the quota limit of the disk space.
Solution 3: Empty Temporary File Directory
If you still have much disk space left, another reason may be given that your temporary file directory which WordPress uses in PHP during file transfers has no space left. Since you have no access to the directory, it is necessary for you to contact your hosting provider who can clear the temporary folder in the server directory.
Solution 4: Disable the Plugin
There is no denying that plugins will enables you to add much more functionalities to your WordPress site. However, you may install a plugin which leads to this error. During your investigation, you need to deactivate the plugins to find which one should be uninstalled in order to fix the error. A suggestion for you is not to install too much plugins for the security of your WordPress site.
Certainly, there are some instances when you cannot get rid of the error though you have tried the mentioned solutions. At this moment, it is time for you to have an online chat or submit a ticket to get hold of your web host, describing your situation as much detail as possible. If faced with a server issue, you can find your way under the guidance of the technicians.
In the long run, it is really important for you to choose a quality WordPress hosting provider who is generous about the disk space and can provide professional technical support to help you solve the problems which occur during your hosting journey.