WordPress shows HTTP Error when uploading images

While working on my blog today WordPress shows HTTP error when uploading images, I was confused and helpless. I tried to upload the image again & again, but the error won’t go. After 5-6 attempts I was able to again upload the images successfully. But my success was short lived as after a few minutes the same error comes knocking at my door.

Fix for WordPress shows HTTP Error when uploading images

Image Size

This first and obvious thing to check for is that your image dimensions don’t exceed your fixed width content area. For example, let’s say you want to post 3000X1500 image but the post content area (set by your theme) is only 1000px then you will definitely see this error.

Note: On the other hand always try to limit your image dimensions to 2000X2000.

read here .

Increase your PHP memory

Sometimes increasing the PHP memory allowed to WordPress seems to rectify this issue. Well, you can never be sure until you try, add this code define(‘WP_MEMORY_LIMIT’, ’64M’) into your wp-config.php file.

Editing wp-config.php file .

To add the above code, just head over to your cPanel and go to the root directory of your WordPress installation where you will find the wp-config.php file.

If the above doesn’t work for you then there is a good chance that your web hosting provider doesn’t allow you to increase PHP memory limit. In that case talking directly to them can help you in changing the PHP memory limit.

Adding a code to .htaccess file

how to configure this plugin here ). In .htaccess file just add this line of code:

After adding the code just click “Save changed to .htaccess” and check if the issue is resolved .

Changing theme functions.php file

Actually, we are just going to tell WordPress to use GD as the default WP_Image_Editor class using theme functions.php file. As of WordPress latest update GD has been abstracted and Imagick is used as a default image editor, so going back to the old one seems to fix the issue for everyone.

go here.  But if you want to manually edit the file then continue below.

To edit the theme functions.php file just navigate to Appearance > Editor and select Theme Functions (function.php). Once you are there just add this code at the end of the file:

Note: Make sure you add this code within the ending PHP sign ( ?>)

This is the most important fix in the guide WordPress shows HTTP error when uploading images but if your issue is still not fixed, continue forward.

Disabling Mod_Security

Note: This method is not advised as it can compromise the security of your WordPress and hosting. Only use this method if you have tried everything else and if disabling this works for you then contact your hosting provider and ask for support.

Again go to your file editor via  Yoast SEO > Tools > File Editor and add the following code to your .htaccess file:

And click “Save changed to .htaccess.”

Reinstalling the latest version of WordPress

Sometimes this issue can occur because of corrupt WordPress file and any of the above solutions may not work at all, in that case, you have to reinstall the latest version of WordPress:

  • Backup your Plugin folder from cPanel (Download them) and then disable them from WordPress. After that remove all of the plugins folders from your server using cPanel.
  • Install the standard theme e.g. Twenty sixteen and then remove all other themes.
  • From Dashboard > Updates reinstall the latest version of WordPress.
  • Upload and activate all the plugins (except the image optimization plugins).
  • Install any theme you want.
  • Try using the image uploader now.

This will fix WordPress shows HTTP error when uploading images.

Miscellaneous Fixes

  • Don’t use apostrophe in the image files names e.g. Aditya-Farrad.jpg
  • Try to change the extension of the file.
  • Disable all the plugins.
  • Make sure your host has the latest version of PHP installed.
  • Contact your Hosting Provider for support.

WordPress shows HTTP error when uploading images. If you still have any question regarding this post feel free to ask them comments.

Like and share this blog post in the social networks to help spread the word about this problem.

Recommended Articles