As with any platform, there are always those annoying errors or issues you take to learn how to piece of work through. Trust usa, we've pretty much seen them all! From the white screen of decease to database connection errors, WordPress definitely has its quirks. 😉 But we nevertheless love information technology! Today we're going to dive into one of the more common ones, theHTTP mistake. Users typically see this when trying to upload images or videos to the WordPress media library.

While the HTTP error is usually easy to fix it can be rather frustrating as it normally interrupts your workflow. Nothing is worse than spending 20 minutes trying to discover that perfect paradigm for your blog post, yous go to upload it, and bam, you're of a sudden met with a very vague mistake.

Beneath we'll explore why this mistake happens and what you can do to quickly resolve information technology and so you tin can get dorsum to uploading your media.

What is the WordPress HTTP Mistake?

The WordPress HTTP error occurs when something goes wrong while attempting to upload images or videos using the congenital-in media library tool. Unfortunately, different browser errors where we can unremarkably reference an HTTP condition lawmaking, WordPress errors are sometimes a little harder to troubleshoot (particularly if y'all don't know how to enable WordPress debugging way).

The very vague "HTTP error" definitely doesn't aid you determine what might be wrong or even where to outset looking. Simply that is because there could exist a few causes for the failure and WordPress only doesn't know why, and so it spits out a generic error message (as seen below).

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

How to Prepare the WordPress HTTP Mistake

From our experience, the WordPress HTTP fault typically originates from two things: the starting time is acustomer-side or user error (your login session, bad characters in the file name, etc.), and the second is atrouble or setting on your WordPress host(server result, retentiveness list, third-party plugin, shared hosting throttling resource, etc.). So we'll dive into a little of both.

Here are some recommendations and things to check to fix the error (sorted in gild by near common reasons we see):

  1. Refresh the Folio
  2. Compress or Resize the File
  3. Rename the Paradigm File
  4. Temporarily Conciliate Plugins and Theme
  5. Ask Your WordPress Host
  6. Increase PHP Memory Limit
  7. Check Uploads Binder Permissions
  8. Movement to the Latest Version of PHP
  9. Fix 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 starting time thing you should do when encountering the WordPress HTTP fault is to just refresh the folio in your browser. Sounds too easy right? 😉 Well, actually this is the about common set up we've seen for it. Here's why:

Kickoff, for whatever reason, your browser might accept lost connection temporarily with WordPress and the process simply failed to complete. This could be due to your Isp, a temporary hiccup with your WordPress host, etc. If you lot refresh the page and try uploading once more it the fault sometimes volition resolve itself.

Second, nosotros've as well seen that sometimes after refreshing the folio, or coming back to the WordPress editor from some other tab, that it suddenly kicks you out. This is most likely an indicator that your WordPress login session has expired. You lot should come across the post-obit message:

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

Your session has expired
Your session has expired

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

2. Shrink or Resize the File

You might need to edit your image file, which could entail reducing the file size (KB or MB) or decreasing the width/acme (pixels). We recommend checking out our in-depth post on how to optimize images for the web. At that place are a lot of third-party paradigm optimization plugins you tin can utilise to automatically practice this for you (both reducing and resizing) when your image is uploaded to the media library.

Nosotros have used Imagify on our Kinsta site for years without a single event. Just there are a lot of other nifty ones out there besides. Just make certain whichever plugin you lot apply, that they are optimizing images on their ain servers, not locally. If yous're bulk optimizing images locally this can drastically harm your site's performance.

Imagify WordPress plugin
Imagify WordPress plugin

Information technology's OK to upload high-resolution images as WordPress supports responsive images out of the box. In fact, y'all will probably want to so that the prototype looks crisp on retina displays. Simply unless your a lensman or business that needs high-resolution images a skillful rule of pollex though is to keep your last image size nether 100 KB and no more double the size of your website'due south content div width.

Also, y'all 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 image it is.

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

three. Rename the Image File

It can never hurt to effort and rename the epitome file. WordPress should automatically append a number on the terminate if you lot try to upload a duplicate file name, just in case that doesn't work, attempt renaming your file. Unfortunately, WordPress doesn't let you rename the file of an already uploaded epitome file, so you lot volition need to rename it locally and re-upload it.

