As with any platform, there are always those annoying errors or bug you lot have to larn how to piece of 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. 😉 Merely we still love it! Today we're going to dive into one of the more common ones, theHTTP error. Users typically run across this when trying to upload images or videos to the WordPress media library.

While the HTTP fault is normally easy to fix information technology can exist rather frustrating as information technology unremarkably interrupts your workflow. Aught is worse than spending twenty minutes trying to find that perfect image for your blog mail service, you go 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 quickly resolve information technology so y'all can get back to uploading your media.

What is the WordPress HTTP Fault?

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

The very vague "HTTP error" definitely doesn't assist you determine what might be wrong or even where to showtime looking. But that is considering in that location could be a few causes for the failure and WordPress simply doesn't know why, so it spits out a generic mistake message (as seen below).

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

How to Fix the WordPress HTTP Fault

From our experience, the WordPress HTTP error typically originates from ii things: the first is aclient-side or user error (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-political party plugin, shared hosting throttling resource, etc.). And then we'll dive into a piffling of both.

Here are some recommendations and things to cheque to set up the error (sorted in order by well-nigh mutual reasons we run into):

  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 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 starting time affair you should practice when encountering the WordPress HTTP error is to simply refresh the page in your browser. Sounds also piece of cake right? 😉 Well, really this is the most common set up nosotros've seen for it. Here'south why:

First, for whatever reason, your browser might have lost connexion temporarily with WordPress and the procedure simply failed to complete. This could exist due to your ISP, a temporary hiccup with your WordPress host, etc. If you refresh the folio and try uploading once more it the error sometimes will resolve itself.

2d, we've also seen that sometimes after refreshing the page, or coming dorsum to the WordPress editor from some other tab, that it suddenly kicks you out. This is nigh likely an indicator that your WordPress login session has expired. You should see 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

So naturally, y'all log back in and attempt to upload your media once again. However, the HTTP fault occurs. This is kind of a quirk with WordPress. One time you log back in, you need to actually manually refresh the page you're on. Then uploading media will work once more.

2. Shrink or Resize the File

Yous might need to edit your image file, which could entail reducing the file size (KB or MB) or decreasing the width/peak (pixels). We recommend checking out our in-depth post on how to optimize images for the web. At that place are a lot of third-party image optimization plugins you can use to automatically do this for you (both reducing and resizing) when your image is uploaded to the media library.

We take used Imagify on our Kinsta site for years without a single effect. Just in that location are a lot of other great ones out in that location as well. Just make sure whichever plugin you use, that they are optimizing images on their own servers, not locally. If you're majority optimizing images locally this can drastically damage your site's performance.

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 will probably want to so that the image looks crisp on retina displays. Just unless your a lensman or business that needs high-resolution images a good rule of thumb though is to continue your concluding image size under 100 KB and no more double the size of your website's content div width.

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

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

3. Rename the Image File

It tin can never hurt to attempt and rename the image file. WordPress should automatically suspend a number on the end if you try to upload a duplicate file name, just in example that doesn't work, attempt renaming your file. Unfortunately, WordPress doesn't allow y'all rename the file of an already uploaded image file, so yous volition need to rename information technology locally and re-upload information technology.

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

Also, to be safe, stay articulate of uploading an image with file names that contain special characters. This includes international linguistic communication symbols and characters such every bit apostrophes. Dashes are OK. You can meet in this instance beneath 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

It's always a good idea if you're having HTTP errors to endeavor 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 tie straight into the media library) and security plugins such as WordFence (these plugins are sometimes besides restrictive). Or yous tin can simply delete your WordPress theme.

If you don't desire to bear on your alive site, simply clone your live site to a staging surround. If the WordPress HTTP error is also happening on staging, and so yous tin can quickly conciliate all your plugins to offset narrowing it downwardly.

Recollect, you lot won't lose any data if you lot just deactivate a plugin. If you tin nonetheless 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
Deactivate all plugins

If this fixes the issue you'll demand to observe the culprit. First activating them one past i, and try uploading an paradigm once again in the media library. When yous come across the HTTP mistake return, you lot've constitute the misbehaving plugin. You can then reach out to the plugin developer for aid or post a back up 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. And then cheque your site over again. If it works, and so you lot volition demand to test each plugin i past 1. Rename your plugin folder back to plugins so rename each plugin binder inside of if it, i by one, until y'all notice it. Y'all could also try to replicate this on a staging site outset.

Rename plugin folder
Rename plugin binder

The same goes for your WordPress theme. Typically themes don't tie into the media library, simply we've seen some weird setups. Information technology never hurts to endeavour switching your theme over to the default 20 Seventeen theme to see if it fixes information technology. Just like with plugins, y'all don't take to worry most 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 in a higher place already and are withal getting the WordPress HTTP error, we recommend reaching out to your WordPress host for assistance before proceeding. Many of the additional troubleshooting steps are a lilliputian more advanced and a lot of times you tin can ask your host to exercise or check on this for you lot.

Kinsta's support team is available 24×7 from the bottom right-hand 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 available memory for the background upload procedure to complete successfully. This is a very common problem with shared WordPress hosting. To prepare it you need to increase the amount of retentiveness PHP can use.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 yous shouldn't have any issues with a lack of retention. 👍

