How to Fix the “HTTP Error” When Uploading Images in WordPress
WordPress's vague "HTTP error" usually comes down to a handful of causes. Here's how to find yours, starting with the quickest fixes.

The WordPress “HTTP error” during image upload means the server failed while processing the file, usually because of a temporary glitch, an oversized image, too little PHP memory, the image library (Imagick) struggling, or a plugin or security rule blocking the request. Start by refreshing and retrying, then resize and rename the image, then raise the PHP memory limit and switch the image editor to GD. If none of that works, check plugins and your host’s upload limits.
What causes the HTTP error
When you upload an image, WordPress doesn’t just store it — it creates multiple resized copies (thumbnails, medium, large and, since WordPress 5.3, a “scaled” version for very large images). That processing uses PHP memory and CPU time. If anything interrupts it, the media uploader shows the generic message HTTP error with no details.
| Cause | Typical sign | Fix |
|---|---|---|
| Temporary server hiccup or expired session | Happens once, then works | Refresh, log in again, retry |
| Very large image (dimensions or file size) | Phone or camera photos fail, small images work | Resize before upload |
| Unusual file name or format | Only certain files fail | Rename, convert to JPG/PNG/WebP |
| Low PHP memory limit | Fails on most larger images | Raise WP_MEMORY_LIMIT |
| Imagick problems on the server | Fails during “crunching” | Prefer GD image editor |
| Plugin or security rule (e.g. ModSecurity) | Started after installing a plugin | Deactivate plugins, ask host |
| Server upload/timeout limits | Big files always fail | Raise limits via host |
Before you start
Some fixes below involve editing wp-config.php or theme/plugin code. Back up your site first (most hosts offer one-click backups) and use SFTP or your host’s file manager. A typo in wp-config.php can take your site offline until you fix it.
Fixes, in order
1. Refresh and retry
- Reload the page (or log out and back in if you’ve been idle for a while).
- Try the upload again, ideally in a different browser or a private window to rule out extensions.
- Try uploading via Media > Add New Media File instead of from inside the block editor.
2. Shrink the image
Photos straight from a modern phone can be 4,000+ pixels wide and several megabytes. Resize to around 2,000–2,560 pixels on the long edge and compress it before uploading. Most web images don’t need to be bigger.
3. Rename the file and check the format
Remove special characters, accents and apostrophes from the file name (for example rename Café menu (final).jpg to cafe-menu-final.jpg). Make sure the file is a format WordPress accepts — JPG, PNG, GIF, WebP and, on recent versions, AVIF if your server supports it. iPhone HEIC photos may need converting first depending on your WordPress version and server.
4. Increase the PHP memory limit
- Open
wp-config.phpin your site’s root folder. - Above the line that says
/* That's all, stop editing! */, add:define( 'WP_MEMORY_LIMIT', '256M' ); - Save and try the upload again.
Your host may cap memory below this value. You can check the effective limit under Tools > Site Health > Info > Server (look for PHP memory limit) and WordPress Constants.
5. Switch the image editor from Imagick to GD
WordPress uses Imagick if it’s available, otherwise GD. On some shared hosts Imagick runs out of resources and causes the HTTP error. You can tell WordPress to prefer GD with a tiny snippet in a site-specific plugin or your child theme’s functions.php:
add_filter( 'wp_image_editors', function() { return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); } );
Alternatively, ask your host to limit Imagick to a single thread. If uploads start working, you’ve found the culprit.
6. Deactivate plugins and switch theme temporarily
- Go to Plugins > Installed Plugins, select all, and choose Deactivate (or test on a staging site first).
- Try the upload. If it works, reactivate plugins one by one until the error returns.
- Image optimization, security and CDN plugins are common suspects.
- If plugins aren’t the cause, switch to a default theme such as Twenty Twenty-Five under Appearance > Themes and test again.
7. Check upload size and timeout limits
The maximum upload size is shown on Media > Add New Media File. If it’s small, or very large files fail, your host needs to raise PHP’s upload_max_filesize, post_max_size and max_execution_time. Many hosts let you change these in their control panel; others require a support ticket. Ask them as well whether a ModSecurity or firewall rule is blocking async-upload.php.
8. Check folder permissions and HTTPS
The wp-content/uploads folder usually needs permissions of 755 (folders) and 644 (files). Also confirm that both WordPress Address and Site Address under Settings > General use the same protocol (https) as the address in your browser — a mismatch can break admin requests.
9. Update everything and look at the logs
Update WordPress, plugins, themes and, through your host, PHP to a currently supported version. If the error persists, turn on debugging by adding define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to wp-config.php, try the upload, and read wp-content/debug.log. Turn debugging off afterward. The official Common WordPress Errors page is also worth a look.
Bottom line
The HTTP error is a symptom, not a diagnosis. In most cases a smaller, cleanly named image or more PHP memory fixes it. If not, switching to the GD editor, ruling out plugins and asking your host about upload limits or security rules will find the cause.
FAQ
Why does the HTTP error only happen with some images?
Usually because those images are larger in pixel dimensions, use an unusual format, or have special characters in the file name. Large images need far more memory to resize.
Is it safe to edit wp-config.php?
Yes, as long as you back it up first and add lines in the right place. A syntax mistake can take the site down, so keep the original copy handy to restore.
Will an image optimization plugin fix the HTTP error?
It can help by resizing images on upload, but some optimization plugins are themselves a cause. Test with plugins deactivated before adding another one.
Can I upload images another way while I troubleshoot?
Yes. You can upload files via SFTP to wp-content/uploads, but they won’t appear in the Media Library automatically, so this is only a stopgap.



