A lot of users encounter the WordPress failed to write file to disk error when uploading a file. If you are also troubled by this error, don’t worry. This post from Partition Magic explores 4 proven methods to fix the error.

WordPress is a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database with supported HTTPS. It enables users to customize any website to fit their business, blog, online store, and portfolio.

However, a great many users encounter the upload failed to write file to disk error in WordPress when uploading new files from the media library. If you are in the same boat, follow the complete guide to solve the problem.

Possible Reasons for WordPress Failed to Write File to Disk Error

According to a survey, the “WordPress upload failed to write file to disk error” is related to incorrect file permissions. If the file permission is set to prevent you from modifying or writing to the new file, it can trigger the upload failed error.

If there is not enough disk space on your server or in the temporary directory, you will encounter the WordPress cannot write file to disk error. Besides, a faulty hard disk and an incorrect server configuration are also responsible for the error.

Can’t Delete Documents and Downloads from Microsoft 365 [Fixed]
Can’t Delete Documents and Downloads from Microsoft 365 [Fixed]

This post analyzes why you can't delete documents and downloads from Microsoft 365 and provides 4 ways to solve the problem on Windows.

Read More

Fix 1. Change the File Permissions of the Uploaded File

The first and simplest solution for the “WordPress failed to write file to disk error” is to change the file permissions. Here, you can change that with an FTP client, like FileZilla.

Step 1. Enter your credentials in your FTP client and connect to the server.

Step 2. Navigate to the upload directory in public_html > wp-content.

Step 3. Right-click the folder where you received the “upload failed to write file to disk error in WordPress” and select File Permissions/File Attributes.

Step 4. When the file permissions dialog box pops up in the FTP client, input 755 in the Numeric value field.

Tips:
If you want to change permissions for individual files within the wp-content folder, repeat the same process and input 644 in the Numeric value field.

Step 5. Tick the checkbox of Recurse into subdirectories and select Apply to directories only.

Step 6. Click on OK to save the change. After that, check if the WordPress unable to write file to disk error gets solved.

Fix 2. Clear the WordPress Temporary Folder

Some users find that clearing the temporary folder that WordPress uses for uploading files can get rid of the error. To do this work, you can reach out to your hosting provider for help. The support team can help you check hidden files on your server to see if the directory is full and clear it.

Fix 3. Upgrade Your Hosting Plan to Access More Disk Space

As discussed above, insufficient disk space is one of the main reasons for the WordPress cannot write file to disk error. If there is not enough disk space for storing website files and the database, it can trigger the error. In this case, you can contact the host provider’s support team to choose a suitable plan for upgrading your disk space.

Further reading: Do you want to upgrade your hard drive to a larger one without data loss? MiniTool Partition Wizard makes this operation super easy. It can clone hard drives, migrate Windows OS to SSD/HDD, copy partitions, convert MBR to GPT without data loss, recover hard drive data, change cluster size, and so on.

MiniTool Partition Wizard DemoClick to Download100%Clean & Safe

Fix 4. Check Your Disk Errors

If none of the above methods solve the upload failed to write file to disk error in WordPress, it may indicate that there is something wrong with your disk. So, I highly recommend that you check disk errors using a disk checker – MiniTool Partition Wizard. It can easily check bad sectors on the disk and repair file system errors.

MiniTool Partition Wizard FreeClick to Download100%Clean & Safe

Step 1. In the main interface of the program, select your disk from the map and click Surface Test from the left panel.

Step 2. Click on Start Now and wait for the process to complete. If any blocks are marked with red color, it indicates there are physically bad blocks on the disk.

run Surface test in Partition Magic

Step 3. To repair file system errors on the disk, click Check File System from the left panel, select Check & fix detected errors, and then click Start to begin the repair.

repair file system using Partition Magic

To Sum Up

Simply put, this post analyzes the possible reasons for WordPress failed to write file to disk error and offers several effective solutions. If you like this post, don’t forget to share it in your communities to help more users.

  • linkedin
  • reddit