HTTP Error When Uploading Images

Updates, Migrations & Maintenance

The media library refuses your image and won't say why.

datacram.com/fix/http-error-uploading-images-wordpress
Likely causes, ranked
HTTP Error When Uploading Images
PHP memory exhausted while resizingmost likely
The file exceeds upload or post size limitscommon
A missing or misbehaving image librarycommon
A security rule blocking the requestpossible
Fix steps in this guide5
the causes explained below, most likely first
What you’re seeing

You drag an image into the media library, the progress bar reaches the end, and it turns red with the words “HTTP error.” No detail, no reason. Sometimes smaller images work and larger ones do not.

What it actually means

The upload reached the server. Processing it is what failed. WordPress does real work after a file arrives — generating multiple resized copies, reading metadata, sometimes converting the format — and any of that can fail.

The message is bare because the failure happened inside a background request the editor cannot see into. As with the white screen, the cause is written to a log rather than to the screen, and the size clue is the most useful thing you have: if small images upload and large ones do not, you are looking at a resource ceiling rather than a broken feature.

What usually causes it

Most likely first.

  1. 1

    PHP memory exhausted while resizing

    Generating thumbnails from a large photograph needs far more memory than the file size suggests. The commonest cause.

  2. 2

    The file exceeds upload or post size limits

    upload_max_filesize and post_max_size cap what the server accepts, often at a modest default.

  3. 3

    A missing or misbehaving image library

    WordPress uses ImageMagick or GD. If neither is available or one is misconfigured, processing fails after the upload.

  4. 4

    A security rule blocking the request

    Firewall or mod_security rules can reject the upload POST while allowing everything else.

  5. 5

    A plugin conflict during processing

    Optimization, watermark, and CDN offload plugins all hook into uploads and can break them after an update.

How to fix it

Work through these in order. Take a backup before you change anything.

  1. Step 1Test with a small image

    Upload something under 100KB. If it works, this is a limit problem rather than a broken uploader, and you have narrowed it in ten seconds.

  2. Step 2Raise memory and upload limits

    Set PHP memory to 256M, and upload_max_filesize and post_max_size to at least 64M. Both size limits must be raised together, since the smaller one wins.

  3. Step 3Resize before uploading

    Almost nothing on a website needs an image wider than 2000 pixels. Exporting at a sensible size sidesteps the problem and makes the site faster.

  4. Step 4Disable image and CDN plugins

    Turn off optimization, watermark, and offload plugins, then retry. These hook directly into the upload path.

  5. Step 5Switch the image library

    If ImageMagick is failing, forcing WordPress to use GD instead often clears it. Your host can confirm which libraries are available.

When to stop and call someone

Call someone if raising the limits changes nothing, if uploads fail for every size including tiny files — which points at the image library or a server rule rather than resources — or if the media library is central to your business and the failure is blocking publishing.

Frequently asked

Because the file reached the server but failed during processing, when WordPress generates its resized copies. The message is bare because the failure happens in a background request. Memory limits are the most common cause, followed by upload size limits and image library problems.

That is the signature of a resource limit. Larger images need more memory to resize and may exceed the server's maximum upload size. Raising the PHP memory limit and the upload size limits usually resolves it immediately.

Rarely wider than 2000 pixels for a full-width image, and considerably less for anything smaller on the page. Uploading straight from a camera or phone wastes storage, slows the site, and is the reason most of these errors happen at all.

PHP memory limit to 256M, and both upload_max_filesize and post_max_size to at least 64M. The two size settings work together and the lower of them applies, so raising only one has no effect.

Yes. Image optimization, watermarking, and CDN offload plugins all hook into the upload process and can break it after an update. Disabling them one at a time and retrying identifies the culprit quickly.

Free · AI-powered · Emailed to you

See exactly what’s holding your website back.

Get a free audit of your site — speed, SEO, mobile, and security — with the fixes that matter most, delivered as a PDF to your inbox.

Get my free audit
CallGet a quote