Introduction
You drag an image into the WordPress media library and, instead of a thumbnail, you get a blunt red “HTTP error.” No explanation, no detail. It’s one of the most maddening WordPress messages because it covers several unrelated causes — but each has a clear fix once you know what to check.
First: Try Again in a Minute
Sometimes the HTTP error is temporary — a brief hiccup from your server being busy or a momentary timeout. Before changing anything, wait a minute and try the upload again, or refresh the page and retry. If it uploads fine, it was a passing glitch. If it keeps failing, work through the fixes below.
Cause 1: Server Memory Is Too Low
Image processing — especially resizing large photos into WordPress’s multiple sizes — needs memory. If your limit is too low, the upload fails. Raise it by adding this to wp-config.php above /* That’s all, stop editing! */:
define( 'WP_MEMORY_LIMIT', '256M' );
If raising it doesn’t help and you suspect memory is the issue, see the dedicated guide on the WordPress memory exhausted error.
Cause 2: The Image File Is Too Large
Modern cameras and phones produce huge images. If a file is larger than your server’s upload limit, it’s rejected — sometimes as an HTTP error, sometimes as a 413 Request Entity Too Large error. Resize or compress the image before uploading (a few thousand pixels wide is plenty for the web), or raise your upload limits.
Cause 3: The Image Editor Library
WordPress processes images with one of two PHP libraries — Imagick or GD. On some hosts, Imagick is misconfigured or memory-starved, which causes the HTTP error. You can tell WordPress to prefer GD instead by adding a small snippet to your theme’s functions.php:
add_filter( 'wp_image_editors', function( $editors ) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
} );
This puts GD first. If the HTTP error was an Imagick problem, uploads will start working immediately.
Cause 4: Server Security Rules (mod_security)
Some hosts run a firewall module called mod_security that can block media uploads it misreads as suspicious. You usually can’t change this yourself on shared hosting — a quick message to your host asking them to check whether mod_security is blocking your uploads often resolves it.
Cause 5: Your PHP Version
An outdated PHP version can struggle with image processing. In your hosting control panel, check that your site runs a current, stable release (PHP 8.x). Upgrading often clears up image-handling errors along with other quirks.
Frequently Asked Questions
Why does the same image upload sometimes work and sometimes not?
That usually points to memory or a busy server — the upload succeeds when resources are free and fails when they’re tight. Raising the memory limit makes it consistent.
Does the image format matter?
It can. Very large PNGs and high-resolution photos are the most likely to fail. Converting to a web-friendly JPEG or WebP and resizing first avoids most HTTP errors.
Is the GD snippet safe to add?
Yes — it just changes which image library WordPress prefers. If it doesn’t help, you can remove it with no side effects.
I’ve tried everything and it still fails — what now?
Ask your host to check server-side logs and whether mod_security or a low resource limit is blocking uploads. The real cause is often something only they can see.
Conclusion
The WordPress “HTTP error” on image upload is vague, but its causes are well known: low memory, oversized files, an image-library quirk, a server firewall, or an outdated PHP version. Work through them in order — retry, raise memory, resize the image, switch to GD, then check with your host — and your media library will start cooperating again.
Tweak settings with a safety net
Before editing functions.php or wp-config.php, take a quick backup with Nota Backup & Restore — so any change is a one-click undo. Start your 14-day free trial — no credit card required.
