Email VPS
Troubleshooting and repair

Image upload fails in WordPress, causes and the fix

Uploading an image to the media library

An image upload usually fails for one of four reasons, and the error text tells you which group the case belongs to. If WordPress says the file is too large, this is a limit. If it just says HTTP error, this is about processing or permissions.

In short

  • A size limit and an HTTP error are different things and are fixed in different places.
  • Shrink the image before uploading, that resolves most cases immediately.
  • A recurring HTTP error with large images almost always means a memory limit.

1. If the error mentions the file size

The server has an upper limit for a single upload. The usual answer is not to raise the limit but to shrink the image. A web page rarely needs anything wider than two thousand pixels, and a file straight from a camera is many times larger than necessary. A smaller image also speeds the site up, see our guide on why a WordPress site is slow.

2. If the error is a plain HTTP error

This means the upload succeeded but processing the image failed. WordPress creates several sizes of every image, and that step is what consumes memory. A large image can break processing even when the upload itself goes through. Running out of memory is covered in our guide on Allowed memory size exhausted.

3. Check the directory permissions

Images go into wp-content/uploads. If that directory cannot be written to, the upload fails or the file disappears right afterwards. A working baseline is 755 for directories. Permissions usually go wrong after a migration, and the topic is also touched on in our guide on 403 Forbidden.

4. Rule out disk space

A full disk shows up as exactly this kind of intermittent upload failure. Check the remaining space in your hosting panel. The most common consumer is a backup plugin storing its archives on the same disk as the site.

5. Try another format and file name

Accented characters, spaces and very long file names still cause trouble in some environments. Rename the file without special characters and try again. If the problem affects only one image, the cause is almost certainly in the file itself.

6. If the upload works but the image does not show

That is a different symptom, covered in our guide on images not showing on the site.

What not to do

Do not raise the upload limit so high that ten megabyte images go through. They end up on the site as they are, slow every page load down and eat disk space. The right order is to shrink the image first.

If you would rather not do it yourself

We find out whether this is a limit, permissions or memory, and fix the right place. We also look at whether the image sizes make sense, because oversized images slow the site down even when the upload succeeds.

See how we repair a broken site »