As with whatsoever platform, there are e'er those annoying errors or problems you take to larn how to piece of work through. Trust the states, we've pretty much seen them all! From the white screen of expiry to database connectedness errors, WordPress definitely has its quirks. 😉 But we still love it! Today nosotros're going to dive into one of the more than common ones, theHTTP fault. Users typically see this when trying to upload images or videos to the WordPress media library.

While the HTTP error is usually easy to ready information technology can be rather frustrating every bit it usually interrupts your workflow. Nothing is worse than spending 20 minutes trying to find that perfect image for your web log post, you go to upload it, and bam, you're all of a sudden met with a very vague mistake.

Below nosotros'll explore why this error happens and what you can practise to quickly resolve information technology and then you can become dorsum to uploading your media.

What is the WordPress HTTP Fault?

The WordPress HTTP fault occurs when something goes wrong while attempting to upload images or videos using the congenital-in media library tool. Unfortunately, unlike browser errors where we can usually reference an HTTP status code, WordPress errors are sometimes a little harder to troubleshoot (particularly if yous don't know how to enable WordPress debugging way).

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

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

How to Set up the WordPress HTTP Error

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

Here are some recommendations and things to check to fix the error (sorted in order by well-nigh common reasons we meet):

  1. Refresh the Page
  2. Shrink or Resize the File
  3. Rename the Image File
  4. Temporarily Deactivate Plugins and Theme
  5. Inquire Your WordPress Host
  6. Increase PHP Retentivity Limit
  7. Check Uploads Folder Permissions
  8. Move 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 together To Server Plugin

1. Refresh the Folio

The very first thing you should do when encountering the WordPress HTTP mistake is to only refresh the page in your browser. Sounds as well like shooting fish in a barrel correct? 😉 Well, really this is the virtually common fix we've seen for information technology. Here'southward why:

Commencement, for whatever reason, your browser might have lost connectedness temporarily with WordPress and the procedure simply failed to complete. This could be due to your ISP, a temporary hiccup with your WordPress host, etc. If yous refresh the page and try uploading again it the error sometimes will resolve itself.

2d, we've also seen that sometimes afterward refreshing the page, or coming back to the WordPress editor from another tab, that it all of a sudden kicks you out. This is most likely an indicator that your WordPress login session has expired. You should see the following message:

Your session has expired. Delight log in to proceed where you lot left off.

Your session has expired
Your session has expired

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

2. Shrink or Resize the File

You lot might need to edit your image file, which could entail reducing the file size (KB or MB) or decreasing the width/tiptop (pixels). We 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 lot can use to automatically do 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 unmarried issue. But there are a lot of other great ones out there also. Just make sure whichever plugin you lot use, that they are optimizing images on their own servers, not locally. If you're bulk optimizing images locally this tin drastically harm your site's performance.

Imagify WordPress plugin
Imagify WordPress plugin

It's OK to upload high-resolution images every bit WordPress supports responsive images out of the box. In fact, you will probably want to so that the paradigm looks crisp on retina displays. But unless your a photographer or business organization that needs high-resolution images a good rule of pollex though is to keep your final image size nether 100 KB and no more than double the size of your website'south content div width.

Also, you 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 information technology is.

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

3. Rename the Prototype File

It can never injure to endeavour and rename the image file. WordPress should automatically append a number on the end if y'all try to upload a duplicate file name, but in instance that doesn't work, try renaming your file. Unfortunately, WordPress doesn't allow you rename the file of an already uploaded image file, then you will demand to rename it locally and re-upload it.

When we are uploading images that already exist nosotros typically add a -one or -2 on the stop (example: prototype-file-i.png, image-file-2.png). Make sure to add the dash otherwise Google will read it as one give-and-take and it could hurt your SEO.

As well, to be prophylactic, stay articulate 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 run across in this example below on the Kinsta Japanese site, nosotros are using English language for the file names, not the special characters. While WordPress can technically support these, there are a lot of other issues that can pop up.

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

4. Temporarily Deactivate Plugins and Themes

It's always a expert idea if yous'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 image optimization plugins (they necktie straight into the media library) and security plugins such as WordFence (these plugins are sometimes also restrictive). Or y'all can simply delete your WordPress theme.

If you lot don't desire to impact your live site, only clone your live site to a staging surroundings. If the WordPress HTTP fault is as well happening on staging, then you tin rapidly deactivate all your plugins to start narrowing information technology down.

Recall, yous won't lose any information if y'all simply deactivate a plugin. If you can all the same 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
Conciliate all plugins

If this fixes the consequence you'll need to notice the culprit. Showtime activating them one by i, and attempt uploading an paradigm again in the media library. When you run across the HTTP error render, you've found the misbehaving plugin. You can then achieve out to the plugin programmer for help or post a support ticket in the WordPress repository.

If you can't access WordPress admin you tin can FTP into your server and rename your plugins folder to something like plugins_old. Then bank check your site once more. If information technology works, then yous will need to test each plugin ane by ane. Rename your plugin folder dorsum to plugins and then rename each plugin folder inside of if information technology, one by one, until yous find it. You could likewise endeavor 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 nosotros've seen some weird setups. It never hurts to try switching your theme over to the default 20 Seventeen theme to see if it fixes it. Only like with plugins, y'all 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 you've tried the steps to a higher place already and are still getting the WordPress HTTP mistake, we recommend reaching out to your WordPress host for assistance before proceeding. Many of the additional troubleshooting steps are a little more advanced and a lot of times you lot tin can inquire your host to do or check on this for y'all.

Kinsta'south support team is bachelor 24×seven from the lesser right-hand side of the MyKinsta dashboard.

Kinsta WordPress hosting support
Kinsta WordPress hosting back up

6. Increase PHP Memory Limit

Another cause for the WordPress HTTP error is that your server lacks the available memory for the background upload process to complete successfully. This is a very mutual trouble with shared WordPress hosting. To fix it you need to increase the corporeality of retention PHP can employ.256 MB is recommended.

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

Increment PHP Memory Limit with wp-config.php

You can increase the PHP retention limit by calculation the post-obit code to your wp-config.php file. Note: this may exist overwritten by a server-level rule in place by your WordPress host.

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

Increment PHP Memory Limit in cPanel

If your host is using cPanel, you can increment the PHP retention limit in two dissimilar areas.

The kickoff is under the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." Yous tin then click on "memory_limit" to change its value.

The second area is also nether the software section. Click on the "MultiPHP INI Editor" tool. This allows you lot to modify the php.ini file. Only coil down to where it says "memory_limit" and input a higher value.

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

Increase PHP Memory Limit with php.ini

Subscribe Now

If you aren't using cPanel, you can too edit the php.ini file directly if you have access. To do this, login to your site via FTP or SSH, go to your site'south root directory and open or create a php.ini file.

Tin can't connect via SSH? Learn 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 besides require that y'all add the suPHP directive in your .htaccess file for the to a higher place php.ini file settings to work. To do this, edit your .htaccess file, as well located at the root of your site, and add the post-obit code towards the acme 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 subconscious file that contains various settings you can utilise to modify the server behavior, right downward to a directory specific level. If yous don't have access to php.ini, nosotros propose you attempt 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 in that location.

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

seven. Bank check Uploads Folder Permissions

Typically when there is a folder permissions error you should go a message in WordPress about it non existence able to write to the directory. However, this might not always exist the case. If a WordPress site has been hacked or infected with malware, there could be a lot of issues going on with the permissions. 

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

The master folder you're concerned with is your /wp-content/uploads binder, 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.

Y'all can easily see your folder permissions with an FTP client (as seen below). You could also reach out to your WordPress host support squad and inquire 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 cheque both the "Recurse into subdirectories" option also every bit the "Apply to directories only."

WordPress uploads directory permissions
WordPress uploads directory permissions

eight. Move to the Latest Version of PHP

WordPress officially recommends PHP vii.3 or higher. If y'all're not running on that, you lot're below the minimum requirements set up past the developers of the CMS. 😮

We ever recommend running the latest and supported versions of PHP due to the fact information technology offers better security and performance, including bug fixes and functions that need to be deprecated.

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

Change to PHP 7.4
Alter to PHP seven.iv

If your host uses cPanel they might already have an option available to you to modify 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 and then select the PHP versions available to yous that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Fix Performance Bug with Imagick and Shared Hosts

There are two different PHP modules WordPress uses for image 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 take a lot of hidden resource throttling behind the scenes. That is the only way they can cram so many users on the same machine. A mutual consequence people run into is that there are too few resources allocated to Imagick (ImageMagick). Hosts volition limit the ability to use multiple threads, hence resulting in the WordPress HTTP error.

Yous can add together the following lawmaking to the top of your .htaccess file, changing the thread limit value to something higher.

MAGICK_THREAD_LIMIT 1

Another option you take is to tell WordPress to use the GD library instead of Imagick. You tin can do this by simply adding the post-obit code to your theme's functions.php file.

          role 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 similar this it'south time to move to a new WordPress host. Kinsta doesn't have crazy limits similar this in place and for the almost part, you're only limited past PHP workers. You shouldn't accept to worry about these types of things equally a website possessor.

We employ 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 not shared between anyone else or even your own sites.

Read more about how Kinsta is different than any 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. Nosotros typically see this when users migrate their local development site over to product. If you expect in "Media" under "Settings" in your WordPress dashboard and see a file path value listed, get alee and delete it and click "Save Changes." You want your media to be stored in the default /wp-content/uploads folder.

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

WordPress media settings
WordPress media settings

eleven. 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 past adding the following code to the peak of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

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

Disable mod_security
Disable mod_security

We ever recommend using an enterprise-grade and yet 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 but not least, if you're really in a bind and nothing else seems to be working, you can install the free Add From Server plugin. Perhaps you lot're waiting for a response from your WordPress host or a programmer 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 be a good temporarily fix, especially if you lot're correct in the heart of something of import. It was originally developed to let you to add very large files via SFTP.Important: this plugin is no longer maintained or supported. Use at your own risk.

Summary

As you can encounter there are quite a few different ways to set the WordPress HTTP fault. Hopefully i of the solutions to a higher place worked for you and you're already dorsum on rail and uploading your media. If you lot continue to receive this fault time and time again, it might be time to consider upgrading to a ameliorate WordPress host. Many of the solutions above are things y'all don't have to worry nigh at Kinsta.

If you plant a solution that isn't in our list, delight get out a annotate a below and we'll get it added.


Relieve time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more, in 1 plan with no long-term contracts, assisted migrations, and a 30-mean solar day-money-dorsum-guarantee. Check out our plans or talk to sales to observe the plan that's correct for you.