Increment PHP Retention Limit with wp-config.php

Y'all can increment the PHP memory limit by adding the following lawmaking to your wp-config.php file. Annotation: this may exist overwritten past a server-level dominion in identify by your WordPress host.

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

Increase PHP Memory Limit in cPanel

If your host is using cPanel, you tin can increase the PHP memory limit in two dissimilar areas.

The first is nether the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." You lot tin can then click on "memory_limit" to modify its value.

The 2d area is as well under the software section. Click on the "MultiPHP INI Editor" tool. This allows y'all to modify the php.ini file. Simply ringlet down to where it says "memory_limit" and input a higher value.

Increase PHP memory limit in cPanel
Increase PHP memory 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 you have access. To do this, login to your site via FTP or SSH, go to your site's root directory and open up or create a php.ini file.

Can't connect via SSH? Learn how to ready the SSH "Connectedness Refused" error.

If the file was already there, search for the "memory_limit" setting and modify information technology as 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 work. To do this, edit your .htaccess file, also located at the root of your site, and add the post-obit 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 use to modify the server behavior, right down to a directory specific level. If you don't accept access to php.ini, we suggest y'all effort this next. Start, login to your site via FTP or SSH, take a await at your root directory and run into if at that place is a .htaccess file there.

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

vii. Bank check Uploads Binder Permissions

Typically when in that location is a folder permissions error you lot should become a message in WordPress most it non being able to write to the directory. Nevertheless, this might non always be the case. If a WordPress site has been hacked or infected with malware, in that location could be a lot of issues going on with the permissions. 

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

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

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

Yous can easily see your folder permissions with an FTP client (as seen below). You could too accomplish 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 upwardly properly.

Make sure that if you lot manually update the permissions on this folder that you bank check both the "Recurse into subdirectories" option besides as 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 higher. If y'all're not running on that, you're below 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 amend security and performance, including bug fixes and functions that demand to be deprecated.

We have seen older versions of PHP contribute to all sorts of errors, including the infamous WordPress HTTP mistake. At Kinsta y'all tin can easily change to PHP 7.4 with a unmarried click in the MyKinsta dashboard.

Change to PHP 7.4
Change to PHP vii.four

If your host uses cPanel they might already accept an option bachelor to y'all to change your version of PHP. Only log in to cPanel and under the "Software" category click on "Select PHP Version."

Select PHP version
Select PHP version

You tin then select the PHP versions bachelor to you that your host supports.

php 7 cpanel
PHP 7 in cPanel

9. Fix Functioning Issues 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 utilise either i.

The problem is that shared WordPress hosts have a lot of subconscious resources throttling behind the scenes. That is the but way they can cram so many users on the same machine. A common issue people run into is that there are as well few resources allocated to Imagick (ImageMagick). Hosts will limit the power 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 higher.

MAGICK_THREAD_LIMIT 1

Another option yous take is to tell WordPress to utilize the GD library instead of Imagick. You tin practice this by simply calculation 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 ); render $editors; } add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );        

Nosotros'll be blunt. If you're having to tweak things like this it's time to motion to a new WordPress host. Kinsta doesn't have crazy limits like this in place and for the almost part, you're just express past PHP workers. You shouldn't take to worry about these types of things as a website owner.

We utilize LXD managed hosts and orchestrated LXC software containers for each site. What this means 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 resource are 100% private and are not shared between anyone else or fifty-fifty your own sites.

Read more than most how Kinsta is different than any other host you lot'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 you expect in "Media" under "Settings" in your WordPress dashboard and encounter a file path value listed, go alee and delete it and click "Relieve Changes." You want your media to exist stored in the default /wp-content/uploads binder.

Below is what it typically looks like. If you don't encounter a library path, then you lot're all adept here.

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 by adding the post-obit code to the summit of your .htaccess file.

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

If you lot're using cPanel, you 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 information technology on.

Disable mod_security
Disable mod_security

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

12. Install the Add From Server Plugin

Concluding but not to the lowest degree, if you're actually in a bind and nothing else seems to be working, you can install the free Add From Server plugin. Perchance you're waiting for a response from your WordPress host or a developer on how to go the WordPress HTTP error resolved.

Add From Server WordPress plugin
Add From Server WordPress plugin

The Add to Server plugin will usually become you lot around the error and could exist a good temporarily set up, especially if y'all're right in the centre of something important. It was originally developed to allow you to add very big files via SFTP.Important: this plugin is no longer maintained or supported. Use at your own risk.

Summary

Equally yous can see there are quite a few unlike ways to fix the WordPress HTTP error. Hopefully one of the solutions above worked for you lot and you're already back on runway and uploading your media. If yous continue to receive this error time and time again, it might be fourth dimension to consider upgrading to a ameliorate WordPress host. Many of the solutions above are things you don't have to worry nearly at Kinsta.

If you found a solution that isn't in our listing, delight leave a comment a beneath and we'll get it added.


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/seven.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 information centers worldwide.
  • Optimization with our built-in Awarding Operation Monitoring.

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