Last Updated On By Khizer Ali
Images are a very important aspect of any website. Same goes for your WordPress website, any site would just seem incomplete and not attractive without images. However, while building your WordPress website, you might’ve faced HTTP image upload error and your image is just not uploading.
These errors are not very descriptive or self-explanatory as to why they are being caused and how to fix them.
That’s why they can be confusing but don’t worry we’ve got you covered.
Below are the six useful ways that you can implement right away and fix the HTTP error when uploading images to WordPress in no time.
Table of Contents
It’s not really clear that why the HTTP image upload error occurs but it’s been criticized that when one tries to upload images, GIF or videos using the built-in media library tools, you can face this error.
This might be due to the image format, size or the memory limit of your WordPress is not enough.
It’s as simple as it can be but it shouldn’t be ignored. Usually, when you lose or you don’t have a stable connection with WordPress you might come across with error.
When you upload an image WordPress automatically adds a number to it if you upload a duplicate image.
So, there is a chance that the up loader is picking up the previous i
mage which might have fault so you need to change the image locally from your computer because WordPress doesn’t let you change the name of the already uploaded media.
Make sure that you don’t have any special characters in your image file’s name, just to be safe!
Sometimes when you have plugins running, they might be the culprit of the error caused.
Try deactivating all the plugins, don’t uninstall them, deactivating them would do the trick. Once, the error is fixed you can activate them again
WordPress uses two modules of PHP that handles images. GD Library and Imagick. Depending upon the setting WordPress uses either one.
Imagick uses resources throttling which means that the resources are cut short to fit more users into the same area. This causes most users to face the issue of a few allocated resources.
You can switch to the GD library to fix this problem.
Go to your WordPress folder and navigate to themes in wp-content and add the following code in the function.php file.
function wpb_image_editor_default_to_gd ($editors) { $gd_editor = ‘WP_Image_Editor_GD’; $editors = array_diff( $editors, array( $gd_editor ) ); array_unshift( $editors, $gd_editor ); return $editors; } add_filter( ‘wp_image_editors’, ‘wpb_image_editor_default_to_gd’ );
This code will switch your image module to GD.
If the problem still persists then you can go ahead and remove this code and continue with the following steps.
One of the most common causes of error is the memory limitation that your PHP can use in your server.
You need to increase the memory, to do that you need to open your file wp-config.php in that file you need to add the following code,
define( 'WP_MEMORY_LIMIT', '256M' );
256 MB is recommended but you can change it according to what is suited.
WordPress uses and recommends PHP 7.3 or higher. Its always recommended using the higher version as it would be better in terms of, having more features, performance, and security.
Update your PHP version and try re-uploading your media files.
As you can see through this article, it’s not clear at first why the error occurred.
That’s why we have to go through the number of possibilities to reach out to the solution.
WordPress’s HTTP image upload error is sometimes tricky to handle as the origin of its cause is not known. I hope that you were able to fix the error through one of the possible solutions given in this article.
We’d love to hear from you, kindly drop a comment below and tell us that were you able to fix the HTTP image upload error in your WordPress and which solution worked for you?