As with any platform, there are always those annoying errors or bug y'all take to acquire how to work through. Trust usa, we've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. 😉 But we nevertheless love it! Today nosotros're going to dive into ane 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 fault is unremarkably like shooting fish in a barrel to set it can be rather frustrating as it unremarkably interrupts your workflow. Goose egg is worse than spending 20 minutes trying to find that perfect prototype for your blog post, yous go to upload it, and bam, y'all're suddenly met with a very vague error.

Below we'll explore why this mistake happens and what you can do to quickly resolve information technology so you tin 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, unlike browser errors where we can unremarkably reference an HTTP condition lawmaking, WordPress errors are sometimes a petty harder to troubleshoot (especially if you don't know how to enable WordPress debugging fashion).

The very vague "HTTP error" definitely doesn't help you lot decide what might be wrong or fifty-fifty where to start looking. But that is because in that location could be a few causes for the failure and WordPress simply doesn't know why, and so it spits out a generic error message (as seen below).

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

How to Fix the WordPress HTTP Error

From our experience, the WordPress HTTP error typically originates from two things: the outset is aclient-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 issue, memory list, third-party plugin, shared hosting throttling resources, etc.). So we'll dive into a petty of both.

Here are some recommendations and things to check to set the error (sorted in order by nearly common reasons we come across):

  1. Refresh the Folio
  2. Compress or Resize the File
  3. Rename the Image File
  4. Temporarily Deactivate Plugins and Theme
  5. Ask Your WordPress Host
  6. Increment 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

i. Refresh the Page

The very showtime thing you should practice when encountering the WordPress HTTP mistake is to simply refresh the folio in your browser. Sounds also piece of cake right? 😉 Well, actually this is the virtually common fix we've seen for it. Here'south why:

First, for whatsoever reason, your browser might have lost connection temporarily with WordPress and the procedure simply 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 once more it the error sometimes volition resolve itself.

2d, nosotros've also seen that sometimes subsequently 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 come across the post-obit message:

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

Your session has expired
Your session has expired

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

