How To Fix WordPress HTTP Error When Uploading Images

Last updated on September 9th, at 07:13 pm

Have you been getting an HTTP error while uploading media in WordPress? This error usually occurs when you are uploading an image or other files to the WordPress media library using the built-in media uploader.

In this article, we will show you 6 proven solutions on how to easily fix the HTTP error when uploading images in WordPress. Any one of the following methods may work in your case so you can get back to uploading your media.

Like any other platform, there are always those annoying errors and problems you have to learn how to work through and WordPress is no exception.

In WordPress, an HTTP error is a code that tells you, that something went wrong during a file upload process. These are common WordPress errors.

See also What are Soft 404 errors and how to fix them.

Unlike browser errors where we get an HTTP status code, WordPress errors are sometimes a little harder to troubleshoot.

Because the very vague “HTTP error” definitely doesn’t help us determine what might be wrong or even where to start looking.

Because the reason for WordPress could be for anything and WordPress simply doesn’t know why, so it spits out this generic error message. (see the image below).

http Error in wordpress uploading images

 

Check out: How to optimize images to speed up WordPress site

Fix the HTTP error in WordPress while uploading images

Solution 1: Refresh the Webpage.

When you encounter the WordPress HTTP error simply refresh the page in your browser. Sounds too easy? Well, actually this is the most common fix I’ve seen for it.

Here’s why:

For whatever reason it may be, your browser might have lost connection temporarily with WordPress and the process simply failed to complete.

This could be due to your ISP, your wi-fi Router problem, or even a temporary hiccup with your WordPress host, etc. If you refresh the page and try uploading again, the error sometimes will resolve itself. Believe me, it works.

Additionally, try to clean up the image file name, i.e., eliminate characters such as apostrophes and semi-colons among others. Many times the error resolves after removing apostrophes from the filename.

If the problem persists, read on for more solutions.

See also How To Measure Your Website Page Load Time Correctly

Solution 2: Switch Browsers and try

It is possible that the WordPress HTTP error may not be related to the website, net connectivity, and could be the result of something more unexpected – your Web browser.

It has been reported that WordPress HTTP errors popping up is more frequent with Google Chrome. While it is an excellent browser, switch to a different browser like Firefox, Opera, etc. this will let you confirm if the problem is browser-related.

If switching browser works then you know the problem, update your browser.

Does the problem still persist? more troubleshooting steps are presented below.

Solution 3: Deactivate Plugins

Did the WordPress HTTP error appear after installing a plugin? If yes. then deactivate it. Image optimization plugins are known to cause this issue.

If you have an image optimization plugin installed, disable it temporarily and try uploading the image once more.

If the HTTP error disappears, change the plugin, try looking for an alternative image optimization plugin.

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

Solution 4: Increase PHP Memory Limit

A common cause of the HTTP error in WordPress is that your server lacks the available memory for the background upload process to complete successfully.

This is a very common problem with shared WordPress hosting. To fix it you need to increase the amount of memory PHP can use.

256 MB is recommended.

To increase the PHP memory limit, you will need to add a line of code to your wp-config.php file

How to Increase PHP memory limit.

Log on to your cPanel dashboard. And under the root directory of your site search for the wp-config.php file. (see image below)

http Error in wordpress uploading images

Right-click on wp-config.php file from the option choose to edit the file. Add the following code and save the file.

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

increase php memory limit

The above code increases your PHP memory limit to 256MB. By increasing the PHP memory HTTP error while uploading images should be rectified.

Solution 5: Update to the latest version of PHP

WordPress requires PHP version 5.2.4 or higher to run smoothly. Anything short of this will leave you stuck with the HTTP error.

Some hosts still use older versions of PHP, which means no matter what you try, you can’t upload images to the WordPress media library.

Remember your host will not upgrade the PHP version for you automatically, because of incompatibility issues that may arise with the plugins and the theme that you use.

Luckily, checking your WordPress PHP version is easy to do using the free Display PHP Version WordPress plugin.

WordPress officially recommends PHP 7.2 or higher. If you’re not running on that, you’re below the minimum requirements set by the developers of the CMS.

You can upgrade your PHP version from the cPanel of your host. Log on to cPanel.

In your cPanel under software, look for something like Select PHP version or Upgrade PHP version. In the image below I am showing my cPanel, my site is hosted in Hostgator. Don’t worry most host cPanel looks the same.

http Error in wordpress uploading images

After clicking on it you will show the following (see image below) the current PHP version installed on your site and a drop-down menu to select the latest PHP version. As described above WordPress officially recommends PHP 7.2 or higher.

http Error in wordpress uploading images

 

Depending upon your site host, you may get the option to upgrade to 7.3 PHP version. I would suggest initially upgrade to PHP version 7 or 7.1 and then click on the “Set as current” tab.

Check your site, load some pages from your website. Check if everything’s working fine. If your site is not working as it should, you can always revert back to the older PHP version your site was using.

I would suggest you contact your host provider to look into this issue.

Solution 6: Clear your Browser Cache.

I am sure by now the WordPress HTTP error issue is solved. Still, having the issue? Before you leave thinking no solution works for you, try clearing your browser cache. Many a time a simple solution works wonders.

Conclusion:

WordPress even though the best CMS out there, it’s not perfect, WordPress errors are an inevitable part of a webmaster’s life, but fixing them is the real challenge.

As you can see there are quite a few different ways to fix HTTP error in WordPress when uploading images. Hopefully one of the solutions above worked for you and you’re already back on track and uploading your media.

If you continue to receive this error time and time again, it might be a good idea to change to a better WordPress host.