As with any platform, there are e'er those annoying errors or problems 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 expiry to database connection errors, WordPress definitely has its quirks. 😉 But we still love it! Today we're going to dive into i of the more than common ones, theHTTP fault. Users typically encounter this when trying to upload images or videos to the WordPress media library.

While the HTTP error is commonly easy to fix it tin can be rather frustrating as it unremarkably interrupts your workflow. Nothing is worse than spending 20 minutes trying to find that perfect paradigm for your weblog mail service, you go to upload information technology, and bam, you lot're suddenly met with a very vague error.

Below nosotros'll explore why this mistake happens and what you can exercise to quickly resolve it so you can get dorsum to uploading your media.

What is the WordPress HTTP Error?

The WordPress HTTP error occurs when something goes wrong while attempting to upload images or videos using the built-in media library tool. Unfortunately, unlike browser errors where nosotros can commonly reference an HTTP status code, WordPress errors are sometimes a little harder to troubleshoot (especially 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. Just that is considering there could be a few causes for the failure and WordPress simply doesn't know why, so information technology spits out a generic fault message (equally seen beneath).

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

How to Ready the WordPress HTTP Mistake

From our feel, the WordPress HTTP error typically originates from 2 things: the first is acustomer-side or user error (your login session, bad characters in the file name, etc.), and the second is aproblem or setting on your WordPress host(server outcome, memory list, third-party plugin, shared hosting throttling resources, etc.). So nosotros'll dive into a little of both.

Here are some recommendations and things to check to fix the error (sorted in order by most mutual reasons nosotros see):

  1. Refresh the Page
  2. Compress or Resize the File
  3. Rename the Image File
  4. Temporarily Conciliate 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 Performance Issues with Imagick and Shared Hosts
  10. Remove Custom Media Library Path
  11. Disable mod_security
  12. Install the Add To Server Plugin

1. Refresh the Page

The very first thing y'all should exercise when encountering the WordPress HTTP fault is to but refresh the folio in your browser. Sounds too easy right? 😉 Well, actually this is the most common ready we've seen for it. Here's why:

First, for any reason, your browser might have lost connection temporarily with WordPress and the process but failed to complete. This could be due to your Internet access provider, a temporary hiccup with your WordPress host, etc. If you refresh the page and try uploading again it the mistake sometimes will resolve itself.

Second, nosotros've also seen that sometimes after refreshing the page, or coming dorsum 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 come across the following message:

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

Your session has expired
Your session has expired

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

2. Compress or Resize the File

Y'all might demand to edit your image file, which could entail reducing the file size (KB or MB) or decreasing the width/height (pixels). We recommend checking out our in-depth post on how to optimize images for the web. There are a lot of 3rd-party image optimization plugins you tin can use to automatically do 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 unmarried issue. Simply in that location are a lot of other nifty ones out there as well. Only brand sure whichever plugin you utilise, that they are optimizing images on their own servers, non locally. If you're majority optimizing images locally this tin drastically harm your site's performance.

Imagify WordPress plugin
Imagify WordPress plugin

Information technology's OK to upload high-resolution images equally WordPress supports responsive images out of the box. In fact, you will probably want to and so that the epitome looks well-baked on retina displays. Only unless your a lensman or business that needs loftier-resolution images a proficient rule of thumb though is to keep your concluding image size under 100 KB and no more than double the size of your website's content div width.

Also, you might take to play with the PNG and JPG file types. Sometimes one tin can exist much larger than the other depending on what type of image information technology is.

Depending on the configuration of your WordPress host, you might also want to expect into increasing the WordPress maximum upload file size.

3. Rename the Image File

It can never hurt to try and rename the prototype file. WordPress should automatically append a number on the terminate if you try to upload a indistinguishable file name, but in case that doesn't work, try renaming your file. Unfortunately, WordPress doesn't let you rename the file of an already uploaded image file, so you will need to rename information technology locally and re-upload information technology.

When we are uploading images that already exist nosotros typically add a -1 or -ii on the end (example: paradigm-file-1.png, image-file-2.png). Make sure to add together the nuance otherwise Google will read information technology equally one discussion and it could hurt your SEO.

Also, to be safe, stay clear of uploading an epitome with file names that contain special characters. This includes international linguistic communication symbols and characters such as apostrophes. Dashes are OK. You tin can see in this example below on the Kinsta Japanese site, we are using English language for the file names, non the special characters. While WordPress can technically support these, at that place are a lot of other issues that can popular up.

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

4. Temporarily Conciliate Plugins and Themes

Information technology's always a expert thought if you're having HTTP errors to try deactivating your plugins and even switch your WordPress theme to the default to see if this resolves the problem. A few plugins that are are typical culprits include epitome optimization plugins (they tie directly into the media library) and security plugins such as WordFence (these plugins are sometimes as well restrictive). Or you tin simply delete your WordPress theme.

If you don't want to touch your alive site, but clone your alive site to a staging environment. If the WordPress HTTP error is also happening on staging, and then yous tin can quickly deactivate all your plugins to start narrowing it down.

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

Deactivate all plugins
Deactivate all plugins

If this fixes the consequence you'll need to find the culprit. Start activating them 1 by 1, and try uploading an image over again in the media library. When y'all see the HTTP fault render, you've establish the misbehaving plugin. Yous tin can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

If you tin can't access WordPress admin yous can FTP into your server and rename your plugins folder to something like plugins_old. So bank check your site again. If information technology works, and then you will need to exam each plugin one by one. Rename your plugin folder dorsum to plugins and then rename each plugin binder inside of if information technology, i by one, until you discover it. Y'all could also try to replicate this on a staging site first.

Rename plugin folder
Rename plugin folder

The same goes for your WordPress theme. Typically themes don't tie into the media library, but we've seen some weird setups. Information technology never hurts to try switching your theme over to the default Twenty Seventeen theme to come across if it fixes it. Just like with plugins, you don't have to worry about losing your current theme settings. All of that is stored in the WordPress database.

5. Ask Your WordPress Host

If yous've tried the steps higher up already and are still getting the WordPress HTTP error, we recommend reaching out to your WordPress host for assistance before proceeding. Many of the boosted troubleshooting steps are a petty more than advanced and a lot of times you can ask your host to do or check on this for yous.

Kinsta'southward support team is available 24×vii from the bottom right-hand side of the MyKinsta dashboard.

Kinsta WordPress hosting support
Kinsta WordPress hosting support

6. Increment PHP Memory Limit

Another cause for the WordPress HTTP error is that your server lacks the available retentiveness for the background upload procedure to consummate successfully. This is a very common trouble with shared WordPress hosting. To gear up it you demand to increase the amount of memory PHP can use.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 have whatever bug with a lack of memory. 👍

Increase PHP Retentivity Limit with wp-config.php

You lot tin increase the PHP memory limit by adding the post-obit lawmaking to your wp-config.php file. Note: this may exist overwritten by a server-level dominion in identify by your WordPress host.

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

Increment PHP Memory Limit in cPanel

If your host is using cPanel, yous can increase the PHP retentiveness limit in two dissimilar areas.

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

The 2nd area is besides under the software department. Click on the "MultiPHP INI Editor" tool. This allows yous to change the php.ini file. Simply gyre down to where it says "memory_limit" and input a higher value.

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

Increase PHP Retentiveness Limit with php.ini

Subscribe Now

If you aren't using cPanel, you tin can also edit the php.ini file directly if you accept access. To do 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? Learn how to fix the SSH "Connection Refused" error.

If the file was already at that place, search for the "memory_limit" setting and change it as necessary.

Some shared hosts might also require that you add the suPHP directive in your .htaccess file for the above php.ini file settings to work. To do this, edit your .htaccess file, also located at the root of your site, and add the post-obit code towards the top of the file:

          <IfModule mod_suphp.c>  suPHP_ConfigPath /home/yourusername/public_html </IfModule>        

Increase PHP Retention Limit with .htaccess

The .htaccess file is a special hidden file that contains diverse settings you lot tin can utilize to modify the server beliefs, right down to a directory specific level. If you lot don't accept access to php.ini, we propose y'all try this side by side. Outset, login to your site via FTP or SSH, accept a look at your root directory and see if there is a .htaccess file in that location.

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

seven. Check Uploads Folder Permissions

Typically when at that place is a folder permissions error you should get a bulletin in WordPress about it not being able to write to the directory. However, this might not always be the case. If a WordPress site has been hacked or infected with malware, at that place could be a lot of issues going on with the permissions.

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

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

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

You tin easily see your binder permissions with an FTP client (as seen below). Y'all could also attain out to your WordPress host support 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 yous manually update the permissions on this folder that you check both the "Recurse into subdirectories" option likewise as the "Apply to directories simply."

WordPress uploads directory permissions
WordPress uploads directory permissions

viii. Motility to the Latest Version of PHP

WordPress officially recommends PHP 7.iii or higher. If you're not running on that, you're below the minimum requirements set by the developers of the CMS. 😮

We always recommend running the latest and supported versions of PHP due to the fact it offers meliorate security and performance, including problems fixes and functions that demand to exist deprecated.

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

Change to PHP 7.4
Change to PHP 7.iv

If your host uses cPanel they might already have an option available to you to alter your version of PHP. Merely 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

nine. Ready Performance Issues 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 one.

The problem is that shared WordPress hosts have a lot of hidden resource throttling behind the scenes. That is the only mode they can cram so many users on the same machine. A common outcome people come across is that in that location are too few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to utilize multiple threads, hence resulting in the WordPress HTTP error.

You can add the following code to the meridian of your .htaccess file, changing the thread limit value to something higher.

MAGICK_THREAD_LIMIT 1

Another option yous have is to tell WordPress to utilise the GD library instead of Imagick. You can do this by just adding the post-obit lawmaking to your theme'southward functions.php file.

          office 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 be blunt. If you're having to tweak things like this information technology's time to move to a new WordPress host. Kinsta doesn't have crazy limits similar this in place and for the nearly office, yous're only limited by PHP workers. You shouldn't have to worry about these types of things as a website possessor.

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

Read more than about how Kinsta is unlike than whatever other host you'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 product. If you look in "Media" under "Settings" in your WordPress dashboard and see a file path value listed, go ahead and delete information technology and click "Salve Changes." You want your media to be stored in the default /wp-content/uploads binder.

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

WordPress media settings
WordPress media settings

11. Disable mod_security

Mod_security is an open source firewall that sometimes might crusade the WordPress HTTP mistake to occur. You can disable mod_security by adding the following code to the summit of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

Then toggle the condition from "On" to "Off" adjacent to the domain y'all want to disable it on.

Disable mod_security
Disable mod_security

We always recommend using an enterprise-grade and nevertheless affordable WAF similar Sucuri or Cloudflare instead. You can read our recommendation for the best WAF settings here.

12. Install the Add From Server Plugin

Last simply non to the lowest degree, if you're actually in a bind and null else seems to be working, you can install the gratis Add together From Server plugin. Perhaps you're waiting for a response from your WordPress host or a developer on how to go the WordPress HTTP error resolved.

Add From Server WordPress plugin
Add From Server WordPress plugin

The Add to Server plugin volition usually get you effectually the error and could be a good temporarily ready, especially if yous're right in the center of something important. It was originally developed to allow you to add very large files via SFTP.Of import: this plugin is no longer maintained or supported. Use at your own chance.

Summary

Every bit you can see there are quite a few dissimilar ways to set up the WordPress HTTP fault. Hopefully one of the solutions in a higher place worked for you and you're already dorsum on track and uploading your media. If yous continue to receive this error time and time again, it might be fourth dimension to consider upgrading to a amend WordPress host. Many of the solutions above are things y'all don't have to worry about at Kinsta.

If yous plant a solution that isn't in our list, please leave a comment a beneath and we'll become it added.


Salvage fourth dimension, costs and maximize site functioning with:

  • Instant aid from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 32 data centers worldwide.
  • Optimization with our born Application Performance Monitoring.

All of that and much more, in one program with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to notice the plan that's right for you.