As with any platform, there are ever those annoying errors or bug you have to learn how to work through. Trust united states of america, we've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. 😉 Merely we nonetheless love information technology! Today we're going to dive into 1 of the more than common ones, theHTTP error. Users typically encounter this when trying to upload images or videos to the WordPress media library.

While the HTTP mistake is usually easy to ready information technology can be rather frustrating as it unremarkably interrupts your workflow. Null is worse than spending 20 minutes trying to find that perfect image for your web log mail service, you lot go to upload it, and bam, you're suddenly met with a very vague error.

Beneath nosotros'll explore why this error happens and what y'all can do to chop-chop resolve it so you tin get back to uploading your media.

What is the WordPress HTTP Mistake?

The WordPress HTTP mistake occurs when something goes wrong while attempting to upload images or videos using the built-in media library tool. Unfortunately, dissimilar browser errors where nosotros can usually reference an HTTP status lawmaking, WordPress errors are sometimes a little harder to troubleshoot (specially if you lot don't know how to enable WordPress debugging mode).

The very vague "HTTP error" definitely doesn't help you determine what might be wrong or even where to commencement looking. Only that is because there could be a few causes for the failure and WordPress simply doesn't know why, and so it spits out a generic error bulletin (as seen beneath).

WordPress HTTP error when uploading images
WordPress HTTP error when uploading images

How to Ready the WordPress HTTP Mistake

From our experience, the WordPress HTTP error typically originates from two things: the first is aclient-side or user error (your login session, bad characters in the file name, etc.), and the 2d is aproblem or setting on your WordPress host(server outcome, memory listing, third-party plugin, shared hosting throttling resources, etc.). And so we'll dive into a footling of both.

Here are some recommendations and things to bank check to fix the mistake (sorted in order past most common reasons we see):

  1. Refresh the Page
  2. Shrink or Resize the File
  3. Rename the Image File
  4. Temporarily Deactivate Plugins and Theme
  5. Ask Your WordPress Host
  6. Increase PHP Memory Limit
  7. Check Uploads Folder Permissions
  8. Move to the Latest Version of PHP
  9. Gear up Operation Problems with Imagick and Shared Hosts
  10. Remove Custom Media Library Path
  11. Disable mod_security
  12. Install the Add To Server Plugin

one. Refresh the Folio

The very start thing you should do when encountering the WordPress HTTP error is to simply refresh the page in your browser. Sounds too like shooting fish in a barrel correct? 😉 Well, really this is the most common prepare nosotros've seen for it. Here's why:

First, for any reason, your browser might accept lost connection temporarily with WordPress and the process simply failed to consummate. This could exist due to your Internet access provider, a temporary hiccup with your WordPress host, etc. If y'all refresh the page and endeavor uploading again information technology the error sometimes will resolve itself.

Second, we've also seen that sometimes after refreshing the folio, or coming back to the WordPress editor from another tab, that it suddenly kicks you out. This is most likely an indicator that your WordPress login session has expired. You should encounter the post-obit message:

Your session has expired. Please log in to continue where yous left off.

Your session has expired
Your session has expired

So naturally, you log back in and try to upload your media again. However, the HTTP error occurs. This is kind of a quirk with WordPress. Once you log back in, you need to actually manually refresh the page y'all're on. So uploading media will work again.

ii. Compress or Resize the File

Y'all might need to edit your prototype file, which could entail reducing the file size (KB or MB) or decreasing the width/pinnacle (pixels). Nosotros recommend checking out our in-depth post on how to optimize images for the spider web. In that location are a lot of third-party image optimization plugins you can use to automatically exercise this for you (both reducing and resizing) when your image is uploaded to the media library.

We have used Imagify on our Kinsta site for years without a single issue. Simply in that location are a lot of other great ones out at that place as well. Just make sure whichever plugin y'all apply, that they are optimizing images on their ain servers, not locally. If you're bulk optimizing images locally this can drastically harm your site'southward performance.

Imagify WordPress plugin
Imagify WordPress plugin

It'south OK to upload high-resolution images as WordPress supports responsive images out of the box. In fact, you lot will probably want to so that the epitome looks crisp on retina displays. But unless your a photographer or concern that needs loftier-resolution images a good rule of thumb though is to keep your concluding image size under 100 KB and no more than double the size of your website'southward content div width.

Also, you lot might have to play with the PNG and JPG file types. Sometimes one can be much larger than the other depending on what type of paradigm it is.

Depending on the configuration of your WordPress host, you might too desire to await into increasing the WordPress maximum upload file size.

3. Rename the Image File

It tin never hurt to try and rename the paradigm file. WordPress should automatically append a number on the end if yous try to upload a duplicate file name, but in example that doesn't work, endeavour renaming your file. Unfortunately, WordPress doesn't permit you rename the file of an already uploaded image file, so you will need to rename it locally and re-upload information technology.

When we are uploading images that already exist we typically add a -1 or -ii on the finish (example: image-file-1.png, image-file-two.png). Make sure to add the dash otherwise Google will read information technology equally one give-and-take and it could hurt your SEO.

Also, to exist safe, stay clear of uploading an image with file names that comprise special characters. This includes international language symbols and characters such as apostrophes. Dashes are OK. Yous tin run into in this example below on the Kinsta Japanese site, nosotros are using English for the file names, non the special characters. While WordPress tin can technically support these, in that location are a lot of other issues that tin can pop up.

Rename image file with no special characters
Rename image file with no special characters

4. Temporarily Deactivate Plugins and Themes

It's e'er a good idea if you're having HTTP errors to try deactivating your plugins and fifty-fifty switch your WordPress theme to the default to see if this resolves the trouble. A few plugins that are are typical culprits include image optimization plugins (they tie directly into the media library) and security plugins such as WordFence (these plugins are sometimes besides restrictive). Or you tin can simply delete your WordPress theme.

If you don't want to bear upon your live site, simply clone your live site to a staging surroundings. If the WordPress HTTP error is also happening on staging, then y'all can quickly deactivate all your plugins to start narrowing it down.

Remember, y'all won't lose any data if you merely deactivate a plugin. If you can still access your admin, a quick way to do this is to browse to "Plugins" and select "Deactivate" from the bulk actions menu. This will disable all of your plugins.

Deactivate all plugins
Deactivate all plugins

If this fixes the issue y'all'll demand to detect the culprit. Start activating them 1 past ane, and try uploading an prototype again in the media library. When yous see the HTTP error return, you lot've found the misbehaving plugin. You lot can then reach out to the plugin developer for help or postal service a support ticket in the WordPress repository.

If you can't admission WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then bank check your site again. If it works, then you will demand to test each plugin one by one. Rename your plugin folder back to plugins and and so rename each plugin folder inside of if it, one past ane, until you find it. You could as well try to replicate this on a staging site first.

Rename plugin folder
Rename plugin binder

The same goes for your WordPress theme. Typically themes don't tie into the media library, but we've seen some weird setups. It never hurts to effort switching your theme over to the default 20 Seventeen theme to see if it fixes it. Simply like with plugins, you don't have to worry virtually losing your current theme settings. All of that is stored in the WordPress database.

five. Ask Your WordPress Host

If you've tried the steps above already and are still getting the WordPress HTTP error, we recommend reaching out to your WordPress host for aid before proceeding. Many of the boosted troubleshooting steps are a little more advanced and a lot of times you tin ask your host to practise or bank check on this for you.

Kinsta's support team is available 24×7 from the bottom right-paw side of the MyKinsta dashboard.

Kinsta WordPress hosting support
Kinsta WordPress hosting support

half dozen. Increase PHP Memory Limit

Another cause for the WordPress HTTP error is that your server lacks the available memory for the background upload procedure to complete successfully. This is a very common problem with shared WordPress hosting. To gear up it you need to increase the corporeality of retention PHP can utilise.256 MB is recommended.

The default retention limit for Kinsta clients is already set to 256 MB. If you host your WordPress site at Kinsta y'all shouldn't take any issues with a lack of memory. 👍

Increment PHP Memory Limit with wp-config.php

You can increase the PHP retention limit by adding the following lawmaking to your wp-config.php file. Notation: this may be overwritten past a server-level dominion in place by your WordPress host.

          ascertain( 'WP_MEMORY_LIMIT', '256M' );        

Increase PHP Memory Limit in cPanel

If your host is using cPanel, you can increase the PHP retentivity limit in two unlike areas.

The first is under the software department. Click on "Select PHP Version." Click on "Switch to PHP Options." You tin can then click on "memory_limit" to alter its value.

The second area is too under the software section. Click on the "MultiPHP INI Editor" tool. This allows you lot to change the php.ini file. Just gyre down to where it says "memory_limit" and input a higher value.

Increase PHP memory limit in cPanel
Increase PHP memory limit in cPanel

Increase PHP Memory Limit with php.ini

Subscribe At present

If you aren't using cPanel, yous can also edit the php.ini file directly if you accept access. To practice this, login to your site via FTP or SSH, go to your site's root directory and open or create a php.ini file.

Can't connect via SSH? Acquire how to fix the SSH "Connection Refused" error.

If the file was already there, search for the "memory_limit" setting and modify it as necessary.

Some shared hosts might likewise require that you add the suPHP directive in your .htaccess file for the to a higher place php.ini file settings to piece of work. To practise this, edit your .htaccess file, also located at the root of your site, and add together the following code towards the pinnacle of the file:

          <IfModule mod_suphp.c>  suPHP_ConfigPath /dwelling house/yourusername/public_html </IfModule>        

Increase PHP Retentiveness Limit with .htaccess

The .htaccess file is a special hidden file that contains various settings y'all can utilize to modify the server behavior, right down to a directory specific level. If you don't take access to php.ini, nosotros propose you lot try this next. Offset, login to your site via FTP or SSH, take a look at your root directory and run into if at that place is a .htaccess file at that place.

If there is yous can edit that file to and modify the "php_value memory_limit" value.

7. Check Uploads Folder Permissions

Typically when in that location is a folder permissions fault you should get a message in WordPress nigh information technology non being able to write to the directory. Nonetheless, this might not always be the example. If a WordPress site has been hacked or infected with malware, there could be a lot of bug going on with the permissions. 

Tip: Kinsta offers gratis hack fixes for all clients. 😄

The chief folder you're concerned with is your /wp-content/uploads folder, as this is where files are stored when uploaded via the media library.

According to the WordPress Codex, all directories should be 755 (drwxr-xr-ten) or 750.

You can easily see your binder permissions with an FTP client (as seen below). You could also reach out to your WordPress host back up team and ask them to quickly GREP file permissions on your folders and files to ensure they're set up up properly.

Make sure that if y'all manually update the permissions on this folder that you cheque both the "Recurse into subdirectories" option as well as the "Use to directories but."

WordPress uploads directory permissions
WordPress uploads directory permissions

8. Motion to the Latest Version of PHP

WordPress officially recommends PHP 7.3 or higher. If you're non running on that, you lot're beneath the minimum requirements set past the developers of the CMS. 😮

We always recommend running the latest and supported versions of PHP due to the fact information technology offers better security and operation, including bug fixes and functions that demand to exist deprecated.

Nosotros accept seen older versions of PHP contribute to all sorts of errors, including the infamous WordPress HTTP error. At Kinsta yous can easily change to PHP 7.4 with a single click in the MyKinsta dashboard.

Change to PHP 7.4
Change to PHP seven.four

If your host uses cPanel they might already have an pick available to you to change your version of PHP. Simply log in to cPanel and under the "Software" category click on "Select PHP Version."

Select PHP version
Select PHP version

You can then select the PHP versions available to yous that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Gear up Performance Bug with Imagick and Shared Hosts

There are two dissimilar PHP modules WordPress uses for epitome processing: GD Library and Imagick (ImageMagick). Depending on what is installed on your server, WordPress may use either 1.

The problem is that shared WordPress hosts have a lot of subconscious resource throttling behind the scenes. That is the merely style they can cram so many users on the same auto. A common effect people run into is that there are also few resources allocated to Imagick (ImageMagick). Hosts volition limit the ability to use multiple threads, hence resulting in the WordPress HTTP error.

Yous tin add the following code to the superlative of your .htaccess file, changing the thread limit value to something college.

MAGICK_THREAD_LIMIT 1

Another choice you have is to tell WordPress to use the GD library instead of Imagick. Y'all can practise this past simply calculation the following code to your theme'south functions.php file.

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

We'll exist blunt. If you lot're having to tweak things like this it's time to move to a new WordPress host. Kinsta doesn't take crazy limits similar this in place and for the most office, you lot're merely limited by PHP workers. You shouldn't have to worry nearly these types of things equally a website owner.

We utilize LXD managed hosts and orchestrated LXC software containers for each site. What this ways is that every WordPress site is housed in its own isolated container, which has all of the software resources required to run it (Linux, Nginx, PHP, MySQL). The resources are 100% private and are non shared betwixt anyone else or even your own sites.

Read more about how Kinsta is unlike than any other host y'all've tried.

10. Remove Custom Media Library Path

It very well could be that your media library path isn't setup correctly. We typically see this when users migrate their local development site over to production. If you wait in "Media" nether "Settings" in your WordPress dashboard and run across a file path value listed, get ahead and delete it and click "Relieve Changes." You desire your media to exist stored in the default /wp-content/uploads folder.

Below is what it typically looks like. If you don't see a library path, and then y'all're all adept here.

WordPress media settings
WordPress media settings

11. Disable mod_security

Mod_security is an open up source firewall that sometimes might cause the WordPress HTTP error to occur. You tin disable mod_security past calculation the following code to the top of your .htaccess file.

<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>

If you're using cPanel, yous can also disable information technology by clicking into "ModSecurity" in the "Security" section.

cPanel ModSecurity
cPanel ModSecurity

Then toggle the status from "On" to "Off" next to the domain yous want to disable information technology on.

Disable mod_security
Disable mod_security

Nosotros always recommend using an enterprise-course and however affordable WAF like Sucuri or Cloudflare instead. You can read our recommendation for the best WAF settings here.

12. Install the Add together From Server Plugin

Last but not least, if you're actually in a bind and nothing else seems to be working, you can install the free Add From Server plugin. Maybe yous're waiting for a response from your WordPress host or a developer on how to get the WordPress HTTP fault resolved.

Add From Server WordPress plugin
Add together From Server WordPress plugin

The Add to Server plugin will usually get y'all around the error and could exist a skillful temporarily set, especially if you're right in the centre of something important. It was originally adult to allow you to add together very large files via SFTP.Of import: this plugin is no longer maintained or supported. Employ at your own take a chance.

Summary

As you can see there are quite a few unlike ways to prepare the WordPress HTTP error. Hopefully 1 of the solutions in a higher place worked for y'all and you're already dorsum on rail and uploading your media. If you lot continue to receive this error time and fourth dimension again, it might be time to consider upgrading to a better WordPress host. Many of the solutions in a higher place are things yous don't have to worry nigh at Kinsta.

If you found a solution that isn't in our list, please go out a comment a below and we'll get it added.


Relieve time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/vii.
  • Cloudflare Enterprise integration.
  • Global audition accomplish with 29 data centers worldwide.
  • Optimization with our built-in Application Operation Monitoring.

All of that and much more, in one program with no long-term contracts, assisted migrations, and a 30-24-hour interval-coin-back-guarantee. Bank check out our plans or talk to sales to find the plan that'south right for you.