When we are uploading images that already exist we typically add together a -ane or -ii on the end (example: image-file-1.png, image-file-ii.png). Make sure to add together the nuance otherwise Google will read it every bit one word and it could injure your SEO.

As well, to be safe, stay clear of uploading an image with file names that contain special characters. This includes international language symbols and characters such as apostrophes. Dashes are OK. Yous can see in this example beneath 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 pop up.

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

4. Temporarily Deactivate Plugins and Themes

Information technology'southward always a skilful idea if you're having HTTP errors to try deactivating your plugins and even switch your WordPress theme to the default to run into if this resolves the problem. A few plugins that are are typical culprits include image optimization plugins (they tie direct into the media library) and security plugins such equally WordFence (these plugins are sometimes also restrictive). Or you can simply delete your WordPress theme.

If you lot don't want to affect your live site, simply clone your live site to a staging environs. If the WordPress HTTP error is also happening on staging, then you can quickly deactivate all your plugins to kickoff narrowing it downwardly.

Remember, you won't lose whatever data if yous but deactivate a plugin. If you lot can nevertheless admission 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 you lot'll need to find the culprit. First activating them i by one, and endeavour uploading an image again in the media library. When you come across the HTTP error return, you've found the misbehaving plugin. You can and then attain out to the plugin developer for assist or post a support ticket in the WordPress repository.

If y'all tin't admission WordPress admin you tin FTP into your server and rename your plugins folder to something like plugins_old. Then check your site again. If it works, so y'all volition demand to examination each plugin 1 by one. Rename your plugin folder back to plugins and and then rename each plugin binder inside of if information technology, ane past one, until you detect it. You could also attempt 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 necktie into the media library, but we've seen some weird setups. It never hurts to effort switching your theme over to the default Twenty Seventeen theme to run into if it fixes it. Just like with plugins, you don't take to worry nigh 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 to a higher place already and are still getting the WordPress HTTP error, we recommend reaching out to your WordPress host for assistance before proceeding. Many of the additional troubleshooting steps are a little more avant-garde and a lot of times you can enquire your host to do or check on this for you.

Kinsta'due south support squad is available 24×7 from the bottom right-hand side of the MyKinsta dashboard.

Kinsta WordPress hosting support
Kinsta WordPress hosting support

half dozen. Increment PHP Memory Limit

Another cause for the WordPress HTTP fault is that your server lacks the bachelor memory for the groundwork upload process to complete successfully. This is a very common problem with shared WordPress hosting. To ready it you demand to increase the amount of retentiveness PHP can use.256 MB is recommended.

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

Increase PHP Memory Limit with wp-config.php

Y'all can increase the PHP retentiveness limit by calculation the following code to your wp-config.php file. Note: this may be overwritten by a server-level rule in place by your WordPress host.

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

Increase PHP Memory Limit in cPanel

If your host is using cPanel, you can increment the PHP memory limit in 2 different areas.

The first is under the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." Y'all tin then click on "memory_limit" to change its value.

The second area is also under the software section. Click on the "MultiPHP INI Editor" tool. This allows yous to modify the php.ini file. But curlicue 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 Retention Limit with php.ini

Subscribe At present

If you aren't using cPanel, you lot tin can also edit the php.ini file directly if you have admission. 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 set up 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 also require that you lot add together the suPHP directive in your .htaccess file for the above php.ini file settings to work. To practise this, edit your .htaccess file, also located at the root of your site, and add the following code towards the elevation of the file:

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

Increase PHP Memory Limit with .htaccess

The .htaccess file is a special hidden file that contains various settings yous can use to modify the server behavior, right down to a directory specific level. If you don't have access to php.ini, we suggest you try this next. First, login to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess file at that place.

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

7. Check Uploads Folder Permissions

Typically when there is a folder permissions error you lot should get a bulletin in WordPress about information technology not being able to write to the directory. All the same, this might not e'er be the case. If a WordPress site has been hacked or infected with malware, there could be a lot of problems going on with the permissions. 

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

