Fix: Wordpress HTTP Error when Uploading Media

WordPress is a piece of software which has become the most widely used content management system and is used for setting up blogs. It is open source written in PHP. However, quite recently a lot of reports have been coming in of users encountering the error “HTTP error” on their WordPress. This error happens when the user is trying to upload a media file but unable to do so.

Wordpress HTTP Error when Uploading Media
HTTP Error in WordPress Fix

What Causes Wordpress HTTP Error when loading Media?

We investigated this particular issue by looking at various user reports and the repair strategies that are commonly used to fix this particular issue on WordPress. As it turns out, there are several different reasons why this particular issue occurs:

  • Browser Problem: Each browser has different settings and services. Some might conflict with the operation of uploading media files on WordPress for some reasons. While others will have no problem completing the task.
  • The setting of Site: Sometimes the size of the image or the default settings for your site can be blocking the uploading of images. Changing some of the code might help to fix it.

Now that you have a basic understanding of the nature of the issue, we will move on towards the methods. These methods worked for different users trying different ones. Try and see which one works for you.

Method 1: Switch the Browsers

It is possible that this error is not related to the website but related to the browser that the user is using. Before you confirm it as the error inside the Wordpress, make sure you check the same situation in a different browser. Mostly the problem that users get is in Google Chrome, so trying Firefox or Safari may work for them. Different browsers will have a different impact on using the Wordpress and uploading images to it.

Method 2: Editing the Theme Function

You can directly do the editing on Wordpress or through using the web hosting control panel. You can find the file in your website theme directory. The file where you need to edit will be “function.php”. To edit the file in WordPress, follow the steps below:

  1. Open your WordPress Dashboard by simply adding wp-admin to your URL, like:
    example.com/wp-adminNote

    example.com will be your URL for your site

    Opening your dashboard on WordPress
  2. Now on your dashboard, go to “Theme Editor” on the left-side panel through Appearance
  3. Then you need to select a theme on top-right “Select theme to edit
  4. Now open “function.php” below theme selection
  5. And add the following lines in it:
    add_filter( 'wp_image_editors', 'change_graphic_lib' );
    
    function change_graphic_lib($array) {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }

    Editing the code in function.php
  6. Now save it and try again uploading the image.

Method 3: Editing the .htaccess

The .htaccess file exists in the root folder of your Wordpress. This file controls requests from one function to another, and act as a gatekeeper for all sort of things. To fix the HTTP error through this file, you need to do the following steps:

  1. Open your root directory through installed WordPress or using a control panel, such as cPanel
  2. Then, open .htaccess in the root folder of your website

    Opening the .htaccess file in the root directory
  3. Add the following code to the .htaccess file:
    SetEnv MAGICK_THREAD_LIMIT 1
    

    This code will limit the Imagic to use single thread when processing the images

  4. Now save it and check by uploading the image again
ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.
Back to top button