Fix upload failed to write file to disk error in WordPress

How to Fix The Upload Failed to Write File to Disk Error in WordPress

Fix upload failed to write file to disk error in WordPress

Have you ever tried to upload pictures to your WordPress website and received this error message: “Upload: failed to write to disk”? If you are currently seeing this error, don’t panic!

In this article, you will learn a couple of easy ways to fix this error quickly. Even if you are just starting out with WordPress, you should be able to follow through easily.

 

In This Article:

  1. What causes this error
  2. What you need to fix this error
  3. How to fix this error

 

What Causes Failed to Write File to Disk Error in WordPress?

There are a couple of reason why you may be seeing this error. The major cause, however, is incorrect folder permission.

When you create a WordPress website, your web server creates folders in which files are stored. To access these folders and store (write) files into them, WordPress needs to be given appropriate permissions. If a folder fails to provide the needed permissions, WordPress will display “failed to write to disk” error message when you try uploading to that folder.

Also, you might experience this error if the quota limit of your server has been exceeded, or when the temporary file directory in your web server gets filled.

 

What You Need to Fix This Error

To fix this error, you will need a means of accessing the folders in your web server. The easiest way is with an FTP client. While there are many FTP clients out there, for this tutorial we shall be using FileZilla, and we urge you to do the same.

 

Guide to Fix Failed to Write File to Disk Error

There are a couple of methods for fixing this error. The first thing to try is changing the folder permission with an FTP client. Second, check if disk limit on the server has been exceeded. And finally, empty the temporary file directory.

 

  1. Change Folder Permission via FTP Client

If you don’t have FileZilla client, head over to FileZilla’s website and download it for free. It has both Windows and Mac versions. Once you have it installed and running, connect it to your WordPress website. You would be asked to provide your host, username and password.

filezilla ftp client login

The host is your website domain, for example mywebsite.com. Then enter the username and password in the correct entry fields (you can get these details from your webhost). In the port field, put 22.

Once a connection with the server has been established, locate the “wp-content” folder and double click to open it. Within this folder, locate the uploads folder, right-click on it, and select “File permissions”.

click file permissions

A dialog box with numerous checkboxes would pop up. Don’t let the numerous checkboxes bother you. Just locate “Numeric value” field, and type in the value, “755”. Ensure the “Recurse into subdirectories” and “Apply to directories only” radio buttons are both checked, click the OK button. That’s it!

change file attributes 755

If the problem still persists, it could mean that the files within the folder haven’t given WordPress permission to access them yet. This can also be fixed!

Similar to the previous step, right-click on the wp-content folder and then click on “File permissions”. This time, enter the value “644” into the Numeric value field. Check the “Recurse into subdirectories” radio button. In addition to that, check the “Apply to files only” radio. Click OK to implement these file permissions.

change file attributes 644

Try uploading a picture to WordPress. It should go through without any error message this time.

 

  1. Check if Quota Limit on Your Server Has Been Exceeded

Quota limit is the maximum storage space on your web server. It is determined by your host provider. For some host providers it is limited; for others it is unlimited, depending on your hosting plan.

disk usage on hosting cpanel

Exceeding this limit will cause file upload errors in WordPress. If you are still experiencing file upload error, check with your host provider if you have exceeded your quota limit. If it has been exceeded, you might have to upgrade your hosting plan. Alternatively, free up some space by deleting files that are no longer relevant from the server. You can do this using cPanel or FileZilla.

 

  1. Empty the Temporary File Directory

Temporary folders, or file directories, are very useful for WordPress. As the name suggests, WordPress temporarily stores files in them, after which you can move the stored files to the “upload” folder.

If this folder is full, there won’t be space for files to be stored temporarily. As such, your best bet is to free up some space. Your web host provider is in the best position to do this, so reach out to them for help.

 

Conclusion

Failed to write to disk error is one common error on the WordPress platform. The good news is that you can quite easily fix it

In this article, you have learned 3 ways to fix this error. We hope you found it useful, and if you did, kindly share this article with others.

Also, if you run into more WordPress errors or issues feel free to contact our wp support. For more WordPress tutorials check our WordPress blog.