Type to search

Learn How to Fix WordPress HTTP Error [Quick Guidance]

Is the HTTP error when uploading images to WordPress bothering you? The built-in media uploader plays a role in causing this HTTP error. When you try to upload any images or files to WordPress using it, the result can be this error.

Possible Reasons Behind the WordPress HTTP Error When Uploading Images

There are several factors that could cause an HTTP error when you are making an attempt for uploading files through the help of WordPress media uploader. Moreover, WordPress is not able to find out the real reason, so it displays the message ‘Http error’. 

It is more frustrating as the error doesn’t give you any hint regarding its causes. This implies that you need to try out various solutions in order to detect the causes and fix the same.

Let us have a look at how to troubleshoot and solve the error at the time of uploading media in WordPress. 

Hack 1: Ensure Whether the HTTP Error is Permanent

For doing this, follow the steps below:

  1. At first, wait for some time and then upload your JPEG file again. Sometimes, this error arises due to low server resources and unusual traffic. This is fixed automatically on the hosting servers of WordPress.
  2. In case, this does not solve the problem then you might try uploading a different image. If the latter file is successfully uploaded then try saving your original file to reduced size and try uploading again. 
  3. At last, you can try to save the file in more than one format, viz. change the jpeg to png with the help of a software for editing image. After doing that, try uploading the file once again.

If the steps above do not fix the HTTP error, then for sure the error is not due to a temporary issue and seeks your immediate attention.

Hack 2: Enhance the Capacity of WordPress Memory 

Alack of enough memory in WordPress often is the cause of this error. In order to solve this, you require to increase the memory PHP on your server. Applying the code wp-config.php file can add memory to WordPress by 256MB. 

Hack 3: Use another Browser

It may also happen that the website has got nothing to do with this error, and it is caused because of the browser. There are many reports of popping-up of HTTP error on Google Chrome. 

Undoubtedly, it is an awesome browser, but shifting to another one will allow you to confirm easily whether the error is browser-oriented. In case the error prevails, more steps of troubleshooting are discussed below.

Hack 4: Disable Plugins

The WordPress HTTP error sometimes appears on the installation of a plugin, more specifically image optimization plugins. So, you can try disabling it temporarily and retry uploading the image and check.

If the error disappears, you might look for an alternative plugin for image optimizer. Else, you can try to contact the plugin developers for solving the error.  

Hack 5: Set GD Library as your Default Image Editor  

Have you had any idea of WordPress having 2 image editors? Yes, you read it right. WordPress makes use of either the GD library or Imagick for processing images. Both of them are great but Imagick is known for exhausting the existing memory and creating the HTTP error. 

For fixing this, set the GD library as your default editor by dropping the following code to 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’ );

After applying this, do save the changes and try reuploading the image. 

Hack 6: Theme Check

If the error pops up after installation or update of a WordPress theme, then it is probably the culprit. A correct approach is to generate a backup of your whole website and shift to a default theme. 

If everything functions normally, try to contact your present theme developer or provider with the details. In such a scenario, the WordPress error could be a sole issue or a lack of compatibility between a plugin and a theme.  

Hack 7: ModSecurity

If your server is having mod_security, it may cause problems. Disable it to check if the problem continues. In order to do this, create a .htaccess file in your directory of wp-admin and attach the below code to it:

<IfModule mod_security.c> 

SecFilterEngine Off 

SecFilterScanPOST Off 

</IfModule>

This will disable mod_security for the uploaded file obtaining code in the wp-admin. Also, remove this in case it is creating any error on your server.

Hack 8: Delete your Caches

If you are still facing the error after applying all of the above hacks, try to clear your browser cache and check. Sometimes, it happens you have fixed the error but the error you are viewing is from the local cache.

Leave a Comment

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