As with any platform, there are ever those annoying errors or bug you have to learn how to work through. Trust united states of america, we've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. 😉 But nosotros still love information technology! Today we're going to swoop into one of the more mutual ones, theHTTP error. Users typically meet this when trying to upload images or videos to the WordPress media library.

While the HTTP fault is usually easy to fix it can be rather frustrating equally information technology usually interrupts your workflow. Nothing is worse than spending xx minutes trying to find that perfect paradigm for your blog mail service, you become 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 yous tin can get 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 built-in media library tool. Unfortunately, unlike browser errors where nosotros tin can usually reference an HTTP status lawmaking, WordPress errors are sometimes a little harder to troubleshoot (especially if you lot don't know how to enable WordPress debugging fashion).

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

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

How to Prepare the WordPress HTTP Fault

From our experience, the WordPress HTTP error typically originates from two things: the first is aclient-side or user error (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.). Then we'll dive into a piddling of both.

Here are some recommendations and things to bank check to fix the error (sorted in order by near common reasons we meet):

  1. Refresh the Folio
  2. Compress or Resize the File
  3. Rename the Prototype File
  4. Temporarily Deactivate Plugins and Theme
  5. Ask Your WordPress Host
  6. Increment PHP Memory Limit
  7. Bank check Uploads Binder Permissions
  8. Movement to the Latest Version of PHP
  9. Gear up 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 exercise when encountering the WordPress HTTP error is to merely refresh the page in your browser. Sounds besides easy right? 😉 Well, actually this is the most common fix nosotros've seen for it. Here'due south why:

Outset, for whatever reason, your browser might have lost connexion temporarily with WordPress and the process simply failed to consummate. 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 again it the error sometimes will resolve itself.

2nd, 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 most likely an indicator that your WordPress login session has expired. Y'all should see the following message:

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

Your session has expired
Your session has expired

And so naturally, you log dorsum in and try to upload your media again. Yet, the HTTP error occurs. This is kind of a quirk with WordPress. Once you log back in, you need to actually manually refresh the page you're on. Then uploading media will work again.

two. Shrink or Resize the File

Y'all might demand to edit your paradigm 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. There are a lot of third-party epitome optimization plugins yous can use to automatically do this for you (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 bang-up ones out there likewise. Just make certain whichever plugin y'all use, that they are optimizing images on their ain servers, not locally. If you lot're bulk optimizing images locally this can drastically harm your site's performance.

Imagify WordPress plugin
Imagify WordPress plugin

It's OK to upload high-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. But unless your a photographer or business 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 i can be much larger than the other depending on what blazon of epitome it is.

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

3. Rename the Image File

It tin can never hurt to try and rename the image file. WordPress should automatically append a number on the stop if you try to upload a duplicate file proper name, but in example that doesn't work, try renaming your file. Unfortunately, WordPress doesn't let you rename the file of an already uploaded image file, and then you will need to rename it locally and re-upload it.

When we are uploading images that already exist we typically add a -i or -2 on the terminate (example: paradigm-file-1.png, prototype-file-ii.png). Make sure to add the dash otherwise Google will read it as i word and it could injure your SEO.

Also, to be safe, stay articulate of uploading an image with file names that comprise special characters. This includes international linguistic communication symbols and characters such as apostrophes. Dashes are OK. You tin can see 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, at that place are a lot of other issues that can pop up.

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

iv. Temporarily Conciliate Plugins and Themes

It'south always a good idea if you're having HTTP errors to effort 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 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 you lot don't desire to affect your live site, simply clone your alive site to a staging environs. If the WordPress HTTP mistake is also happening on staging, then yous tin quickly deactivate all your plugins to start narrowing it downwards.

Remember, you won't lose whatever data if you simply deactivate a plugin. If you tin can still admission your admin, a quick manner to do this is to browse to "Plugins" and select "Deactivate" from the bulk deportment menu. This volition disable all of your plugins.

Deactivate all plugins
Deactivate all plugins

If this fixes the issue you'll demand to notice the culprit. Outset activating them one by one, and try uploading an image again in the media library. When you encounter the HTTP error return, you lot've found the misbehaving plugin. You can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

If you tin't access WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. And so check your site again. If it works, so you will need to exam each plugin one by i. Rename your plugin binder back to plugins and then rename each plugin folder inside of if information technology, one past one, until you notice it. Yous could too 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 necktie into the media library, but we've seen some weird setups. It never hurts to try switching your theme over to the default 20 Seventeen theme to run into if it fixes it. Just like with plugins, yous don't accept to worry about losing your current theme settings. All of that is stored in the WordPress database.

5. Enquire Your WordPress Host

If yous've tried the steps above already and are still getting the WordPress HTTP error, we recommend reaching out to your WordPress host for assistance earlier proceeding. Many of the boosted troubleshooting steps are a little more avant-garde and a lot of times you tin can enquire your host to do or bank check on this for you.

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

Kinsta WordPress hosting support
Kinsta WordPress hosting support

6. Increase PHP Memory Limit

Another cause for the WordPress HTTP error is that your server lacks the available retentiveness for the background upload process 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 memory limit for Kinsta clients is already set to 256 MB. If yous host your WordPress site at Kinsta you shouldn't have whatever issues with a lack of memory. 👍

Increase PHP Memory Limit with wp-config.php

You can increase the PHP retentiveness limit by adding the following code to your wp-config.php file. Note: this may exist overwritten by a server-level rule in place past your WordPress host.

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

Increase PHP Retentiveness Limit in cPanel

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

The beginning is under the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." You lot tin can so 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 y'all to change the php.ini file. Simply curlicue downward to where information technology says "memory_limit" and input a higher value.

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

Increment PHP Memory Limit with php.ini

Subscribe Now

If you aren't using cPanel, you can as well edit the php.ini file directly if y'all accept access. To exercise 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? Learn how to set up the SSH "Connection Refused" error.

If the file was already there, search for the "memory_limit" setting and alter information technology every bit necessary.

Some shared hosts might likewise require that yous add together the suPHP directive in your .htaccess file for the to a higher place 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 the following code towards the top of the file:

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

Increment PHP Memory Limit with .htaccess

The .htaccess file is a special hidden file that contains diverse settings you lot can use to alter the server behavior, right down to a directory specific level. If you don't accept access to php.ini, we suggest y'all try this next. Kickoff, login to your site via FTP or SSH, take a wait at your root directory and run into if there is a .htaccess file at that place.

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

7. Check Uploads Folder Permissions

Typically when there is a folder permissions fault yous should get a bulletin in WordPress about it non being able to write to the directory. However, this might not always exist the case. If a WordPress site has been hacked or infected with malware, there could be a lot of problems going on with the permissions. 

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

The chief binder you lot're concerned with is your /wp-content/uploads binder, 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-10) or 750.

You tin can easily come across your binder permissions with an FTP customer (equally seen below). Y'all could too reach 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 upwardly properly.

Make sure that if y'all manually update the permissions on this binder that you check both the "Recurse into subdirectories" option as well as 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 vii.3 or college. If y'all're non running on that, you're below the minimum requirements set by the developers of the CMS. 😮

We e'er recommend running the latest and supported versions of PHP due to the fact it offers amend security and performance, including issues fixes and functions that demand to exist deprecated.

Nosotros take seen older versions of PHP contribute to all sorts of errors, including the infamous WordPress HTTP error. At Kinsta yous tin can easily change 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 selection bachelor to y'all 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

You lot tin can 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 paradigm 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 hidden resource throttling behind the scenes. That is the merely way they can cram so many users on the same machine. A common event people come across is that there are too 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 together the following code to the pinnacle of your .htaccess file, irresolute the thread limit value to something college.

MAGICK_THREAD_LIMIT i

Another selection you have is to tell WordPress to use the GD library instead of Imagick. Yous can practice this past simply adding the post-obit 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 ); 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 motion to a new WordPress host. Kinsta doesn't have crazy limits like this in identify and for the nigh part, you're only limited past PHP workers. Y'all shouldn't have to worry virtually these types of things as a website owner.

