As with any platform, there are ever those abrasive errors or problems you accept to acquire how to work through. Trust us, we've pretty much seen them all! From the white screen of expiry to database connection errors, WordPress definitely has its quirks. 😉 But nosotros still love it! Today we're going to dive into one of the more common ones, theHTTP error. Users typically encounter 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 usually interrupts your workflow. Nothing is worse than spending twenty minutes trying to notice that perfect image for your blog post, you lot get to upload it, and bam, you're suddenly met with a very vague error.

Below we'll explore why this error happens and what you tin do to chop-chop resolve it and so you can go back 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 congenital-in media library tool. Unfortunately, dissimilar browser errors where we tin can usually reference an HTTP status lawmaking, WordPress errors are sometimes a fiddling harder to troubleshoot (especially if you don't know how to enable WordPress debugging way).

The very vague "HTTP error" definitely doesn't assistance you decide what might exist incorrect or even where to start looking. Merely that is considering there could be a few causes for the failure and WordPress only doesn't know why, so it spits out a generic fault message (as seen beneath).

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

How to Gear up the WordPress HTTP Error

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

Here are some recommendations and things to check to gear up the error (sorted in order by almost common reasons we run into):

  1. Refresh the Page
  2. Shrink or Resize the File
  3. Rename the Epitome File
  4. Temporarily Deactivate Plugins and Theme
  5. Inquire Your WordPress Host
  6. Increase PHP Memory Limit
  7. Check Uploads Folder Permissions
  8. Movement to the Latest Version of PHP
  9. Fix Performance Problems 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 Folio

The very showtime thing y'all should do when encountering the WordPress HTTP error is to simply refresh the page in your browser. Sounds also easy correct? 😉 Well, actually this is the nigh common fix we've seen for information technology. Here's why:

Showtime, for whatever reason, your browser might have lost connection temporarily with WordPress and the procedure simply failed to consummate. This could be due to your Internet service provider, a temporary hiccup with your WordPress host, etc. If yous refresh the folio and endeavor uploading again it the error sometimes will resolve itself.

2d, we've likewise seen that sometimes later refreshing the page, or coming back to the WordPress editor from another tab, that it all of a sudden kicks you out. This is near likely an indicator that your WordPress login session has expired. You should see the post-obit bulletin:

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

Your session has expired
Your session has expired

And so naturally, y'all log back in and try to upload your media once more. However, the HTTP fault occurs. This is kind of a quirk with WordPress. In one case yous log back in, you demand to actually manually refresh the page you're on. So uploading media will work over again.

2. Shrink or Resize the File

You might need to edit your epitome file, which could entail reducing the file size (KB or MB) or decreasing the width/summit (pixels). We recommend checking out our in-depth post on how to optimize images for the web. At that place are a lot of 3rd-party prototype optimization plugins you can employ to automatically practice 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 effect. Merely there are a lot of other great ones out at that place as well. Only make sure whichever plugin y'all apply, that they are optimizing images on their own servers, not locally. If you're bulk optimizing images locally this tin can drastically harm your site's performance.

Imagify WordPress plugin
Imagify WordPress plugin

It's OK to upload high-resolution images equally WordPress supports responsive images out of the box. In fact, y'all will probably want to so that the image looks crisp on retina displays. But unless your a photographer or business that needs high-resolution images a good rule of thumb though is to continue your final image size under 100 KB and no more double the size of your website's content div width.

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

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

3. Rename the Image File

It can never hurt to endeavor and rename the image file. WordPress should automatically append a number on the end if you endeavour to upload a indistinguishable file name, only in example that doesn't work, endeavour renaming your file. Unfortunately, WordPress doesn't let you lot rename the file of an already uploaded epitome file, so you will need to rename information technology locally and re-upload information technology.

When we are uploading images that already exist we typically add a -one or -2 on the end (example: image-file-one.png, prototype-file-two.png). Brand sure to add the dash otherwise Google will read it as 1 word and it could hurt your SEO.

Also, to be rubber, stay clear of uploading an image with file names that comprise special characters. This includes international language symbols and characters such every bit apostrophes. Dashes are OK. Yous can see in this example below on the Kinsta Japanese site, nosotros are using English for the file names, not the special characters. While WordPress tin can technically back up these, at that place are a lot of other problems 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 good idea 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 image optimization plugins (they tie straight into the media library) and security plugins such as WordFence (these plugins are sometimes too restrictive). Or you can but delete your WordPress theme.

If you lot don't desire to affect your live site, simply clone your live site to a staging environment. If the WordPress HTTP fault is also happening on staging, and so you can speedily deactivate all your plugins to start narrowing it down.

Think, you won't lose any information if you but deactivate a plugin. If y'all can however access your admin, a quick way to do this is to browse to "Plugins" and select "Conciliate" from the majority deportment carte du jour. This volition disable all of your plugins.

Deactivate all plugins
Deactivate all plugins

If this fixes the event you'll demand to notice the culprit. Kickoff activating them one by one, and try uploading an prototype again in the media library. When y'all see the HTTP mistake return, y'all've constitute the misbehaving plugin. Yous can then reach out to the plugin programmer for aid or post a support ticket in the WordPress repository.

