How to fix HTTP error while uploading images in WordPress

How to fix HTTP error while uploading images in WordPress

In WordPress, an HTTP error is a signal that something went wrong during a file upload. Typically, a WordPress HTTP error occurs when you try to add an image and other file types to your media library. This guide reveals 9 proven solutions for this problem. Let’s start!

9 Easy Ways to Resolve the HTTP Error in WordPress

Example of http error when loading media files
Let’s take a look at the possible solutions to the HTTP error while uploading images in WordPress. “These solutions will also work when uploading videos, PDFs, or any other file type that WordPress supports.

Solution 1: Confirm HTTP error

Sometimes, temporary difficulties on the server can lead to an HTTP error in WordPress. Before you try any of the other solutions in this article, check again to see if this error is present.
Start by waiting a few minutes and uploading the media file again. If the second attempt is unsuccessful, it may mean that a temporary problem occurred during the error.
Additionally, check the filename for characters such as apostrophes, semicolons, commas, and others. Many users confirm that the error was resolved after removing the apostrophes from the file name.
If the problem persists, read on.

Solution 2: Change browser

Maybe the WordPress HTTP error is not site related and could be the result of something less expected – your browser.
Often HTTP error messages appeared while using Google Chrome. While this is a great browser, switching to another allows you to confirm if the issue is browser related.
If the problem persists, move on to the other steps below.

Solution 3: Disable plugins

Disabling plugins in WordPress
If the HTTP error appears after installing the WordPress plugin, the best solution is to deactivate it. To make it a bit easier to identify a plugin, it is known that image optimization plugins often cause this problem. Thus, if you have an image optimization plugin, temporarily disable it and try uploading the image again.
If the HTTP error disappears, try looking for another image optimization plugin instead of this one. Alternatively, you can try to contact the plugin developers for further troubleshooting.
However, if the error persists even after disabling all plugins, go to the more detailed solution below.

Solution 4: Increase WordPress Memory Limit

Hostinger file manager and selected wp-config.php file
A common cause of HTTP error in WordPress is out of memory. It can also lead to many other issues like 503 service unavailable error. You can fix the reason for the lack of memory in the wp-config.php file by adding the line:
define (‘WP_MEMORY_LIMIT’, ‘256M’);
The above code increases your PHP memory limits to 256MB. Before adding it, check the maximum available memory limit on your server in the PHP info.

Solution 5: Make GD Library your default image editor

Did you know there are two image editors available in WordPress? That’s right, WordPress uses either Imagick or GD Library for image processing. Even though they are both good, Imagick is known for using up all available memory and throwing an HTTP error following that.

Solution 6: Editing .htaccess

Htaccess file in Hostinger file manager
Htaccess file is located at the root of your WordPress directory and serves as a guard against various things. It controls requests and a number of other functions.

Solution 7: Check your theme

WordPress theme management page
If the error occurred after installing or updating a WordPress theme, then this is most likely the culprit. The correct approach is to create a backup (backup) of the entire site and then switch to the default theme (for example, Twenty Seventeen).
If everything works well with the default theme, try contacting the developers of the current theme. In this case, the HTTP error could be caused by a theme issue or an incompatibility between theme and plugin.

Solution 8: Check PHP version

Since version 3.2, WordPress requires PHP version 5.2.4 or higher to work reliably. All versions below can cause an HTTP error. Some hosting providers use older versions of PHP, which means you cannot upload images to your WordPress media library.
What to do? Check your hosting settings first to make sure they are using PHP version 5.2.4 and above. Plus, you can join millions of other website owners on Hostinger offering the latest stable version of PHP as soon as it’s released.

Solution 9: clear your cache

Clearing the cache in the Chrome browser
Still not getting rid of the WordPress HTTP error after checking all of the above solutions?

Leave a Reply

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