The main 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-x) or 750.

You lot can easily come across your binder permissions with an FTP client (every bit seen below). You could also reach 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 properly.

Make sure that if y'all manually update the permissions on this folder that yous check both the "Recurse into subdirectories" option as well as the "Utilize to directories only."

WordPress uploads directory permissions
WordPress uploads directory permissions

8. Motility to the Latest Version of PHP

WordPress officially recommends PHP seven.3 or higher. If you lot're non running on that, you're below the minimum requirements ready by the developers of the CMS. 😮

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

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

Change to PHP 7.4
Modify to PHP seven.4

If your host uses cPanel they might already accept an selection available to you to alter your version of PHP. Simply log in to cPanel and nether the "Software" category click on "Select PHP Version."

Select PHP version
Select PHP version

You can then select the PHP versions bachelor to you lot that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Fix Operation Bug with Imagick and Shared Hosts

There are ii different PHP modules WordPress uses for image processing: GD Library and Imagick (ImageMagick). Depending on what is installed on your server, WordPress may apply either one.

The problem is that shared WordPress hosts accept a lot of hidden resources throttling backside the scenes. That is the but way they can cram so many users on the same motorcar. A common issue people run into is that there are too few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to use multiple threads, hence resulting in the WordPress HTTP error.

You tin add the post-obit code to the meridian of your .htaccess file, changing the thread limit value to something higher.

MAGICK_THREAD_LIMIT 1

Another selection you have is to tell WordPress to use the GD library instead of Imagick. Yous can exercise this by simply adding the following code to your theme'due south 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' );        

Nosotros'll be blunt. If you're having to tweak things like this information technology's fourth dimension to move to a new WordPress host. Kinsta doesn't have crazy limits like this in identify and for the about part, you're merely limited by PHP workers. You shouldn't have to worry about these types of things equally a website owner.

Nosotros utilize 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 resources required to run it (Linux, Nginx, PHP, MySQL). The resource are 100% private and are non shared betwixt anyone else or even your ain sites.

Read more well-nigh how Kinsta is different than whatsoever other host yous've tried.

10. Remove Custom Media Library Path

Information technology very well could be that your media library path isn't setup correctly. We typically run across this when users drift their local development site over to production. If you wait in "Media" under "Settings" in your WordPress dashboard and see a file path value listed, go ahead and delete it and click "Salvage 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, then you're all skillful hither.

WordPress media settings
WordPress media settings

11. Disable mod_security

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

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

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

cPanel ModSecurity
cPanel ModSecurity

Then toggle the status from "On" to "Off" next to the domain you lot desire to disable it on.

Disable mod_security
Disable mod_security

We always recommend using an enterprise-course and all the same affordable WAF like Sucuri or Cloudflare instead. You can read our recommendation for the all-time WAF settings here.

12. Install the Add From Server Plugin

Last simply non least, if you're really in a bind and nothing else seems to be working, you tin can install the gratis Add From Server plugin. Maybe you're waiting for a response from your WordPress host or a developer on how to become the WordPress HTTP error resolved.

Add From Server WordPress plugin
Add From Server WordPress plugin

The Add together to Server plugin volition usually get you around the fault and could be a adept temporarily fix, especially if you're right in the middle of something important. It was originally developed to allow you to add very large files via SFTP.Important: this plugin is no longer maintained or supported. Use at your own risk.

Summary

As yous can meet there are quite a few unlike ways to prepare the WordPress HTTP error. Hopefully 1 of the solutions above worked for you and you're already back on runway and uploading your media. If you proceed to receive this error time and time once again, it might be time to consider upgrading to a better WordPress host. Many of the solutions above are things you lot don't have to worry about at Kinsta.

If you found a solution that isn't in our listing, please leave a comment a below and nosotros'll become it added.


Save time, costs and maximize site functioning with:

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

All of that and much more than, in one plan with no long-term contracts, assisted migrations, and a xxx-day-coin-back-guarantee. Bank check out our plans or talk to sales to notice the plan that'southward right for y'all.