As with any platform, there are always those abrasive errors or problems you have to acquire how to piece of work through. Trust united states, nosotros've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. 😉 But we all the same love information technology! Today we're going to swoop 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 fault is usually piece of cake to prepare information technology can be rather frustrating as information technology usually interrupts your workflow. Null is worse than spending 20 minutes trying to detect that perfect image for your blog mail, you lot go to upload it, and bam, you lot're all of a sudden met with a very vague error.

Below nosotros'll explore why this mistake happens and what you tin can practise to chop-chop resolve it so you tin can get back to uploading your media.

What is the WordPress HTTP Error?

The WordPress HTTP error occurs when something goes incorrect while attempting to upload images or videos using the built-in media library tool. Unfortunately, unlike browser errors where we tin ordinarily reference an HTTP status code, WordPress errors are sometimes a little harder to troubleshoot (particularly if you don't know how to enable WordPress debugging mode).

The very vague "HTTP error" definitely doesn't help you determine what might exist incorrect or fifty-fifty where to start looking. But that is because there could be a few causes for the failure and WordPress simply doesn't know why, then it spits out a generic error bulletin (as seen below).

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

How to Gear up the WordPress HTTP Mistake

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

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

  1. Refresh the Page
  2. Compress or Resize the File
  3. Rename the Image File
  4. Temporarily Deactivate 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. 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 first thing you should do when encountering the WordPress HTTP error is to simply refresh the page in your browser. Sounds too piece of cake correct? 😉 Well, really this is the most common ready nosotros've seen for it. Here'southward why:

Starting time, for whatever reason, your browser might take 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 refresh the page and try uploading over again it the error sometimes will resolve itself.

2nd, we've too seen that sometimes after refreshing the folio, or coming back to the WordPress editor from some other tab, that it all of a sudden kicks y'all out. This is most likely an indicator that your WordPress login session has expired. You should run into the following message:

Your session has expired. Delight log in to continue where y'all left off.

Your session has expired
Your session has expired

And so naturally, you lot log dorsum in and effort to upload your media again. Even so, the HTTP error occurs. This is kind of a quirk with WordPress. Once you lot log back in, you need to really manually refresh the page you're on. Then uploading media volition work 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/height (pixels). We recommend checking out our in-depth post on how to optimize images for the web. There are a lot of third-party image optimization plugins you can employ to automatically do this for y'all (both reducing and resizing) when your paradigm is uploaded to the media library.

We accept used Imagify on our Kinsta site for years without a single consequence. But at that place are a lot of other peachy ones out at that place likewise. But make sure whichever plugin y'all use, that they are optimizing images on their own servers, not locally. If you're bulk optimizing images locally this can drastically impairment your site's functioning.

Imagify WordPress plugin
Imagify WordPress plugin

It's OK to upload loftier-resolution images as WordPress supports responsive images out of the box. In fact, you volition probably want to then that the image looks well-baked on retina displays. But unless your a photographer or concern that needs high-resolution images a good dominion of thumb though is to go along your final image size under 100 KB and no more than double the size of your website's content div width.

Too, you might have to play with the PNG and JPG file types. Sometimes 1 tin can be much larger than the other depending on what type of prototype it 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 Image File

It tin can never hurt to effort and rename the image file. WordPress should automatically append a number on the end if y'all endeavor to upload a duplicate file name, but in case that doesn't work, endeavor renaming your file. Unfortunately, WordPress doesn't let y'all rename the file of an already uploaded epitome file, so you will need to rename it locally and re-upload it.

When we are uploading images that already be we typically add a -i or -two on the end (instance: paradigm-file-one.png, prototype-file-ii.png). Make certain to add the dash otherwise Google will read it as one word and it could hurt your SEO.

Also, 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. You tin see in this example below on the Kinsta Japanese site, we are using English for the file names, not the special characters. While WordPress can technically support these, in that location 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 Deactivate Plugins and Themes

It's always a expert 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 trouble. A few plugins that are are typical culprits include paradigm optimization plugins (they tie directly into the media library) and security plugins such every bit WordFence (these plugins are sometimes too restrictive). Or you can simply delete your WordPress theme.

If you lot don't desire to affect your alive site, just clone your live site to a staging environment. If the WordPress HTTP error is also happening on staging, so y'all can chop-chop deactivate all your plugins to start narrowing it downwards.

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

Deactivate all plugins
Conciliate all plugins

If this fixes the effect yous'll demand to find the culprit. Starting time activating them one past one, and effort uploading an image again in the media library. When you encounter the HTTP fault return, you lot've constitute the misbehaving plugin. You can then reach out to the plugin programmer for help or post a support ticket in the WordPress repository.

If you can't access WordPress admin you can FTP into your server and rename your plugins binder to something like plugins_old. Then check your site over again. If information technology works, then y'all volition need to test each plugin one by one. Rename your plugin folder back to plugins and and so rename each plugin folder inside of if it, ane by one, until you notice 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. It never hurts to endeavor switching your theme over to the default Twenty Seventeen theme to run 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 you lot've tried the steps in 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 niggling more advanced and a lot of times you can enquire your host to do or cheque on this for you.

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

Kinsta WordPress hosting support
Kinsta WordPress hosting back up

6. Increase PHP Memory Limit

Another crusade for the WordPress HTTP mistake is that your server lacks the available memory for the background upload process to consummate successfully. This is a very common problem with shared WordPress hosting. To set up it you demand to increase the amount of retention PHP can use.256 MB is recommended.

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

Increment PHP Retentiveness Limit with wp-config.php

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

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

Increase PHP Retentiveness Limit in cPanel

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

The first is nether the software department. Click on "Select PHP Version." Click on "Switch to PHP Options." You can 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 you to modify the php.ini file. Simply scroll downwards to where it says "memory_limit" and input a higher value.

Increase PHP memory limit in cPanel
Increase PHP retention limit in cPanel

Increment PHP Memory Limit with php.ini

Subscribe Now

If you aren't using cPanel, yous can also edit the php.ini file directly if you accept access. To exercise this, login to your site via FTP or SSH, get to your site's root directory and open up or create a php.ini file.

Tin can't connect via SSH? Larn how to fix the SSH "Connection Refused" fault.

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 the suPHP directive in your .htaccess file for the above php.ini file settings to work. To practice this, edit your .htaccess file, likewise located at the root of your site, and add the following code towards the top of the file:

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

Increment PHP Memory Limit with .htaccess

The .htaccess file is a special hidden file that contains various settings you can utilise to modify the server beliefs, correct down to a directory specific level. If you don't take access to php.ini, we suggest you try this adjacent. Get-go, 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 tin can edit that file to and alter the "php_value memory_limit" value.

7. Bank check Uploads Binder Permissions

Typically when there is a folder permissions error you lot should get a message in WordPress about information technology 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, there could be a lot of bug going on with the permissions. 

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

The master 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.

Co-ordinate to the WordPress Codex, all directories should exist 755 (drwxr-xr-x) or 750.

You can easily meet your folder permissions with an FTP client (as seen below). You 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 properly.

Make sure that if you manually update the permissions on this binder that you check both the "Recurse into subdirectories" option every bit well as the "Utilise to directories only."

WordPress uploads directory permissions
WordPress uploads directory permissions

8. Move to the Latest Version of PHP

WordPress officially recommends PHP vii.3 or higher. If you lot're not running on that, yous're beneath the minimum requirements set by the developers of the CMS. 😮

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

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

Change to PHP 7.4
Change to PHP vii.iv

If your host uses cPanel they might already have an choice available to you lot to change 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

Yous tin can and so select the PHP versions available to you that your host supports.

php 7 cpanel
PHP vii in cPanel

9. Prepare Performance Issues with Imagick and Shared Hosts

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

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

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

MAGICK_THREAD_LIMIT one

Some other pick you lot have is to tell WordPress to use the GD library instead of Imagick. You can do this by simply adding the post-obit lawmaking to your theme's functions.php file.

          function wpb_image_editor_default_to_gd( $editors ) { $gd_editor = 'WP_Image_Editor_GD'; $editors = array_diff( $editors, assortment( $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 you're having to tweak things like this it's fourth dimension to move to a new WordPress host. Kinsta doesn't have crazy limits like this in place and for the most part, you lot're simply limited by PHP workers. You shouldn't accept to worry most these types of things equally a website owner.

We use 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 resource are 100% individual and are not shared between anyone else or even your ain sites.

Read more about how Kinsta is unlike than any other host you'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 come across this when users drift their local development site over to production. If you await in "Media" under "Settings" in your WordPress dashboard and meet a file path value listed, get ahead and delete it and click "Salvage Changes." Yous desire your media to exist stored in the default /wp-content/uploads folder.

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

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 mistake to occur. You can disable mod_security by adding the following code to the pinnacle of your .htaccess file.

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

If you're using cPanel, y'all can besides disable information technology by clicking into "ModSecurity" in the "Security" department.

cPanel ModSecurity
cPanel ModSecurity

And then toggle the status from "On" to "Off" adjacent to the domain you want to disable information technology on.

Disable mod_security
Disable mod_security

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

12. Install the Add From Server Plugin

Final only non to the lowest degree, if y'all're really in a bind and nothing else seems to be working, you tin can install the gratuitous Add From Server plugin. Perhaps y'all'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 commonly go you effectually the error and could be a practiced temporarily fix, especially if you're right in the middle of something important. Information technology was originally adult to allow you to add together very large files via SFTP.Important: this plugin is no longer maintained or supported. Apply at your own risk.

Summary

As yous tin meet in that location are quite a few different ways to set the WordPress HTTP error. Hopefully i of the solutions above worked for yous and you're already back on runway and uploading your media. If you continue 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 take to worry about at Kinsta.

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


Salve fourth dimension, costs and maximize site operation with:

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

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