Are you also facing HTTP Error while uploading an image? If your answer is Yes, then you landed in the right place. There could be multiple reasons why you are getting this error. Since the error message itself does not tell much, we will have to go through some probable reason and the associated solution.
Table of Contents
Check if the issues are temporary
At times it is possible that the issue is temporary due to various reasons:
- Server glitch
- Server Maintenance
- Session expired
- Any other temporary issue related to WordPress.
To check this just refresh your page. If it is a temporary issue you can now upload the image. If not just wait for some time and try again. If the problem persists, check for other reasons.
Check WordPress Memory Limit
The next step is to check for WordPress Memory Limit. The cause of HTTP Error could be lack of memory available for WordPress to use. It is better to have a memory limit of at least 256 MB.
There are multiple ways to check WordPress Memory Limit.
If you see the memory size is less than 256 MB, you need to increase the size of memory PHP can use on your server.
To increase the size of memory, add the following code to your wp-config.php file.
define('WP_MEMORY_LIMIT', '256M' );
This code increases the WordPress memory limit to 256MB, which would be enough to fix any memory limit issues. Note: Before increase the memory limit to 256 MB it is advisable to check the maximum allowed memory limit with hosting company and adjust the size accordingly.
Check the Name of Image
Check the image name you are uploading, if it is too long or contains special characters it may cause the issue, to resolve this issue, rename the image with a shorter name and without any special character.
Check size of the image
Check the size of the image you are uploading, if the image size is too huge like 3000 px – 2000 px, the server may throw an error in processing these huge files. Consider resizing and optimizing these images. If you don’t have the right tool you can resize and optimize your image online. Just search for resize images online or compress images online.
Try disabling image Optimization Plugin
Though image optimization plugins are good and we should be using it, but some times due to some issues they start throwing error, just try to disable the plugin and then upload the image, if the upload is successful the issue was with the plugin, if not then the issue is something else, you can enable the Image Optimization Plugin.
Hope by following the methods above you are now able to resolve the issue. if none of the methods works for you, I suggest you, to get in touch with your hosting provider.