If you can't admission WordPress admin you lot can FTP into your server and rename your plugins binder to something like plugins_old. So cheque your site again. If it works, then you lot will demand to exam 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 i, until you find information technology. You could besides effort 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 try switching your theme over to the default Xx Seventeen theme to run into if it fixes information technology. Just similar with plugins, you lot don't have to worry about losing your current theme settings. All of that is stored in the WordPress database.

v. Ask Your WordPress Host

If yous've tried the steps in 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 boosted troubleshooting steps are a little more avant-garde and a lot of times you can enquire your host to exercise or bank check on this for you.

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

Kinsta WordPress hosting support
Kinsta WordPress hosting support

six. Increase PHP Memory Limit

Another cause for the WordPress HTTP error is that your server lacks the bachelor memory for the background upload process to complete successfully. This is a very common problem with shared WordPress hosting. To gear up it y'all demand to increment the amount of memory PHP can utilize.256 MB is recommended.

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

Increase PHP Memory Limit with wp-config.php

Y'all tin can increment the PHP memory limit by calculation the post-obit code to your wp-config.php file. Annotation: this may be overwritten past a server-level rule in place by your WordPress host.

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

Increase PHP Retentivity Limit in cPanel

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

The start 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 2nd expanse is too nether the software section. Click on the "MultiPHP INI Editor" tool. This allows you to modify the php.ini file. Merely ringlet 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 Memory Limit with php.ini

Subscribe Now

If you aren't using cPanel, you can also edit the php.ini file directly if y'all take admission. 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.

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 information technology equally necessary.

Some shared hosts might also require that y'all add the suPHP directive in your .htaccess file for the above php.ini file settings to piece of work. To do this, edit your .htaccess file, also located at the root of your site, and add together the following code towards the top of the file:

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

Increase PHP Retentiveness Limit with .htaccess

The .htaccess file is a special subconscious file that contains various settings you lot tin can use to change the server behavior, correct downwardly to a directory specific level. If you don't have admission to php.ini, we propose you try this side by side. First, login to your site via FTP or SSH, take a await at your root directory and see if at that place is a .htaccess file there.

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

7. Check Uploads Binder Permissions

Typically when there is a folder permissions error you should get a message in WordPress near it not beingness able to write to the directory. Even so, this might not e'er exist the example. If a WordPress site has been hacked or infected with malware, in that location could exist a lot of bug going on with the permissions. 

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

The main binder you lot'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 exist 755 (drwxr-xr-x) or 750.

You tin can easily see your folder permissions with an FTP client (as 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 yous manually update the permissions on this folder that you bank check both the "Recurse into subdirectories" option also every bit the "Apply to directories only."

WordPress uploads directory permissions
WordPress uploads directory permissions

viii. Move to the Latest Version of PHP

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

Nosotros always recommend running the latest and supported versions of PHP due to the fact information technology offers better security and performance, including problems fixes and functions that demand to be deprecated.

We accept 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 seven.4 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 pick available to you to alter 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 lot can then select the PHP versions bachelor to y'all that your host supports.

php 7 cpanel
PHP 7 in cPanel

nine. Set Performance Issues with Imagick and Shared Hosts

At that place 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 accept a lot of hidden resource throttling behind the scenes. That is the only way they tin cram so many users on the same machine. A common effect people run across is that there are likewise few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to use multiple threads, hence resulting in the WordPress HTTP error.

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

MAGICK_THREAD_LIMIT one

Another choice you lot accept is to tell WordPress to use the GD library instead of Imagick. You tin practise this by simply calculation the post-obit lawmaking to your theme'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 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 have crazy limits like this in place and for the most office, you're but express past PHP workers. You lot shouldn't take to worry about these types of things as a website owner.

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 resource 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 than about how Kinsta is different 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 come across this when users drift their local evolution site over to production. If you expect in "Media" under "Settings" in your WordPress dashboard and run into a file path value listed, get ahead and delete it and click "Save Changes." You want your media to exist stored in the default /wp-content/uploads folder.

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 up source firewall that sometimes might cause the WordPress HTTP error to occur. You tin can disable mod_security by calculation the following code to the elevation of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

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

Disable mod_security
Disable mod_security

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

12. Install the Add From Server Plugin

Last merely not least, if you're really in a bind and zip else seems to be working, you tin can install the free Add From Server plugin. Mayhap you lot're waiting for a response from your WordPress host or a developer on how to get the WordPress HTTP error resolved.

Add From Server WordPress plugin
Add together From Server WordPress plugin

The Add to Server plugin will unremarkably get you around the error and could be a good temporarily set, especially if you're right in the middle of something important. 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

Equally you can see there are quite a few different ways to fix the WordPress HTTP fault. Hopefully one of the solutions above worked for you and you're already dorsum on track and uploading your media. If y'all proceed to receive this error time and time again, it might be time to consider upgrading to a better WordPress host. Many of the solutions above are things you don't accept to worry nigh at Kinsta.

If you lot found a solution that isn't in our list, please leave a comment a below and nosotros'll get information technology added.


Salve time, costs and maximize site performance with:

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

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