This post was last updated on 9/5/2018
I believe many people encountered this HTTP error when uploading images to WordPress.
The last time this happened to us was several days ago, after the hosting transfer, so I thought to share with you several solutions that may help you solve this problem.
This error appears after the image is “struggling” to upload for a while. Sometimes, the image is uploaded even if the error appears.
Most of the time it’s the image’s size (height and width) that causes this, so trying to upload big images could trigger the issue.
13 solutions for the HTTP error
Sometimes, the error can appear just once, for a particular image, but if it persists, try the solutions below.
Here’s how the HTTP error looks like when you try to upload an image:
In order to make a screenshot of the error, I’ve tried to upload a big sized image, and as you can see, it did trigger the error.
Now let’s get to our solutions:
1. Optimize the images by decreasing their size. Don’t add a 2000 x 1500 image, for example. If your post content area is 700px wide, don’t add an image larger than that.
2. Change the image’s extension from .png to .jpg, or vice versa, then upload it again.
3. If the problem appears after installing a plugin, deactivate it and try it again. Some plugins can trigger the error.
4. Increase your PHP memory by adding this code define('WP_MEMORY_LIMIT', '64M')
into your wp-config.php file.
Increasing your PHP memory limit might not work if your host does not allow you to increase the PHP memory limit, especially on shared environments.
So, I suggest talking to your web host’s support and figure out a solution.
Read this guide if you need to know how to access and edit your WordPress files.
5. Add one of these codes in .htaccess:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
or
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>
or
AddType x-mapp-php5 .php
(at the very top of your .htaccess file)
The codes can differ from server to server, so it’s best to contact your hosting support and ask them if it’s alright to add one of the codes, or ask them to do it for you.
6. Check with your hosting company to make sure that they are using PHP 5.2.4+ and they haven’t limited anything regarding uploads.
Once, when we were on HostGator (this is an affiliate link), someone from support was checking out an issue and discovered that we didn’t have the correct version of PHP. So it’s a good thing to “bug” your hosting support and ask them.
7 (Update). This fix was pointed out by a couple of our readers. We thank them for that!
Make sure you don’t have an apostrophe in the image file’s name (e.g. mary‘s-wedding.png), because that will trigger the error as well.
8 (Update). If you’re using an image optimizer plugin, deactivate it and see if that solves the issue. If the plugin was the cause, try different configuration settings or contact the plugin developer.
We’ve experienced such an issue with the EWWW Image Optimizer plugin, which triggered the HTTP error when we were uploading PNG files. It was working fine with JPEG files, but PNGs are better in some cases, so we really wanted to fix the issue, which we did, with the help of the developer.
9 (Update). Backup your site and then switch to a WordPress default theme (e.g. Twenty Seventeen). If the problem is solved, then it’s a theme issue or a hosting related issue (see below why).
First, contact the theme developers to have a look. If they can’t seem to fix it, contact the hosting company.
Scenario – this happened to us recently. I received the HTTP error and nothing worked until I switched themes and the problem was solved. So it had something to do with the theme or the theme combined with something else.
I contacted the theme developers and they managed to partially fix the issue by installing a thumbnail regeneration plugin, but when I deactivated the plugin, the problem reappeared.
Since I don’t like having unnecessary plugins installed, especially for something that should work fine from the start, I didn’t let it go.
After checking things out with Chrome’s Developer Tools, I’ve spotted a server error, so I contacted the hosting company which changed the PHP version to 7, and that fixed the problem!
10 (Update). This was pointed out by Ellen in the comments section.
Check your file path, especially if you migrated your site.
Got to Settings -> Media and check the path at Store uploads in this folder under Uploading Files. It should be something like /home/username/public_html/wp-content/uploads
.
11 (Update). This was pointed out by Vivek Kumar and Niche Apex in the comments. Thanks!
Switch to another browser, especially if you are using Chrome, which seems to trigger the HTTP error.
12 (Update). This was pointed out by BekBek in the comments. Thanks!
This fix already worked for some, and it might work for many others.
Try uploading the images only via Media -> Add New -> then Select files.
13 (Update). This was pointed out by pjmarket in the comments. Thanks!
If your image file name is in another language (e.g. Farsi, Mandarin, and so on), rename it and use English.
Even though WordPress allows you to upload file names using different languages, sometimes, it might cause an error.
If none of the above solutions work, then you should definitely contact your hosting support. If you have a good hosting company, I’m sure they will help you out and solve the issue for you.
Conclusion
It can be very annoying and frustrating getting that HTTP error when uploading images to WordPress, but I’m pretty sure that one of the above solutions will work for you.
Usually, the problem is the image itself, so start with the easy solutions first, like decreasing it to web-size or changing its extension.
Hope the post helped you out! Don’t forget to share!
You can also follow us on Twitter and subscribe to our YouTube channel.
If you want to start your own WordPress blog, or need a website for your business, our WordPress installation service is at your disposal!
I had no idea that apostrophes would screw things up! Now I now why I was having issues.
No such issues from now on :D
Thanks for this amazing stuff , it helps me a lot in understanding about http error but now shifted to https
We’re glad you liked our post! Thank you!
This is the frustrating thing about WordPress blogs, theme developers, and plugin sites. The host is not the issue, your post here indicates nothing in the areas to review and troubleshoot that is a server side configuration yet you say:
\”Hello! Yeah, you won’t get much help from GoDaddy, we noticed that. It could be some sort of problem on their end, if everything else doesn’t work.\”
Shared hosting providers cannot be expected to be experts on a constantly evolving open source platform, especially considering the sheer number of content management systems that exist. This is the equivalent of buying a Honda, adding 20 custom parts to it, then taking it to a Ford dealership to troubleshoot the check engine light. Ford sells cars, your own a car, they should be an expert on your car right? No. If it doesn’t work on the default WordPress theme, with no plugins enabled, contact your hosting company. To suggest otherwise is lazy and irresponsible development.
Hello!
Well, if a hosting company says it supports WordPress and has the proper infrastructure for it, but they end up having some sort of issue that doesn’t allow you to upload your images, then they should fix it.
There were plenty of times when the issue was fixed by the hosting company, because there was something wrong on their end, which is not necessarily to blame, because bad things can always happen.
If something’s wrong on the server’s side, then you can’t do anything, except contacting them to solve the issue, since you don’t have access to their servers, and even if you did, you might not know how to fix the issue.
Hi. Thank you for sharing this. I have tested all the methods above, however, it does not work on my end so I look for other ones.
I am able to fix the http error in uploading images to WordPress by installing a theme called Default to GD downloadable on GitHub.
another solution worked for me .. upload the picture you want to facebook and download it back .. now upload it in wordpress .. tdaaa uploaded !!
Wow, that’s a really strange fix :). Never would have thought of that. Maybe it was a coincidence? Anyway, we’re glad it works!
Hey…. You can easily solve the problem by Going to Media , – Add New and Use the Select Files. and select the image and upload manually….
That should solve the issue if you are not having any problem with your host configuration.
So before tweaking any file or settings, You can try that….
Hello! Thanks for pointing this out. It could work for some.
Hey BekBek,
That worked like charm. This is no doubt the quickest fix (as long as you are not having issues on your host end) without installing a plugin or tweaking files on your on your site.
Thanks BekBek
Oh my gosh this one worked for me — after trawling through troubleshooting sites for hours and trying just about everything, this was the one that did it! Thank you!
Re-Export with gimp solved this problem after i tried some fixing with editing the php.ini. I got some resized JPEG files to upload on our website from a mac user.
Maybe theres some kind incompatible converting software in OSX or third party programs?
Hmmm, don’t really think that some sort of incompatibility issue could cause this.
I changed my PHP from 5.6 to 7.0 and it works.
Thanks for info
That’s great!
informative article. Thank You.
Glad you liked it!
This is a known issue in WordPress 4.5, but has to do with Imagick. Here’s the official thread for 4.5. https://wordpress.org/support/topic/read-this-first-wordpress-45-master-list. Here’s what fixed my issue: https://core.trac.wordpress.org/ticket/36534#comment:7 and here’s WordPress’s official patch. https://core.trac.wordpress.org/attachment/ticket/36534/36534.diff
Hello! Yeah, some WordPress updates can bring different problems. Thanks for sharing the links!
Hi Folks,
I have been having this issue too for all my WordPress sites. Based on the discussion and troubleshooting with my hosting provider i have the steps they took to sort out this issue.
Correcting the HTTP Upload Error
Log into your cPanel dashboard.
Using the file manager, navigate to your WordPress site’s root directory.
Locate and open the .htaccess file for editing.
Add the following line of code at the top of the file:
SetEnv MAGICK_THREAD_LIMIT 1
Save the changes to the .htaccess file.
Hello! Thank you for sharing this with us!
That is working now by deactivating shareholic images sharing and seo images freindly plugins. Thanks themeskills
Thanks for the tip!
Hello, and then if we still have the error ? What else can I try ? Thank you.
Hello! Contact your hosting support and have them check it out on their end too. A lot of issues are caused by servers.
After switching to different server getting HTTP error. Images are uploading but automatic default wordpress thumbnail generation not working. Any idea to fix this. Above methods not working.
Hello! If this happened after you switched servers, and nothing in the list seems to fix it, then it’s probably server related, and you should contact the hosting support.
I want to find you and give you a hug!! Number 5 solved my problems after months of http error and wasted time. And a lot of curse words. Thanks so much!!!
Tried all above tips and suggestions but still searching for solution :(
Hello! Sorry to hear that. Even tried contacting your hosting provider?
define(‘WP_MEMORY_LIMIT’, ’64M’) was a solution for my site :) Tx
Glad it worked! :D
Thanks that helps.
Awesome!
I have made changes in the permission of httpdocs for “Application pool group” to “write” and it works, thanks.
I had same problem but this wode woks for me:
Satisfy Any
Order allow,deny
Allow from all
Deny from none
Thanks