You pick a photo, click upload, and instead of a thumbnail you get two unhelpful words: HTTP error. No code, no explanation, no hint of what went wrong. If you want to fix the WordPress HTTP error, the first thing to understand is that those two words are not a diagnosis — they are a placeholder. The uploader shows them whenever the server returns something unexpected, so a memory crash, a firewall block, and a permissions problem all look identical on screen.
What the WordPress HTTP Error Actually Means
When you upload an image, the media library sends it to /wp-admin/async-upload.php and expects a JSON response back. If that request returns anything else — a PHP fatal error, a firewall block page, or a gateway timeout — the uploader gives up and prints “HTTP error”.
First, find out which layer rejected the upload. Open your browser’s developer tools, go to the Network tab, filter by Fetch/XHR, then try the upload again and click the async-upload.php request. Its status code points at the cause:
| Status | What it usually means |
|---|---|
| 413 | The web server or CDN refused a body larger than its limit. |
| 403 | A firewall rule, security plugin, or mod_security blocked the request. |
| 500 | PHP stopped with a fatal error, often out of memory while resizing. |
| 502 / 504 | A gateway gave up waiting while PHP processed a large image. |
Quick Checks Before You Change Anything
1. Check whether the file actually uploaded. Open Media > Library and search for the file name. Sometimes the upload finished but the response was lost.
2. Try again in a private window. A browser extension or a stale login session can interrupt the upload. Log out, log back in, and retry in an incognito window.
3. Shrink the image first. WordPress scales any image wider or taller than 2,560 pixels down to that size automatically (the “big image” threshold, since WordPress 5.3). A 6,000-pixel photo forces PHP to hold the full uncompressed image in memory while it generates every thumbnail size. Resize the photo to 2,000 pixels on its longest side, export it as a JPEG under 1 MB, and upload that version. If it works, the file — not your site — was the problem. See my guide on how to optimize images in WordPress without losing quality.
If the smaller file uploads fine but the original still fails, you have a resource problem — move on to the memory and limits fixes.
Fix 1: Check Your Real Limits in Site Health
Before raising limits, find out what your site is running with. Go to Tools > Site Health > Info and open the Server and Media Handling sections. Note the max upload size, post-data size, memory limit, and active image editor. If your file is bigger than the max upload size, that alone explains the failure.
Fix 2: Raise the PHP Memory Limit
Uploading is not just saving a file. WordPress creates a thumbnail, a medium, and a large version of every image, plus any custom sizes your theme registers. A 6,000 x 4,000 photo at 24-bit colour needs roughly 72 MB of raw memory for the pixel data alone — enough to kill the request on a host with a 128 MB limit.
When WordPress processes images, it raises PHP memory to WP_MAX_MEMORY_LIMIT — 256 MB by default. If your server’s limit is lower, the server limit wins. Raise it in wp-config.php, above the line that says “That’s all, stop editing!”:
define( 'WP_MEMORY_LIMIT', '256M' ); define( 'WP_MAX_MEMORY_LIMIT', '512M' );
The first line raises the general limit; the second raises the limit used during admin tasks such as image processing. For the full walkthrough, see my guide on how to increase the WordPress memory limit. After the change, retry the exact file that failed. If it uploads, you are done — but resize photos before uploading from now on. A limit increase treats the symptom; smaller source files remove the cause.
Fix 3: Raise the Upload Size Limits
Three PHP settings control how large an upload your server accepts, and all three must be high enough. The smallest one wins:
upload_max_filesize = 64M post_max_size = 72M max_execution_time = 120
Keep post_max_size slightly above upload_max_filesize, because the posted request includes the file plus form data. On shared hosting, change these in your host’s PHP settings panel. On a server you control, edit php.ini and restart PHP-FPM. On Nginx there is a fourth limit: the web server itself can reject a large request body before PHP ever sees it — add client_max_body_size 64m; to your server block and reload Nginx.
Fix 4: Switch the Image Editor from Imagick to GD
WordPress resizes images with one of two PHP libraries: Imagick or GD. When both are installed, WordPress uses Imagick first. Imagick is powerful, but it tries to use multiple CPU threads, and on many shared hosts that threading model clashes with PHP-FPM and the request dies — a known issue going back to WordPress 4.5.
Making GD the default editor often fixes the HTTP error immediately. GD is simpler and more stable, though its output quality is slightly lower. Add the snippet with a code-snippets plugin such as WPCode, rather than editing your theme’s functions.php directly:
function amaarsite_prefer_gd_editor( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'amaarsite_prefer_gd_editor' );
After adding it, check Tools > Site Health > Info > Media Handling — the “Active editor” row should now show GD. Note that an image-optimization plugin can replace WordPress’s editor entirely, so test with that plugin deactivated too if the filter seems to change nothing. If you would rather keep Imagick, limiting it to one thread often removes the crash: on Apache, add SetEnv MAGICK_THREAD_LIMIT 1 to the .htaccess file in your WordPress root; on Nginx, set env[MAGICK_THREAD_LIMIT] = 1 in your PHP-FPM pool configuration and restart PHP-FPM.
Fix 5: Rule Out a Plugin or Firewall Conflict
Security plugins, image-optimization plugins, and firewall rules can all block the upload request. ModSecurity and other web application firewalls inspect the body of POST requests, and image uploads can trigger false positives on rules meant to catch file-upload attacks. A blocked request returns a 403, which the uploader again shows as “HTTP error”.
Test systematically. Deactivate your security and image plugins one at a time and retry the upload after each. If uploads work with one deactivated, you have found the culprit.
If one-by-one testing finds nothing, use the Health Check & Troubleshooting plugin. Its Troubleshooting Mode disables all plugins and switches to a default theme for your session only. If uploads work in that mode, reactivate plugins one by one until the error returns. The full half-split method is covered in my guide on how to fix WordPress plugin conflicts.
Fix 6: Check File Permissions and Disk Space
If every upload fails — even a tiny JPEG — WordPress may not be able to write to the uploads folder at all. Folders should be set to 755 and files to 644. Never use 777: it makes the folder world-writable and is a genuine security risk.
Check the permissions on wp-content/uploads from your host’s file manager or over SFTP. If the folder is owned by a different user than the one PHP runs as, WordPress cannot write into it even with correct-looking permissions — your host can correct that ownership mismatch in seconds. Also check disk space: a full disk produces exactly the same vague error.
Fix 7: Enable Debug Logging to Find the Real Error
If the fixes above did not work, stop guessing and read the actual error. Enable WordPress debug logging by adding these lines to wp-config.php:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
Then reproduce the failed upload and open wp-content/debug.log. The real error will be there — a memory-exhausted fatal error, an Imagick exception, or a permissions warning — and it will tell you exactly which fix to apply.
When you are done, remove the debug lines and delete debug.log. Leaving debug logging on fills your disk and can leak paths and plugin details. The official documentation on debugging in WordPress covers the full set of constants if you need them.
When to Contact Your Host
Some causes live outside anything you can change from the admin: a server-level firewall rule, a misconfigured PHP-FPM pool, or a full disk on a shared server. If uploads still fail, open a ticket with the evidence you gathered — the status code from the Network tab, the exact line from debug.log, and your Site Health values.
The Takeaway
The WordPress HTTP error is frustrating because it hides the real problem. Work through it in order: check whether the file actually uploaded, shrink the image, check your limits in Site Health, raise the memory limit, and switch the image editor from Imagick to GD. Those steps resolve most cases. If they do not, the debug log and the network status code will name the cause.
Need help fixing a stubborn upload error? I fix these issues for clients every week. Get in touch and tell me what error you are seeing — I will take a look.