HTTP error while uploading to WordPress

Let’s understand what it is,

WordPress has an in-built media library tool that creates it easy to access all of your videos and pictures. This library has specific settings and rules. 

When your image or video doesn’t meet these specifications, you’ll see the WordPress Upload HTTP error. 

It seems simple enough, but unfortunately, the WordPress HTTP errors are often vague, and it’s hard to pinpoint what the matter is. 

We’ve analyzed over 240,000 WordPress sites, and we’ve seen this error crop up very often. Over the years, we’ve been ready to distill the foremost common causes and solutions, and therefore the not-so-common ones that employ sometimes! 

What Causes HTTP Error during Upload in WordPress?

A variety of things would cause an HTTP error once you try to upload files using the WordPress media uploader. WordPress cannot work out the cause, and that’s why it displays the generic ‘HTTP error’ message.

HTTP Error

The frustrating part is that this error message doesn’t offer you any clue what may have caused it. This suggests that you will need to try different solutions to seek out the cause and fix the error.

That being said, let’s take a glance at the way to troubleshoot and fix the HTTP error during media upload in WordPress.

Make Sure The HTTP Error isn’t Temporary.

First, you ought to wait a couple of minutes, then try uploading your image file again. This error is usually caused by unusual traffic and low server resources, which are automatically fixed on most WordPress hosting servers.

If that doesn’t work, then you’ll want to undertake to upload a particular image file. If the opposite file uploads successfully, try saving your original image file to a smaller size and retry uploading.

Lastly, you’ll want to undertake to save the file to a particular format. For instance, change jpeg to png using picture editing software. Then, retry uploading the file.

If these steps end in the HTTP error, this suggests that the error isn’t caused by a short-lived glitch and needs immediate attention.

Here are nine tactics that you can use to repair the WordPress HTTP image upload error:

● Confirm the HTTP Error

● Switch Browsers

● Deactivate Plugins

● Increase WordPress Memory Limit

● Make GD Library Your Default Image Editor

● Editing .htaccess

● Check Your Theme

● Check Your PHP Version

● Clear Your Caches

Solution 1: Confirm the HTTP Error

At times, a short-lived glitch within the server may cause a WordPress HTTP error. Before you try any of the solutions during this post, you should ensure that the error always persists.

Begin by waiting a couple of minutes and uploading the media file once more. If the second attempt is successful, it could mean that a short-lived problem occurred at the error time.

Additionally, pack up the image file name, i.e., eliminate characters like apostrophes and semicolons, among others. A fair number of users reported the error as resolved after removing apostrophes from the filename.

However, if the matter persists, read on for more solutions.

Solution 2: Switch Browsers

It is possible that the WordPress HTTP error is unrelated to the website and will result from something more unexpected – your browser.

There are reports of HTTP error shooting up while using Google Chrome. While it’s a superb browser, switching to a special one will allow you to confirm if the matter is browser-related.

In case the matter persists, more troubleshooting steps are presented below.

Solution 3: Deactivate Plugins

Deactivating plugins to troubleshoot WordPress HTTP error

Sometimes plugins could also be the culprit, especially ones associated with image optimization. Deactivate them and check out uploading your image again.

If the WordPress HTTP error appeared after installing a plugin, your best chance is to deactivate it. To save lots of you some trouble, image optimization plugins are known to cause this issue. As such, if you’ve got a picture optimization plugin, disable it temporarily and check out uploading the image another time.

If the HTTP error disappears, you’ll try to find an alternate image optimizer plugin. Alternatively, you’ll attempt to get in-tuned with the plugin developers to troubleshoot the error further.

However, if the error persists even after disabling all plugins, advance to more solutions presented below.

Solution 4: Increase WordPress Memory Limit

wp-config.php in Hostinger file manager

A common explanation for the HTTP error in WordPress may be a lack of memory. It also can end in many other issues like the 503 services unavailable error. Fixing low memory may be a matter of adding the subsequent line to your wp-config.php file:

define (‘WP_MEMORY_LIMIT’, ‘256M’);

The above code increases your PHP memory limit to 256MB. Before adding it, you should also confirm the utmost available memory limit on your server by checking PHP info.

Solution 5: Make GD Library Your Default Image Editor

Speaking of magic, did you recognize WordPress ships with two image editors? That’s right, WordPress uses either Imagick or the GD Library to process images. While they’re both great, Imagick is notorious for exhausting the available memory and causing the HTTP error.

To circumvent this problem, you would like to make GD Library your default editor. How? Just drop this code to your theme’s functions.php file:

function hs_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’, ‘hs_image_editor_default_to_gd’ );

Save your changes and check out to upload the image again. If the HTTP error persists, revert the code change and check out subsequent solutions.

Solution 6: Editing .htaccess

.htaccess enter hosting file manager .htaccess file lives in your WordPress root folder and acts as a gatekeeper for all kinds of things. It controls where requests go, among many other functions.

To fix the HTTP error in WordPress, open .htaccess and add the following code:

SetEnv MAGICK_THREAD_LIMIT 1

Once done, plan to add your file again to ascertain if the difficulty was fixed. If it didn’t work, there are a couple of more code snippets that you can test.

Try implementing them individually, save the changes and upload your media file once more.

Solution 7: Check Your Theme

WordPress themes in the admin dashboard

If the error showed up after installing or updating a WordPress theme, it is presumably the culprit. An honest approach is to make a backup of your entire website and switch to a default theme (e.g., Twenty Seventeen).

Another solution is to copy your website and temporarily switch to a default theme, like Twenty-Twenty. If your image uploads correctly, it means the matter lies in your current theme.

If all works well with a default theme, try contacting your current theme provider or developer with the small print. In such a case, the HTTP error might be an isolated theme issue or an incompatibility between the theme and a plugin.

Solution 8: Check Your PHP Version

Finally, check if you’re using the foremost recent PHP version. You’ll check which version of PHP your site uses by installing the free Display PHP Version plugin. It’ll add a replacement dashboard widget that shows your current PHP version.

Since version 3.2, WordPress requires PHP version 5.2.4 or higher to run smoothly. Anything in need of this may leave you cursed with the HTTP error. Some hosts use older versions of PHP, which suggests that you can’t upload images to the WordPress media library regardless of what you are trying.

What to do? First, ask your host to make sure they’re using PHP version 5.2.4 and above. Alternatively, you’ll join many other website owners at Hostinger, which offers the newest stable PHP version upon release.

Solution 9: Clear Your Caches

Fixing WordPress HTTP Error by clearing browser cache

Do you still face the WordPress HTTP error after trying all the above solutions? Perhaps you solved the error a short time ago, but the “error” you see comes from the local cache. Before you allow thinking no solution works for you, try clearing your browser cache.

We strongly advise you to be prepared by taking these two steps:

  1. Backup your WordPress site 

Using our BlogVault plugin, you’ll take a backup of your site in under a couple of minutes. 

Once you put in the plugin, you only have to enter your admin email address, and therefore the plugin takes care of everything else.

blog vault start 

Now that you have a backup, if anything goes wrong, you’ll restore your website quickly with only one click.

2.Use a staging site

A staging site may be just like your WordPress site. You’ll make changes here that won’t affect your live site, so it’s perfect for troubleshooting errors to find the proper solution. 

Use the BlogVault plugin to make a staging site in one click. On the BlogVault dashboard, you’ll see a choice to Add Staging Site.

The plugin will automatically find a password-protected staging site so that it’s hidden from visitors and search engines. 

Blog vault staging site credentials

You can use these credentials to access the staging site. To log in, add /wp-admin to the top of your staging URL. Your wp-admin credentials are equivalent to those for your live WordPress site. 

If you create content regularly, you’ll probably encounter the HTTP image upload error eventually (or other HTTP error codes and standing codes). Don’t worry; it’s usually easy to resolve. 

Leave a Comment

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