As with any platform, there are always those annoying errors or problems you take to larn how to work through. Trust u.s.a., we've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. 😉 But we withal love it! Today we're going to dive into 1 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 error is normally easy to ready it can be rather frustrating equally information technology unremarkably interrupts your workflow. Zip is worse than spending twenty minutes trying to find that perfect image for your blog mail service, y'all go to upload it, and bam, you lot're all of a sudden met with a very vague fault.

Below we'll explore why this error happens and what you tin can exercise to rapidly resolve it so you can get back to uploading your media.

What is the WordPress HTTP Error?

The WordPress HTTP mistake 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 can commonly reference an HTTP status code, WordPress errors are sometimes a trivial harder to troubleshoot (especially if you don't know how to enable WordPress debugging way).

The very vague "HTTP error" definitely doesn't help you determine what might exist wrong or even where to outset looking. But that is because there could exist a few causes for the failure and WordPress simply doesn't know why, then information technology 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 mistake typically originates from two things: the first is aclient-side or user fault (your login session, bad characters in the file name, etc.), and the second is aproblem or setting on your WordPress host(server issue, retention list, third-party plugin, shared hosting throttling resources, etc.). And so nosotros'll swoop into a little of both.

Hither are some recommendations and things to check to set the error (sorted in club by almost mutual reasons we see):

  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. Increment PHP Memory Limit
  7. Check Uploads Folder Permissions
  8. Motion to the Latest Version of PHP
  9. Fix Functioning 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 yous should do when encountering the WordPress HTTP error is to simply refresh the page in your browser. Sounds too easy right? 😉 Well, actually this is the most mutual fix nosotros've seen for it. Here'south why:

First, for any reason, your browser might take lost connection temporarily with WordPress and the process 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 attempt uploading over again information technology the mistake sometimes will resolve itself.

Second, we've likewise seen that sometimes later refreshing the page, or coming back to the WordPress editor from another tab, that it suddenly kicks y'all out. This is most probable an indicator that your WordPress login session has expired. You should run across the following bulletin:

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

Your session has expired
Your session has expired

So naturally, you log dorsum in and try to upload your media again. However, the HTTP fault occurs. This is kind of a quirk with WordPress. Once you lot log back in, you demand to actually manually refresh the folio you're on. Then uploading media volition work once more.

2. Compress or Resize the File

You might demand 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 mail service on how to optimize images for the spider web. In that location are a lot of tertiary-party epitome optimization plugins you lot tin utilize to automatically do this for y'all (both reducing and resizing) when your image is uploaded to the media library.

Nosotros take used Imagify on our Kinsta site for years without a single issue. But there are a lot of other cracking ones out there besides. Just make sure whichever plugin you utilise, that they are optimizing images on their own servers, not locally. If you're bulk optimizing images locally this can drastically harm your site'southward operation.

Imagify WordPress plugin
Imagify WordPress plugin

Information technology'south OK to upload high-resolution images every bit WordPress supports responsive images out of the box. In fact, you will probably desire to so that the paradigm looks crisp on retina displays. But unless your a photographer or concern that needs high-resolution images a proficient rule of thumb though is to keep your final image size under 100 KB and no more than double the size of your website'due south content div width.

Also, you might have to play with the PNG and JPG file types. Sometimes one can exist much larger than the other depending on what type of image it is.

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

3. Rename the Epitome File

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

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

Likewise, to be condom, stay clear of uploading an paradigm with file names that incorporate special characters. This includes international language symbols and characters such as apostrophes. Dashes are OK. You tin run across 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 problems that tin can pop up.

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

4. Temporarily Deactivate Plugins and Themes

It'south e'er a good thought 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 image optimization plugins (they tie directly into the media library) and security plugins such as WordFence (these plugins are sometimes too restrictive). Or you can simply delete your WordPress theme.

If y'all don't want to affect your live site, just clone your alive site to a staging environs. If the WordPress HTTP mistake is besides happening on staging, then y'all can quickly conciliate all your plugins to start narrowing information technology down.

Remember, you won't lose any data if you simply conciliate a plugin. If you tin still access your admin, a quick way to exercise 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 issue yous'll need to find the culprit. Commencement activating them one by i, and try uploading an image over again in the media library. When you see the HTTP error render, you've establish the misbehaving plugin. You tin can and then accomplish out to the plugin programmer for help or mail a back up ticket in the WordPress repository.

If you lot can't admission WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then cheque your site over again. If it works, then y'all will need to test each plugin one by i. Rename your plugin folder back to plugins so rename each plugin folder within of if it, one past one, until you lot find it. You lot could also 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 tie into the media library, just nosotros've seen some weird setups. It never hurts to try switching your theme over to the default Twenty Seventeen theme to come across if it fixes it. Just like with plugins, you don't have to worry virtually losing your electric current theme settings. All of that is stored in the WordPress database.

v. Ask Your WordPress Host

If you've tried the steps above already and are still getting the WordPress HTTP fault, nosotros recommend reaching out to your WordPress host for aid before proceeding. Many of the boosted troubleshooting steps are a little more advanced and a lot of times y'all can ask your host to exercise or cheque on this for you.

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

Kinsta WordPress hosting support
Kinsta WordPress hosting support

6. Increase PHP Memory Limit

Another crusade for the WordPress HTTP fault 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 fix information technology yous need to increase the corporeality of memory PHP tin can use.256 MB is recommended.

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

Increase PHP Memory Limit with wp-config.php

You can increase the PHP memory limit past adding the post-obit code to your wp-config.php file. Note: this may be overwritten past a server-level rule in place past your WordPress host.

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

Increase PHP Memory Limit in cPanel

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

The start is under the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." You tin can and then click on "memory_limit" to change its value.

The second area is as well under the software section. Click on the "MultiPHP INI Editor" tool. This allows you to modify the php.ini file. Simply scroll downward to where it says "memory_limit" and input a higher value.

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

Increase PHP Memory Limit with php.ini

Subscribe Now

If y'all aren't using cPanel, you tin also edit the php.ini file straight if yous have access. To practise this, login to your site via FTP or SSH, go to your site'south root directory and open up or create a php.ini file.

Can't connect via SSH? Learn how to prepare the SSH "Connection Refused" fault.

If the file was already there, search for the "memory_limit" setting and alter it equally necessary.

Some shared hosts might also crave that you 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, also located at the root of your site, and add together the post-obit code towards the top 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 tin use to modify the server behavior, right downwards to a directory specific level. If yous don't have admission to php.ini, we suggest you try this next. First, login to your site via FTP or SSH, take a await at your root directory and see if there is a .htaccess file there.

If in that location is y'all can edit that file to and alter the "php_value memory_limit" value.

seven. Check Uploads Folder Permissions

Typically when at that place is a folder permissions error yous should get a message in WordPress about it not being able to write to the directory. Still, this might non e'er be the case. If a WordPress site has been hacked or infected with malware, at that place could be a lot of issues going on with the permissions. 

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

The main folder you're concerned with is your /wp-content/uploads folder, equally this is where files are stored when uploaded via the media library.

According to the WordPress Codex, all directories should exist 755 (drwxr-xr-ten) or 750.

You can easily see your folder permissions with an FTP customer (as seen below). Yous could also achieve out to your WordPress host back up team and ask them to quickly GREP file permissions on your folders and files to ensure they're set up up properly.

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

WordPress uploads directory permissions
WordPress uploads directory permissions

8. Move to the Latest Version of PHP

WordPress officially recommends PHP seven.3 or higher. If you're non running on that, y'all're beneath the minimum requirements set 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 operation, including issues 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 mistake. At Kinsta you can hands modify to PHP 7.4 with a single click in the MyKinsta dashboard.

Change to PHP 7.4
Change to PHP 7.4

If your host uses cPanel they might already have an option available to y'all to modify 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 can and so select the PHP versions available to y'all that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Fix Functioning Problems with Imagick and Shared Hosts

In that location are ii unlike PHP modules WordPress uses for image processing: GD Library and Imagick (ImageMagick). Depending on what is installed on your server, WordPress may apply either 1.

The problem is that shared WordPress hosts have a lot of subconscious resource throttling backside the scenes. That is the only way they can cram so many users on the same auto. A common upshot people see is that there are as well few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to utilise multiple threads, hence resulting in the WordPress HTTP error.

Y'all can add the following code to the top of your .htaccess file, irresolute the thread limit value to something higher.

MAGICK_THREAD_LIMIT 1

Another option you have is to tell WordPress to use the GD library instead of Imagick. You can practice this by simply adding the following code 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 ); render $editors; } add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );        

