Troubleshooting · Troubleshooting
How to Fix the HTTP Error When Uploading Images in WordPress
Short answer
To fix the HTTP error when uploading images in WordPress, first shrink the image below 2560 pixels on its longest side and below your upload limit. If it still fails, raise the PHP memory limit to 256M, check that upload_max_filesize and post_max_size allow the file, and switch the image editor from Imagick to GD if needed.
Key takeaways
- The HTTP error is a generic message, so the real cause is a failed step in the upload chain, not the message itself.
- PHP defaults are upload_max_filesize 2M, post_max_size 8M and memory_limit 128M, which many large photos exceed.
- WordPress scales images wider or taller than 2560 pixels down to that size, as of November 2026.
- Folders should be 755 and files 644, and no uploads folder should ever be set to 777.
- If uploads fail only behind Cloudflare, its 100 MB limit on Free and Pro plans may be the cause.
- Tools, then Site Health, then Info shows your memory limit, upload limits and active image editor.
What does the HTTP error mean when you upload an image?
The HTTP error is a generic message that means the upload request failed somewhere between your browser and the server.
WordPress shows this message when it cannot finish an upload, but it does not name the cause. The failure can happen while the file moves to the server, while WordPress creates smaller copies, or while it saves the file.
The message is different from a named error such as "The uploaded file exceeds the upload_max_filesize directive in php.ini". That named error points at one setting. The HTTP error asks you to work through the likely causes in order.
A related message is “The server cannot process the image”. It means the same kind of failure during image processing. The fixes in this guide apply to both messages.
What causes the HTTP error most often?
The most common causes are a file that is too large, too little PHP memory, a broken image editor, wrong folder permissions, or a plugin or security rule that blocks the upload.
Start with the file itself, because that check takes seconds. A photo straight from a camera can be 10 MB or more, with a width above 4000 pixels. That size can pass the upload limit and still fail while WordPress builds smaller copies.
Memory is the next likely cause. Image work loads the picture into memory, so a large file needs far more memory than its file size. A low limit stops the process halfway through.
The other causes are less common but real. The uploads folder may not be writable, the Imagick library may fail on a format, or a security plugin may block the request. Work through them in the order below.
| Cause | First sign | Where to check |
|---|---|---|
| File too large | Fails on big files only | Media, then Add New Media File |
| Low PHP memory | Fails on large photos | Tools, then Site Health, then Info |
| Broken image editor | No smaller copies are made | Tools, then Site Health, then Info, then Media Handling |
| Wrong permissions | “Could not be moved” message | File manager or FTP |
| Plugin or security rule | Fails after a new plugin | Plugins screen, then deactivate to test |
How do you check your upload and memory limits?
Open Media, then Add New Media File, and read the “Maximum upload file size” line under the upload area.
That number is the smaller of two PHP settings. The PHP manual lists the defaults as upload_max_filesize 2M, post_max_size 8M and memory_limit 128M, as of November 2026. Your host may set higher values.
The PHP manual also states that post_max_size must be larger than upload_max_filesize, and that memory_limit should generally be larger than post_max_size. If post_max_size stays at 8M, raising only upload_max_filesize changes nothing.
Next, open Tools, then Site Health, then Info. The Server section shows the PHP memory limit and time limit. The Media Handling section shows the upload limits and the active image editor.
WordPress.org recommends PHP 8.3 or greater and MariaDB 10.11 or greater or MySQL 8.0 or greater, as of November 2026, on its requirements page. An old PHP version can also lack a working image library, so note the version shown in Site Health.
How do you fix the error by making the image smaller?
Resize the image to under 2560 pixels on its longest side and compress it before you upload it again.
WordPress scales images wider or taller than 2560 pixels down to that size. The big_image_size_threshold reference gives 2560 as the default threshold, as of November 2026. Uploading a file already below that size skips the heaviest step.
Use JPEG for photos and PNG for screenshots or line art. Convert HEIC photos from a phone to JPEG first if your server cannot process HEIC files. Keep the file under your stated upload limit, not just under the pixel limit.
Rename the file with plain letters, numbers and hyphens, such as team-photo-2026.jpg. Special characters and spaces in a file name can break an upload on some servers.
If the smaller file uploads, the cause was size or memory, not permissions. For more on sizing, read how to properly size images in WordPress.
How do you raise the PHP memory limit?
Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, above the line that says “That's all, stop editing!”.
WordPress asks PHP for this amount of memory on each request. The wp-config.php handbook states that WP_MEMORY_LIMIT defaults to 40M on a single site and 64M on multisite, as of November 2026. That default is often too low for large photos.
The same handbook states that WP_MAX_MEMORY_LIMIT defaults to 256M and applies to admin work, which includes image processing. Add define( 'WP_MAX_MEMORY_LIMIT', '512M' ); on the next line if your host allows it.
Back up the site before you edit wp-config.php. If you do not have a backup routine, read how to back up WordPress first. A single wrong character in this file can take the site down.
After saving, open Tools, then Site Health, then Info, then Server, and check the PHP memory limit shown there. If it did not change, your host caps the value, and only the host can raise it.
If the upload still fails with a memory message, read how to fix Allowed Memory Size Exhausted.
How do you raise the upload size limits?
Raise upload_max_filesize and post_max_size together in php.ini or in your host control panel, keeping post_max_size larger.
The PHP manual lists upload_max_filesize at 2M and post_max_size at 8M by default, as of November 2026. A file larger than upload_max_filesize is rejected, and a request larger than post_max_size never reaches WordPress. Set both above the file size you need.
A working pair for a 64 MB file is upload_max_filesize 64M and post_max_size 80M. Keep memory_limit above post_max_size, so set memory_limit to 256M in the same file. Save, restart PHP if your host asks for it, then check the “Maximum upload file size” line again.
Some hosts do not let you edit php.ini. Use the PHP settings tool in your host control panel instead, or ask support to set the three values. The upload_size_limit filter and wp-config.php cannot raise these PHP limits.
Note the limit of 20 files per request in the PHP manual, listed as max_file_uploads 20 by default. Uploading more than 20 files at once can fail even when each file is small, so upload in smaller groups.
How do you switch the image editor from Imagick to GD?
Switch WordPress from Imagick to GD when Imagick fails on a format or runs out of memory, by asking your host to change the active editor or by adding a small filter in a child theme or custom plugin.
WordPress resizes images with one of two PHP libraries: Imagick or GD. The WP_Image_Editor_Imagick reference states that WordPress requires Imagick 2.2.0 or greater, as of November 2026. It also notes that Imagick uses less PHP memory than GD.
That lower memory use does not help if Imagick itself is broken or lacks support for your file format. GD is the other editor, described in the WP_Image_Editor_GD reference. If GD is installed, WordPress can use it instead.
First, check Tools, then Site Health, then Info, then Media Handling. It names the active editor and the formats each library supports. If Imagick is active and the format you need is missing, ask your host to enable GD or to fix Imagick.
ImageMagick is the software behind Imagick, and its sitemap page states that it works with images in over 200 formats, as of November 2026.
That range only helps if the server build includes the format you upload. A format missing from Site Health will fail on either editor until the host adds it.
How do you fix uploads folder permissions?
Set wp-content/uploads and its folders to 755 and the files inside to 644, using your host file manager or FTP.
WordPress must be able to write to the uploads folder to save an image. If it cannot, the upload fails or you see a message that the file could not be moved. Check the folder first if small files also fail.
The WordPress file permissions handbook gives 755 or 750 for directories and 644 or 640 for files in a suexec setup, as of November 2026. It also states that wp-config.php should be 440 or 400.
Never set the uploads folder to 777. The same handbook states that no directory should ever be given 777, even upload directories, because 777 lets every user on the server write to it. Use 755 and fix the folder owner if 755 does not work.
If you changed permissions and uploads still fail, check that the disk is not full. A full disk gives the same failed upload, and only the host or a cleanup can fix it.
How do you find a plugin or security rule that blocks uploads?
Deactivate your image, security and optimisation plugins, try the upload again, then reactivate them one at a time.
Image optimisation plugins process every upload, so a failed optimisation step can stop the whole upload. Security plugins and firewalls can also block the upload request as a false alarm. If the upload works with plugins off, one of them is the cause.
Use the Health Check plugin or the troubleshooting mode in Site Health to test without changing the live site for visitors. That mode disables plugins only for your session. Keep a note of which plugin you reactivated last before the error came back.
Cloudflare can also block an upload before it reaches WordPress. The Cloudflare Error 413 page lists a max upload size of 100 MB on Free and Pro plans, 200 MB on Business, and up to 5 GB on Enterprise, as of November 2026.
A file over your plan limit gets a 413 error.
If the error started after a theme change, switch to a default theme for one test upload. If the upload works, the theme is the cause. A theme rarely blocks uploads, but a theme that adds image sizes can run out of memory on large files.
How do you know the fix worked, and when should you contact your host?
Upload the same file that failed before, then check that it appears in the Media Library with its smaller copies.
Open Media, then Library, and click the image. The attachment page should show the file and its sizes. If only the full-size file appears and no smaller copies exist, the image editor still failed, so go back to the Imagick and GD section.
Try a second file of a different format, such as a JPEG after a PNG, to confirm the fix is not limited to one file type. If both upload and show smaller copies, the fix worked.
Contact your host when Site Health shows a limit you cannot change, when neither GD nor Imagick appears in Media Handling, or when the error log names a server limit.
Tell support the exact file size, the exact error message, and the values shown in Site Health. That detail lets them check the right log.
If uploads fail with a 500 error instead, the cause may be a server error rather than an upload limit. Read how to fix the 500 Internal Server Error for that case.
What mistakes should you avoid?
Do not set permissions to 777, do not raise only one PHP limit, and do not leave debug logging on after you finish.
Raising only upload_max_filesize is the most common mistake. The PHP manual states that post_max_size must be larger than upload_max_filesize, so raise both, with memory_limit above them. Check the number shown under Media, then Add New Media File, after each change.
Do not edit wp-config.php without a backup, and do not paste code from a random page into functions.php. A syntax error in either file can break the whole site. Use a child theme or a code snippets plugin for any filter change.
Turn on debug logging only while you diagnose the fault. Add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to wp-config.php, repeat the upload, then read wp-content/debug.log. Set both back to false when you finish, so errors are not written to a public log file.
For format choices after the upload works, read how to serve WebP and AVIF images in WordPress. A smaller format reduces the chance of the same error on the next upload.
Frequently asked questions
Why does the HTTP error appear only for large images?
Large images need more PHP memory and more time while WordPress builds smaller copies, so they hit limits that small images never reach. The PHP defaults are upload_max_filesize 2M, post_max_size 8M and memory_limit 128M, and a photo above those values can fail. Resize the image below 2560 pixels on its longest side, compress it, and try again before changing server settings.
Is the HTTP error the same as a 413 error?
No, they are related but different. A 413 error means the request body was larger than a server or proxy limit, such as the Cloudflare limit of 100 MB on Free and Pro plans. The HTTP error is a generic WordPress message that can come from size, memory, the image editor, permissions or a plugin. Check the exact message and your Site Health limits to tell them apart.
Can I fix the HTTP error without contacting my host?
Yes, in many cases. Shrinking the image, renaming it, deactivating a conflicting plugin and raising WP_MEMORY_LIMIT to 256M in wp-config.php are all steps you can do yourself. You need your host only when a PHP limit is locked, when neither GD nor Imagick is installed, or when the uploads folder owner or disk space is the problem.
Does switching from Imagick to GD always fix the error?
No, it fixes only the cases where Imagick itself fails on a format or runs out of memory. If the file is over the upload limit, if PHP memory is too low, or if folder permissions are wrong, switching editors changes nothing. Check Site Health first, confirm which editor is active, and fix the limit or permission that matches your error.
Should I set the uploads folder to 777 to fix the error?
No, never set any folder to 777. That value lets every user on the server write to the folder, which is a security risk. WordPress documentation gives 755 for directories and 644 for files. If 755 does not work, the folder owner is usually wrong, so ask your host to fix the ownership instead of opening the permissions wider.
How do I read the WordPress debug log for an upload error?
Add define WP_DEBUG true and define WP_DEBUG_LOG true to wp-config.php, above the stop editing line, and set WP_DEBUG_DISPLAY to false. Repeat the failed upload, then open wp-content/debug.log and read the last lines for the file and line that failed. Turn both settings back to false when you finish, so the log does not keep growing on a live site.
Sources
- Changing File Permissions WordPress.org
- Description of core php.ini directives PHP Manual
- Editing wp-config.php WordPress Developer Resources
- big_image_size_threshold WordPress Developer Resources
- WP_Image_Editor_Imagick WordPress Developer Resources
- ImageMagick Sitemap ImageMagick
- Error 413 Cloudflare Docs
- Requirements WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
