How to Fix HTTP Error When Loading Images in WordPress

The HTTP error de is a code indicating that something went wrong during a file upload process. Typically, the WordPress HTTP error occurs when you try to add an image and other types of files to the media library. This guide covers 9 proven solutions to this problem in no particular order. Without further ado, let’s begin.

9 Easy Ways To Fix WordPress HTTP Error

Let’s review possible solutions for HTTP error loading images in WordPress. The following solutions will work whether you’re uploading an image, video, PDF, or anything else.

1. Confirm the HTTP error

Sometimes a temporary server crash can cause a WordPress HTTP error. Before trying any of the solutions in this tutorial, you should first make sure that the error persists.

It starts by waiting a few minutes and uploading the media file once more. If the second attempt is successful, it could mean that a temporary problem occurred at the time of the error.

Also, clean the name of the image file, that is, remove characters and symbols such as apostrophes, semicolons, among others. A good number of users report that the error was resolved after removing the apostrophes from the file name.

However, if the problem persists, read on for more solutions.

2. Change browser

The WordPress HTTP error may not be related to the website and could be caused by something more unexpected: your browser.

There have been reports of HTTP errors when using Google Chrome. While it’s a great browser, using a different browser will allow you to confirm if the issue is browser-related.

In case the problem still persists, below are more solutions.

3. Disable plugins

See also  How to backup your WordPress site

If the WordPress HTTP error appeared after installing a plugin, your best option is to disable it. To save you some trouble, image optimization plugins have been known to cause this issue. As such, if you have an image optimization plugin, temporarily disable it and try uploading the image once more.

If the HTTP error goes away, you can try looking for an alternative image optimizer plugin. Alternatively, you can try contacting the plugin developers to fix the error.

However, if the error persists even after disabling all plugins, try the solution below.

4. Increase WordPress memory limit

A common cause of WordPress HTTP error is out of memory. It can also cause many other problems, such as the . Fixing out of memory is a matter of adding the following line to your file wp-config.php:

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

The above code increases your PHP memory limit to 256 MB. Before adding it, you should also confirm what the maximum available memory limit is on your server by checking the PHP information.

5. Set GD Library as default image editor

Speaking of magic, did you know that WordPress comes with two image editors? That’s right, WordPress uses Imagick or GD Library to process images. While both are great, Imagick has been known to exhaust available memory and cause the HTTP error.

To avoid this problem, you must make GD Library your default editor. How? Just put this code in the file functions.php of your template:

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’ );

Save your changes and try uploading the image again. If the HTTP error persists, you should undo the code change and try the next solution.

See also  How to check Ubuntu version (2 easy ways)

6. Edit the .htaccess file

It is in your WordPress root directory and acts as a gatekeeper for all sorts of things. He controls where requests go, among many other things.

To fix the WordPress HTTP error, open .htaccess and add the following code:

SetEnv MAGICK_THREAD_LIMIT 1

Once this is done, try adding your file again to see if the issue is resolved. If it didn’t work, there are other code snippets you can try:

SecFilterEngine Off SecFilterScanPOST Off

either

# Exclude the file upload and WP CRON scripts from authentication Satisfy Any Order allow,deny Allow from all Deny from none < /FilesMatch>

Try to implement them individually, save your changes and upload your media file once more.

7. Review your template

If the error appears after installing or updating a WordPress theme, the WordPress theme is likely the culprit. A good approach is to switch to a default template (eg Twenty Seventeen).

If everything works fine with a default template, try contacting your current template provider or developer with the details. In such a case, the HTTP error could be an isolated issue with the template or an incompatibility between the template and a plugin.

8. Check your PHP version

As of , WordPress requires PHP version 5.2.4 or higher to run smoothly. Any older version will leave you stuck with the HTTP error. Some hosting providers use older versions of PHP, which means that no matter what you try, you can’t upload images to the WordPress media library.

To do? First, check with your hosting provider to make sure they are using PHP version 5.2.4 and higher. Alternatively, you can join millions of other website owners at , which offers the latest stable version of PHP upon release.

See also  What is hosting and how does it work?

9. Clear cache

Still getting the WordPress HTTP error after trying all the above solutions? Maybe you fixed the error a while ago, but the “error” you see is coming from the local cache. Before you walk away thinking that no solution works for you, try .

further reading

Mistakes are an unavoidable part of life, but fixing them is the real challenge. Here is a list of known WordPress bugs with detailed steps to fix them.

conclusion

Getting HTTP error while uploading images in WordPress creates a bad feeling. However, we are sure that some of the solutions shown will fix this error once and for all.

Have you ever got the WordPress HTTP error and solved it with a different solution? If so, feel free to share your experiences in the comments section below.

Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new WordPress tricks you can find him playing the guitar, traveling or taking an online course.

Loading Facebook Comments ...
Loading Disqus Comments ...