We'll be edgeless. If you're having to tweak things similar this it's time to move to a new WordPress host. Kinsta doesn't have crazy limits like this in identify and for the nigh role, you lot're only express by PHP workers. Yous shouldn't have to worry virtually these types of things as a website possessor.

We utilize 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 resources required to run information technology (Linux, Nginx, PHP, MySQL). The resources are 100% individual 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 run into this when users drift their local development site over to product. If you wait in "Media" under "Settings" in your WordPress dashboard and run into a file path value listed, get ahead and delete information technology and click "Save Changes." You want your media to exist stored in the default /wp-content/uploads folder.

Beneath is what information technology typically looks like. If you lot don't come across a library path, so y'all're all good here.

WordPress media settings
WordPress media settings

11. Disable mod_security

Mod_security is an open source firewall that sometimes might cause the WordPress HTTP mistake to occur. You tin can disable mod_security past adding the following code to the top of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

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

Disable mod_security
Disable mod_security

Nosotros always recommend using an enterprise-class and yet affordable WAF like Sucuri or Cloudflare instead. You lot can read our recommendation for the all-time WAF settings here.

12. Install the Add From Server Plugin

Last simply not least, if yous're really in a bind and nil else seems to be working, you lot can install the free Add From Server plugin. Perhaps yous'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 From Server WordPress plugin

The Add to Server plugin volition unremarkably become you around the error and could be a practiced temporarily fix, peculiarly if you're right in the middle of something important. It was originally developed to allow yous to add very big files via SFTP.Important: this plugin is no longer maintained or supported. Use at your own adventure.

Summary

Every bit y'all can see there are quite a few different ways to set the WordPress HTTP error. Hopefully one of the solutions above worked for you and you're already back on track and uploading your media. If you lot proceed to receive this error fourth dimension and time once more, information technology might exist time to consider upgrading to a meliorate WordPress host. Many of the solutions higher up are things you lot don't take to worry about at Kinsta.

If yous establish a solution that isn't in our list, please go out a comment a below and we'll get it added.


Relieve time, costs and maximize site performance with:

  • Instant assist 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 ane plan with no long-term contracts, assisted migrations, and a 30-mean solar day-coin-back-guarantee. Bank check out our plans or talk to sales to detect the programme that's correct for you lot.