How to Fix the HTTP Image Upload Error in WordPress

How to Fix the HTTP Image Upload Error in WordPress

How to Fix the HTTP Image Upload Error in WordPress

In Nutshell, HTTP Error in WordPress is a message that something went wrong while trying to upload the file to the media library.  In this article, we will show you how to fix the HTTP error in WordPress during uploading the image.

How to Fix the WordPress HTTP Error?

There are several issues that can cause the HTTP image upload error in WordPress. The most irritating part is that you have to try a different method to find the HTTP error issues. Let’s try each of the methods and fix the HTTP image upload error in WordPress step by step:-

Ensure the HTTP Error

When the error is caused by the temporary glitch in the server, this is the common cause of getting the HTTP Error in WordPress.

wordpress-http-error

The most simple and easy method to fix the HTTP image upload error in WordPress is refreshing the page browser and upload the image once again. Sometimes this method also works when there occur temporary problem during the process or the unusual traffic.

Secondly, If there is different file format then there are chances of causing the HTTP Error. So, change the image extension from jpeg to png and upload it.

Although, these are the first step to fix. If it doesn’t work then let’s continue with the different methods.

Increase WordPress Memory Limit

Yet another common cause of the HTTP error is insufficient memory storage for WordPress. To increase the WordPress memory space, add the following line to your wp-config.php file.

1
define( 'WP_MEMORY_LIMIT', '256M' );

This code will increases the amount of PHP memory limit to 256MB, which is plenty to fix the memory limit problem.

Deactivate Plugins and Themes Temporarily

It is possible that sometimes the plugins and themes cause the HTTP error in WordPress. Mostly the image optimization plugins provoke this issue. So, temporarily deactivate the plugins and switch the WordPress theme to default. Now, once again try to upload the image if it successful then look for another image optimizer plugins that will not occur the error.

If it also doesn’t work, then move on to the next solution to fix the HTTP Image upload Error in WordPress.

Make Default Image Editor Library

WordPress uses the two modules to process images: Imagick and the GD Library. Though, Imagick is well known for draining the memory and cause HTTP error often.

To fix this issues, you should change the GD Library the default image editor by adding the code to your theme’s functions.php file.

1
2
3
4
5
6
7
function cv_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', 'cv_image_editor_default_to_gd' );

Now, save it and retry to upload the file using media uploader. If this method also doesn’t work then look forward to the next solution.

Implement The .htaccess Method

WordPress uses the .htaccess file that lives in the WordPress root directory.

To fix this issues, open  .htaccess and add the following code:-

1
SetEnv MAGICK_THREAD_LIMIT 1

After adding this code, try to upload image again.

To wrap it all up, We hope this article help you to fix the HTTP image upload error in WordPress. If you find our article don’t forgot to follow us on Twitter and Facebook for more helpful WordPress tips.

You may also want to learn:

2 thoughts on “How to Fix the HTTP Image Upload Error in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Easter Sale 2021 !! Use Coupon code cveaster21 to get 25% OFF on any of our Premium Themes & Plugins