Website support, maintenance and fixes for UK businessesCall 0208 088 8371info@websupportservices.co.uk

HomeWordPress errorsFix WordPress Failed to Write File to Disk

Fix WordPress Failed to Write File to Disk

The WordPress "Upload: Failed to write file to disk" message means PHP received an upload but could not write it successfully to storage. It usually points to a server filesystem or temporary directory problem rather than a fault with the image itself.

The message you might see

Upload: Failed to write file to disk.

Different wording, or a file path in the message? Paste it into our free error finder to see which plugin or theme it comes from.

What failed to write file to disk means

PHP identifies this condition as UPLOAD_ERR_CANT_WRITE, upload error code 7. In practical terms, the upload reached PHP but the server could not write the file to disk.

WordPress uploads normally pass through PHP's temporary upload handling before being moved into the site's media storage under wp-content/uploads. A failure can therefore happen before WordPress writes the final media file, or because WordPress cannot write to the destination afterwards.

This distinction matters. Changing WordPress settings will not repair a full server disk or an unwritable PHP temporary directory. Conversely, changing PHP limits will not fix incorrect ownership on wp-content/uploads. The safest approach is to identify which location cannot be written to before changing permissions.

Common causes of failed WordPress uploads

Incorrect filesystem ownership or permissions are common after a site migration, manual restore or hosting account change. The files may belong to one system user while PHP runs as another, leaving WordPress unable to create new files or directories.

A server or hosting account can also be out of storage space or inode capacity. In that situation, uploads may fail even though the website itself still loads normally. Temporary storage is another possibility. PHP can be configured with an upload_tmp_dir, and problems with that directory can interrupt an upload before WordPress gets the file.

Less commonly, restrictive server security settings, a read only filesystem or a hosting fault can block writes. If uploads stopped suddenly without a WordPress change, checking server storage and recent hosting changes is usually more useful than reinstalling plugins.

How to fix failed to write file to disk

  1. Take a full backup of the website files and database before editing configuration, permissions or server files.
  2. Check your hosting storage usage first. Remove only files you recognise and no longer need, or increase the available storage. Do not delete WordPress core files, wp-config.php or unfamiliar server files to make space.
  3. Confirm whether WordPress can create files in wp-content/uploads. If existing media loads but every new upload fails, inspect that directory's ownership and permissions through your hosting panel, SFTP or your host's support tools.
  4. Use the permissions recommended for your actual hosting configuration. WordPress documents 755 directories and 644 files as common values in many setups, but server ownership and PHP execution model matter. Do not set the uploads directory to 777 as a general fix.
  5. Ask the host to check PHP's temporary upload directory if the destination permissions are correct. The PHP setting involved may be upload_tmp_dir, and the PHP process needs permission to write there.
  6. Check the PHP and web server error logs at the time of a failed upload. Disk full, permission denied, read only filesystem and temporary directory errors normally provide a clearer diagnosis than the WordPress message.

If you edit php.ini or another server configuration file, change only the setting you have identified as faulty and keep a copy of the original configuration so it can be restored.

When to get help with WordPress upload failures

Stop changing permissions if the correct owner is unclear, if multiple sites on the same account are affected, or if the hosting filesystem reports read only behaviour. Those cases can require server administration rather than a WordPress change.

You should also investigate further if writable files or directories unexpectedly change ownership. Repeatedly applying broader permissions can conceal the original configuration problem and weaken the site's security.

Web Support Services offers an Emergency Fix for £249 per incident with a response within 2 working hours. Care plans start from £59 a month for ongoing website maintenance and support.

Common questions

Answers to the questions we hear most about this.

Is failed to write file to disk a WordPress permissions error?

It can be, but not always. Incorrect permissions or ownership are common causes, while a full disk, an unwritable PHP temporary directory or a server filesystem problem can produce the same error.

What permissions should wp-content/uploads have?

755 is common for directories on many WordPress hosting configurations, but the correct setting depends on file ownership and how PHP runs on the server. Check your host's requirements rather than applying permissions blindly.

Will changing the upload size fix failed to write file to disk?

Usually not. This particular PHP error means the server failed while writing the file. Upload size limits produce different PHP upload errors, so storage, temporary directories and write access should be checked first.

Site down or showing an error?

Call us now. Emergency Fix is £149 with a response within 2 working hours, and no fix means no fee.

Get website support