The “HTTP error” when uploading images to WordPress

You drag a photo into the media library, the bar fills up, and at the end it says “HTTP error” and nothing else. The message tells you nothing because all WordPress knows is that the server did not answer well. The image itself is rarely the cause: it is a limit, a lack of space or memory, or a plugin getting in the way.

Find out which one, in this order

1 Upload a small image. If a small one goes through and a big one fails, the problem is size: the file in bytes, or the dimensions in pixels (phone photos are huge). Shrink it before you upload.
2 Read the limit WordPress shows. The add-media screen displays the maximum file size. If your image is bigger, raising the WordPress upload limit applies.
3 Check there is still room. A full account refuses to write, and WordPress says “HTTP error”. Disk use is shown in cPanel. The limits nobody advertises are in inodes, processes and memory.
4 Rename the file. Accents, spaces, brackets and symbols can trip a security rule. Use lower-case letters, no accents, and hyphens: blue-chair.jpg.
5 Deactivate the security, image-optimisation and cache plugins and try again. If it goes through, switch them back on one by one to find the one responsible.
6 Change the image editor. WordPress uses the Imagick extension when it is switched on and GD when it is not. Imagick exists on our servers but ships switched off; if you turned it on and uploads began to fail, turn it off in “Select PHP Version” and try again. See switching a PHP extension on or off.
7 Read the error log. If it still fails, the log says what the screen does not: memory exhausted, time exceeded, a function missing. See where the PHP error log is and how to read it.

Causes and tell-tale signs

Cause How you recognise it
File above the upload limit Fails only with large images. The log mentions upload_max_filesize or post_max_size.
Memory or time run out while creating the sizes The bar reaches the end and only then fails. The log mentions memory or maximum execution time.
Disk or quota full Fails with any image, however small.
A plugin or a security rule Fails the moment you deactivate or activate one particular plugin.
A misbehaving Imagick Fails only on certain files, or after you switched the extension on.
Do not fix this by opening the permissions to everyone. Giving the uploads folder full permission cures none of the causes above and leaves the folder open to anybody who wants to drop files in it. If wp-content/uploads does not accept writing, the right answer is for it to belong to your account with the normal permissions, which is what a panel install already does.
Shrink before you upload. A website does not need the dimensions your camera takes. Resize and compress the photo first: the upload works, the page opens faster, and the account uses less disk. See image optimisation and WebP.

Still failing with a small image? Send us the approximate time of the attempt and the site address, and we will look for what the server recorded.

Open a support ticket

SEE ALSO

WordPress hosting

Support Policy

Hosting plans

RECOMMENDED PRODUCT

WordPress hosting

One-click install, updates handled, and speed that holds up. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?