2. Shrink 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/height (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 can use to automatically do this for yous (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 consequence. But there are a lot of other keen ones out there besides. Only make certain whichever plugin you use, that they are optimizing images on their ain servers, not locally. If y'all're bulk optimizing images locally this can drastically harm your site'south 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 image looks well-baked on retina displays. Merely unless your a photographer or business organization that needs high-resolution images a good dominion of thumb though is to keep your final image size under 100 KB and no more than double the size of your website's content div width.

Also, you might have to play with the PNG and JPG file types. Sometimes ane 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 wait into increasing the WordPress maximum upload file size.

iii. Rename the Image File

Information technology can never hurt to try and rename the image file. WordPress should automatically append a number on the finish if you lot try to upload a duplicate file name, but in instance that doesn't work, attempt renaming your file. Unfortunately, WordPress doesn't permit you rename the file of an already uploaded paradigm file, then yous will need to rename it locally and re-upload it.

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

Likewise, to be safety, stay clear of uploading an image with file names that contain special characters. This includes international linguistic communication symbols and characters such as apostrophes. Dashes are OK. You tin see in this case below on the Kinsta Japanese site, we are using English 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 image file with no special characters

4. Temporarily Deactivate Plugins and Themes

Information technology's ever a good idea if you're having HTTP errors to attempt deactivating your plugins and fifty-fifty 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 directly into the media library) and security plugins such as WordFence (these plugins are sometimes also restrictive). Or you can only delete your WordPress theme.

If you don't want to affect your live site, just clone your alive site to a staging environment. If the WordPress HTTP error is also happening on staging, then you lot can speedily conciliate all your plugins to start narrowing it downwards.

Remember, you won't lose whatever information if y'all simply deactivate a plugin. If you can notwithstanding access your admin, a quick way to practise this is to scan 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'll demand to find the culprit. Kickoff activating them ane by one, and endeavor uploading an prototype again in the media library. When you run across the HTTP mistake render, you've constitute the misbehaving plugin. You can then reach out to the plugin developer for help or mail service a back up ticket in the WordPress repository.

If you can't access WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then check your site once again. If it works, then you will demand to examination each plugin one by one. Rename your plugin folder dorsum to plugins and and then rename each plugin folder inside of if it, one by ane, until you find it. You could also endeavor to replicate this on a staging site first.

Rename plugin folder
Rename plugin folder

The aforementioned goes for your WordPress theme. Typically themes don't necktie into the media library, but we've seen some weird setups. Information technology never hurts to effort switching your theme over to the default Xx Seventeen theme to see if it fixes it. Just like with plugins, you don't take to worry near losing your current theme settings. All of that is stored in the WordPress database.

5. Enquire Your WordPress Host

If y'all've tried the steps higher up already and are yet getting the WordPress HTTP fault, we recommend reaching out to your WordPress host for assistance earlier proceeding. Many of the additional troubleshooting steps are a lilliputian more avant-garde and a lot of times you can ask your host to exercise or check on this for you lot.

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

Kinsta WordPress hosting support
Kinsta WordPress hosting support

6. Increase PHP Retentiveness Limit

Another cause for the WordPress HTTP fault 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 fix it you need to increase the amount of memory PHP can use.256 MB is recommended.

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

Increase PHP Memory Limit with wp-config.php

You tin can increment the PHP retentivity limit by adding the following lawmaking to your wp-config.php file. Annotation: this may be overwritten by a server-level rule in place by your WordPress host.

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

Increment PHP Retention Limit in cPanel

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

The beginning is nether the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." Y'all can and then click on "memory_limit" to alter its value.

The 2d area is also under the software section. Click on the "MultiPHP INI Editor" tool. This allows you to modify the php.ini file. But whorl downwardly to where information technology 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, yous tin also edit the php.ini file directly if yous have 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? Acquire how to ready the SSH "Connection Refused" fault.

If the file was already there, search for the "memory_limit" setting and modify it equally 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 practice this, edit your .htaccess file, too located at the root of your site, and add the following code towards the summit of the file:

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

Increase PHP Memory Limit with .htaccess

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

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

seven. Check Uploads Folder Permissions

Typically when in that location is a folder permissions error you should become a bulletin in WordPress about it not being able to write to the directory. However, this might not e'er 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 gratuitous hack fixes for all clients. 😄

The main folder yous'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.

Yous can easily run into your binder 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 prepare up properly.

Make certain that if you lot manually update the permissions on this folder that y'all check both the "Recurse into subdirectories" option also as the "Employ to directories simply."

WordPress uploads directory permissions
WordPress uploads directory permissions

8. Move to the Latest Version of PHP

WordPress officially recommends PHP 7.3 or higher. If you're not 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 information technology offers better security and operation, including problems fixes and functions that need to be deprecated.

We have seen older versions of PHP contribute to all sorts of errors, including the infamous WordPress HTTP fault. At Kinsta yous can easily modify to PHP vii.four 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 selection available to you to alter your version of PHP. But 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 y'all that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Fix Performance Issues with Imagick and Shared Hosts

There are two dissimilar PHP modules WordPress uses for prototype 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 subconscious resources throttling backside the scenes. That is the only mode they can cram then many users on the same auto. A common issue people encounter is that there are besides few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to employ multiple threads, hence resulting in the WordPress HTTP error.

You can add together the following lawmaking to the summit of your .htaccess file, changing the thread limit value to something college.

MAGICK_THREAD_LIMIT 1

Another option y'all have is to tell WordPress to use the GD library instead of Imagick. You can practice this by but adding the following code to your theme'southward 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 exist blunt. If y'all're having to tweak things like this it's time to motility to a new WordPress host. Kinsta doesn't take crazy limits like this in place and for the near role, you're only limited by PHP workers. You shouldn't take to worry about these types of things as a website possessor.

Nosotros employ LXD managed hosts and orchestrated LXC software containers for each site. What this ways is that every WordPress site is housed in its ain 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 fifty-fifty your ain sites.

Read more about how Kinsta is different than whatsoever 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 yous look in "Media" under "Settings" in your WordPress dashboard and run into a file path value listed, get ahead and delete it and click "Salve Changes." You want your media to be stored in the default /wp-content/uploads folder.

Beneath is what information technology typically looks like. If yous don't see a library path, then you're all good hither.

WordPress media settings
WordPress media settings

xi. Disable mod_security

Mod_security is an open up source firewall that sometimes might cause the WordPress HTTP fault to occur. Yous can disable mod_security by adding the post-obit code to the pinnacle of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

And so toggle the status from "On" to "Off" adjacent to the domain you want to disable it on.

Disable mod_security
Disable mod_security

We always recommend using an enterprise-grade and nonetheless affordable WAF like Sucuri or Cloudflare instead. Y'all can read our recommendation for the all-time WAF settings here.

12. Install the Add From Server Plugin

Final but non least, if you're really in a bind and zippo else seems to exist working, y'all tin can install the free Add From Server plugin. Perhaps you'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 volition commonly get you around the error and could be a good temporarily set, especially if y'all're right in the middle of something important. It was originally adult to let you to add very large files via SFTP.Of import: this plugin is no longer maintained or supported. Use at your ain risk.

Summary

Equally you can come across there are quite a few unlike means to gear up the WordPress HTTP error. Hopefully one of the solutions above worked for yous and y'all're already back on track and uploading your media. If you continue to receive this error fourth dimension and time again, it might be time to consider upgrading to a better WordPress host. Many of the solutions to a higher place are things yous don't have to worry almost at Kinsta.

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


Salve time, costs and maximize site operation with:

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

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