I believe many people have encountered this HTTP error when uploading images to WordPress. If you have run into this pesky error, keep reading for our 7-step easy fix guide.
The last time this happened to me was several days ago; I wanted to share with you several solutions that may help you solve this problem.
This error appears after the image is “struggling” to upload for an extended time period. Sometimes, the image is uploaded even if the error appears.
Most of the time, trying to upload big images (height and width) could trigger the issue.
Here’s the HTTP error when trying to upload an image:
Now let’s get to our solutions:
- Refresh your browser window or switch to another browser, especially if you are using Chrome. I’ve experienced this issue first hand in Chrome. As simple as it sounds, start here.
- Make sure you don’t have special characters (apostrophe, semi-colon, or equals sign) in the image file’s name (e.g. image‘s-file-name.png or image‘s-file-name.jpeg), that will trigger the error as well.
- Optimize the images by decreasing the size. For example, edit a 2000 x 1500 image to 700 x 450 to fit your content area of 700px wide.
- If you are using a Mac, you can use the Preview App to reduce the size of your image.
- For a PC you can use the Paint Application.
- You can also use Photoshop if you have it to resize images.
- Reduce image size by trial and error until you are able to upload it without any error.
- If the problem appears after installing any type of plugin, deactivate it and try it again. Especially, if you’re using an image optimizer plugin (WP Smush or EWWW Image Optimizer), deactivate it and see if that solves the issue. If the plugin was the cause, try different configuration settings. I’ve experienced such an issue with the EWWW Image Optimizer plugin, which triggered the HTTP error uploading PNG files. It was working fine with JPEG files, not with PNG files. I contact the plugin developer, who updated the plugin, which resolved the issue.
- 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. First, contact the theme developers to have a look. If they can’t seem to fix it, contact the hosting company.
- Check with your hosting company to make sure that they are using the most recent version of PHP (should be version 7), and they haven’t limited anything regarding uploads.
- Increase Memory
You can add the following in your wp-config.php. This will only work if your hosting package has that amount of memory. Increase gradually until you are able to upload an image size, which is acceptable by you.
You can also try increasing your memory by adding the following in your .htaccess file. This will only work if your hosting package has that amount of memory. Increase gradually until you are able to upload an image size, which is acceptable by you. Note: Some web hosting does not allow this and you will have a 500 internal server error. In this case you will have to remove this code.
If you have access to your web server’s php.ini file, you can find the memory limit and increase it’s size. This will only work if your hosting package has that amount of memory. Increase gradually until you are able to upload an image size, which is acceptable by you.
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. The codes can differ from server to server, so it’s best to contact your hosting support and ask them if you can add one of the codes, or ask them to do it for you. Hosting support is there to assist you, don’t be bashful to reach out and use them as a resource.
It can be very annoying and frustrating to receive that HTTP error when uploading images to WordPress; however, I’m hoping 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 refreshing your browser window, changing browsers, decreasing the image to web-size.