More fixes

"Upload: Failed to write file to disk" in WordPress

You drop a photo into the Media Library and WordPress answers "Upload: Failed to write file to disk." (or "The uploaded file could not be moved to wp-content/uploads"). The photo is fine and the site is fine. The server took the file in and then had nowhere it was allowed to put it: the disk is full, PHP's temporary folder is full or locked, or the uploads folder will not accept writes.

What the owner sees

harborbakery.example/wp-admin/upload.php

What the checks found


  

Find out which case it is (five minutes)

  1. Look at disk space first. The host panel's usage page (cPanel's "Disk Usage", Plesk's "Statistics" or your host's dashboard) shows how close the plan is to its limit. A plan at 100% refuses every write, and the usual culprits are old backups kept inside the site folder, a huge error log, or a cache folder that never empties.
  2. Try a tiny file. If a 20 KB screenshot also fails, it is the disk, the temp folder or the permissions. If only big files fail with a different message, it is an upload size limit instead (see the upload error guide).
  3. Check PHP's temporary folder. PHP writes every upload to a temp folder before WordPress moves it. On shared hosting that folder can be full or have the wrong owner even when your own space is fine. Tools, Site Health, Info, "Directories and Sizes" plus the server section show the paths; your host can confirm the temp folder's state.
  4. Check the uploads folder. In the file manager, wp-content/uploads and the year/month folders in it should be 755 and owned by the same account as the rest of the site. Folders copied in during a site move are the usual ones with the wrong owner.

The fixes, by case

  1. The disk is full. Download old backups (zip files in the site root or in a backup plugin's folder) to your computer and delete them from the server, empty the cache plugin's cache, and clear an oversized error_log or debug.log after reading what filled it. If the site has simply grown, the plan needs more space.
  2. PHP's temp folder is full or locked. On shared hosting, ask the host to clear or fix it; it is their server folder, not yours. On your own server, check the free space where upload_tmp_dir (or the system temp folder) lives, and that the PHP user can write to it.
  3. The uploads folder will not take writes. Set wp-content/uploads and its subfolders to 755 (files 644) in the file manager. If they already are, the owner is wrong: the host can reset ownership to your account in a minute.
  4. After a site move: if Settings, Media still shows a "Store uploads in this folder" box with the old server's path, empty it and save, so WordPress uses the normal wp-content/uploads again.
  5. Test: upload a small photo, then a normal-sized one, and open both in the Media Library to see the thumbnails were made.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
Disk usage at or near 100%No room for any new fileMove old backups and logs off the server, or a bigger plan
Space is free, every upload still failsPHP's temp folder is full or not writableThe host clears or fixes it
"Could not be moved to wp-content/uploads"The uploads folder's permissions or owner755 folders, 644 files, owner reset by the host
Started right after moving the siteOld upload path in Settings, Media, or files copied in as another userEmpty the path box; ask the host to reset ownership
Only big files fail, small ones uploadAn upload size limit, not the diskSee the upload error guide

What not to do

Most of these are a clean-up or one message to the host. If the disk fills up again every few weeks, or nobody knows what is eating the space, that is what the box below is for. Related: WordPress will not upload a photo or file, "Sorry, this file type is not permitted" and images not showing.