We utilise 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% individual and are not shared between anyone else or even your own sites.

Read more near how Kinsta is different than any other host y'all've tried.

10. Remove Custom Media Library Path

It very well could exist that your media library path isn't setup correctly. We typically run across this when users migrate their local development site over to production. If you wait in "Media" under "Settings" in your WordPress dashboard and run across a file path value listed, go ahead and delete information technology and click "Save Changes." You lot desire your media to exist stored in the default /wp-content/uploads folder.

Beneath is what it typically looks like. If y'all don't see a library path, so you'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 error to occur. You lot can disable mod_security past adding the following lawmaking to the top of your .htaccess file.

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

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

cPanel ModSecurity
cPanel ModSecurity

And then toggle the condition from "On" to "Off" side by side to the domain yous want to disable it on.

Disable mod_security
Disable mod_security

We always recommend using an enterprise-grade and notwithstanding affordable WAF similar Sucuri or Cloudflare instead. Yous can read our recommendation for the best WAF settings here.

12. Install the Add From Server Plugin

Last just not least, if you're actually in a bind and nix else seems to be working, you can install the complimentary Add From Server plugin. Mayhap yous're waiting for a response from your WordPress host or a programmer on how to get the WordPress HTTP error resolved.

Add From Server WordPress plugin
Add From Server WordPress plugin

The Add to Server plugin will unremarkably get you around the error and could be a good temporarily fix, specially if you're right in the middle of something important. It was originally adult to allow you to add very big files via SFTP.Important: this plugin is no longer maintained or supported. Utilize at your own gamble.

Summary

Every bit you tin can run into there are quite a few different ways to fix the WordPress HTTP error. Hopefully ane of the solutions higher up worked for you and yous're already back on track and uploading your media. If you lot continue to receive this error fourth dimension and time once again, it might exist fourth dimension to consider upgrading to a better WordPress host. Many of the solutions above are things you don't have to worry about at Kinsta.

If you establish a solution that isn't in our list, delight go out a annotate a beneath and we'll become it added.


Save time, costs and maximize site performance with:

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

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-dorsum-guarantee. Bank check out our plans or talk to sales to find the programme that'due south right for y'all.