HTTP Error when Uploading Images to WordPress (11+ solutions)

HTTP Error when Uploading Images to WordPress (11+ solutions)

 

You’re on this page because it occurred to you: HTTP error displays when you’re trying to upload an image to WordPress.

OK, we’ll walk you through 11 potential solutions to your problem, so you can fix it quickly and pass on to your next customization step.

 

Handy solutions:

 

Case 1: Try uploading the image again

It might be a temporary error, due to unusual traffic and low server resource at a given time. These are rapidly fixed in WordPress, so first you should retry uploading the image to your website.

In case this won’t do, move on to the next check.

 

Case 2: Try uploading a different image

It might be a problem with the image itself. To find out, select and upload a different image to your WordPress. If it works with the new image, come back to the one you intended to initially upload, and make some changes to it: change its size, making it smaller, for instance.

 

Case 3: Try changing the image format

If the problem persists, you might need to pay attention to the image file format. Change it from .jpeg to .png, for instance, and try uploading it again. Due to the file format conversion, the error should be fixed, and the image uploaded.

 

 

 

 

Case 4: Check the image file name to be clean, no special characters included

A frequent cause of errors when trying to upload image files to WordPress is the presence of special characters in the very file name. Remove comas, asterisks, etc, and give the file a clearer name. Then try uploading the image again.

Example:

background’.jpeg -> background.jpeg

 

Case 5: Check on different browsers

Sometimes, the error might not be caused by WordPress technical problems, but by browsers.

Chrome is reportedly one of the browsers where most encounter this issue with HTTP error display when trying to upload images to WordPress. Before going into more details checks for the issue, try switching to a different browser (e.g. Mozilla).

 

Case 6: Increase memory limit for WordPress to use

If your image won’t upload, you might want to increase memory limit available for WordPress to use. You need to increase the amount of memory PHP can use on your server.

For this doing, identify your wp-config.php file where you installed WordPress and make some changes to it:

 

 

Right-click on the wp-config file to open it. It will look like this:

 

 

Add the following line to this file:

 

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

 

After having added this line, the code will look like this:

 

 

256M is a maximal limit for memory PHP can use on your server, for your WordPress.

Retry uploading your image.

It should work. If it doesn’t work, keep trying using one of the following solutions.

 

Case 7: Deactivate plugins

The issue might have appeared after you have installed and activated a new plugin. Also, image optimization plugins are reported to pose such problems quite frequently. Go to the plugin you suspect from preventing normal uploading of your image and deactivate it. Then, try again to upload that image.

If it works, it means the disabled plugin was the cause of your HTTP error displaying when you were uploading your image. Try to replace that plugin with another one, with similar functions, that allows you to properly upload images to WordPress.

 

Case 8: Check your theme

If you’ve recently installed and activated a new theme for your website, it might be the cause of errors when you try to upload images into WordPress.

Create a backup of your website, then switch to a default theme. After that, try to upload the image again and see if it works.

HTTP error displayed when trying to upload images to WordPress might be caused by a theme incompatibility with your image editor.

 

If that’s the case, contact the theme support and single them the problem.

 

Case 9: Check PHP version

Check the PHP version that’s in use for your WordPress.

As a rule, the PHP version should be 5.2.4 or above. Otherwise, it might cause issues such as errors when trying to upload images to the website. Check with your host to see if they use PHP version 5.2.4 or above.

 

Case 10: Change Image Editor Library of WordPress

For images, WordPress has 2 different modules or image editor libraries.

One is GD Library and the other is Imagick. WordPress uses them interchangeably, depending on which one is available. However, Imagick is known as often causing HTTP errors when uploading images to WordPress.

The solution in this case is to make the GD Library the default image editor.

For this doing, you need to find the functions.php file in your WordPress editor, and add some lines of code.

Here’s how the functions.php file looks like:

 

 

Add the following lines of code, to make GD Library the default image editor in your WordPress:

 

function wpb_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’, ‘wpb_image_editor_default_to_gd’ );

 

 

Save the file.

Now try to upload your image again.

 

Case 11: Clear cache

Last, but not least, take into account your issue might have already been solved. However, you’re not viewing the correct version due to cached versions stored in your browser, and the problem seems to persist.

 

Here’s how to do this in Chrome:

 

After having cleared cached images and files, you might see your image has successfully been uploaded to your WordPress.

 

Case 12: Contact your hosting provider

In case none of the above solutions work, we recommend you contact your hosting provider for help. There might be issues on their end, so the support team might help you fix the HTTP error you encounter when uploading images to WordPress.

 

 

We hope you find your solution to the HTTP error you encounter when trying to upload images to WordPress. Therefore, we encourage you to use this article as a guide, fix the embarrassing errors and go to the next step in customizing your website or blog.

 

Leave a Reply

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