HTTP error when uploading an image to WordPress: causes and fixes
The “HTTP Error” when uploading an image to WordPress is a generic message: the upload failed, but WordPress didn’t say why. The most common causes are an image that is too large for PHP’s memory, a low upload limit, wrong permissions on the wp-content/uploads folder and problems with the server’s image library. In most cases, testing a smaller image and checking the memory limit will point you to the solution.
This article is for anyone who sees the message in the media library, in the block editor or in a page builder. It shows how to diagnose the problem, what to fix for each cause and when to ask your hosting provider for help.
What does “HTTP error” mean in WordPress?
WordPress uploads the image in the background and then processes it: it generates the thumbnails and intermediate sizes. If any step fails without a clear response from the server, only “HTTP Error” appears, often at the end of the progress bar.
That’s why the message doesn’t indicate the cause. To find it, you need to run tests and check the PHP error log.
Step 1: run quick tests to find the cause
Before changing any file, run these tests and observe the results.
- Upload a small image, a few KB, in JPG format. If it works, the problem is with the size or processing of the original image.
- Rename the file to something simple, such as
test-photo.jpg, without accents, spaces or symbols. - Try another browser or a private window, to rule out browser extensions.
- Temporarily disable optimization or security plugins and try again. Re-enable them one at a time.
If the error only happens with large images, go to step 2. If it happens with any file, go to step 3.
Cause 1: image too large or upload limit too low
PHP has limits on the size of uploaded files (upload_max_filesize and post_max_size). When the limit is exceeded, WordPress usually shows a specific message, but some themes and page builders only show the generic error. Check the current limit under Media > Add New, which shows the “Maximum upload file size.”
To adjust it, follow the article on the upload_max_filesize limit error in WordPress. As a rule of thumb, reduce your photos before uploading: an image from a camera or phone is often much larger than the site needs.
Cause 2: insufficient PHP memory
This is one of the most frequent causes. To generate thumbnails, WordPress loads the entire image into memory, and the amount used depends on the width and height in pixels, not just the file size in MB. A lightweight JPG with huge dimensions can exhaust the memory.
You can ask WordPress for more memory in wp-config.php, before the line that says to stop editing:
define( 'WP_MEMORY_LIMIT', '256M' );
Make a copy of the file before editing it. This value only works if the server’s PHP limit allows it. If it doesn’t solve the problem, adjust the memory_limit directive from your control panel (in cPanel, under Select PHP Version or in the MultiPHP INI Editor, if available) or ask your hosting provider.
Cause 3: permissions on the wp-content/uploads folder
If WordPress can’t write to the uploads folder, the upload fails. This happens after migrations, backup restores or user changes on the server.
- In cPanel, open the File Manager and go to your site’s folder.
- Enter
wp-contentand locate theuploadsfolder. - Right-click it and choose Change Permissions.
- The usual permissions for folders are
755, and for files,644. Avoid777, which is insecure.
If Media shows a notice that the uploads directory could not be created, this is the problem.
| Value | Common use |
|---|---|
| 755 | Folders |
| 644 | Files |
| 777 | Avoid: anyone can write to it |
Cause 4: image library (Imagick or GD)
WordPress uses a server library to resize images: Imagick or GD. On some servers, Imagick fails with certain images and produces the error. To see which one your site uses, go to Tools > Site Health > Info > Media and check the “Image editor” entry.
A known fix is to have WordPress use GD. Add the following to your theme’s functions.php, preferably in a child theme, so the change isn’t lost during updates:
add_filter( 'wp_image_editors', function () {
return array( 'WP_Image_Editor_GD' );
} );
Make a copy of the file first. A typo in functions.php can take down the site, and then you’ll need to follow the guide on 500 error or white screen in WordPress.
Cause 5: file name, format or plugin conflict
Less common problems, but easy to check:
- File name: accents, spaces, emojis and symbols can cause failures. Rename the file using lowercase letters, numbers and hyphens.
- Format: JPG, PNG, GIF and WebP work in current versions of WordPress. Camera formats, such as HEIC, may not be accepted: convert them to JPG. See also the article on WebP in WordPress.
- Plugins: optimization, security or firewall plugins can block or interfere with the upload. Disable them one at a time to find the culprit. See how to install and manage plugins.
- Disk space: if the account is out of space, no file gets saved.
How to see the real error in the log
If nothing has worked, the PHP error log shows the real cause, such as “Allowed memory size exhausted” or “Permission denied”. The article on 500 error and white screen explains how to find the error_log and turn on debug mode. Try uploading the image again and read the last lines.
Frequently asked questions
Why does WordPress only show “HTTP Error” and not the cause?
Because the upload happens in the background and, when the server fails without a clear response, WordPress only shows the generic message. The real cause is in the PHP error log.
A small image works but a large one doesn’t. What should I do?
It’s probably a memory or upload limit. Reduce the image dimensions before uploading and, if you need large files, increase the PHP limits.
What permissions should the uploads folder have?
The standard is 755 for folders and 644 for files. Avoid 777, as it leaves the folder open for writing by any user on the server.
Is switching from Imagick to GD safe?
Generally yes, and it’s a well-known fix for Imagick failures. Make a copy of functions.php first and use a child theme. If something goes wrong, restore the copy.
Can a plugin cause the error?
Yes. Optimization, security and firewall plugins can block or interfere with the upload. Disable them one at a time to identify which one causes the problem.
Do I need a backup before changing these things?
Yes, before editing wp-config.php, functions.php or permissions. See how to back up WordPress.
If the error still persists, contact our team and send the message from the error log: with it, finding the cause will be much faster.