From our experience, the WordPress HTTP error typically originates from two things.
The first is a client-side or user error (your login session, bad characters in the file name, etc.).
And the second is a problem or setting on your WordPress host (server issue, memory list, third-party plugin, shared hosting throttling resources, etc.). So we’ll dive into a little of both.
Here are some recommendations and things to check to fix the error (sorted in order by most common reasons we see):
1. Refresh the Page
Often, the first thing one should do when you encountered a WordPress HTTP error is to simply refresh the page in your browser. Sounds too easy right? ???? Well, actually this is the most common fix we’ve seen for it. Here’s why:
First, for whatever reason, your browser might have 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 again it the error sometimes will resolve itself.
Second, we’ve also seen that sometimes after refreshing the page, or coming back to the WordPress editor from another tab, that it suddenly kicks you out.
This is most likely an indicator that your WordPress login session has expired.
You probably should see the following message:
Your session has expired. Please log in to continue where you left off.
So naturally, you log back in and try to upload your media again. However, 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.
2. Shrink or Resize the File
You might need to edit your image 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 use to automatically do this for you (both reducing and resizing) when your image is uploaded to the media library.
Some of our customers have used Imagify for years without a single issue. But there are a lot of other great ones out there as well.
Just make sure whichever plugin you use, that they are optimizing images on their own servers, not locally.
If you’re bulk optimizing images locally this can drastically harm your site’s performance.
You can also use:
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 rule 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 one can be much larger than the other depending on what type of image it is. It might be worth looking into Image Optimization | Google Developers Web Fundamentals
Depending on the configuration of your hosting package, you might also want to look into increasing the WordPress maximum upload file size.
3. Rename the Image File
It can never hurt to try and rename the image file. WordPress should automatically append a number on the end if you try 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 need to rename it locally and re-upload it.
When we are uploading images that already exist, we typically add a -1 or -2 on the end (example: image-file-1.png, image-file-2.png). Make sure to add the dash otherwise Google will read it as one word and it could hurt your SEO.
Also, to be safe, stay clear of uploading an image with file names that contain special characters.
This includes international language symbols and characters such as apostrophes. Dashes are OK. While WordPress can technically support these, there are a lot of other issues that can pop up.
4. Temporarily Deactivate Plugins and Themes or Rename These Two Folders
It’s always a good idea if you’re having HTTP errors to try deactivating your plugins and even 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).
If you are using Softaculous, you can simply clone your live site to a staging environment instead of working on your live site. If the WordPress HTTP error is also happening on staging, then you can quickly deactivate all your plugins to start narrowing it down.
Remember, you won’t lose any data if you simply deactivate a plugin. If you can still 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.
If this fixes the issue you’ll need to find the culprit. Start activating them one by one, and try uploading an image again in the media library. When you see the HTTP error return, you’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 can’t access your admin you can FTP into your server and rename your plugins folder to something like plugins_old
.
Then check your site again. If it works, then you will need to test each plugin one by one.
Rename your plugin folder back to plugins
and then rename each plugin folder inside of if it, one by one, until you find it.
You could also try to replicate this on a staging site first.
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 try switching your theme over to the default Twenty Seventeen theme to see 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 database.
5. Ask Our Technical SUpport Team For Help
If you’ve tried the steps above already and are still getting the WordPress HTTP error, we recommend reaching out to our WordPress team for assistance before proceeding.
The additional troubleshooting steps are a little more advanced and unless you are very comfortable with WordPress and cPanel, you might need some help from us.
6. Increase PHP Memory Limit
Another cause for the WordPress HTTP error is that your server lacks the available memory 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 clients is already set to 256 MB. If you host your WordPress site on our platform, you shouldn’t have any issues with a lack of memory. ????
Increase PHP Memory Limit in cPanel (Recommended)
Since we are a cPanel web hosting platform, you can increase the PHP memory limit in two different areas.
The first area is also under the software section which is available on all servers by default.
Click on the “MultiPHP INI Editor” tool. This allows you to modify the php.ini
file.
Simply scroll down to where it says “memory_limit” and input a higher value.
The second is under the software section if the server you are on has this feature enabled and then select “Select PHP Version.”
Click on “Switch to PHP Options” and then click on “memory_limit” to change its value.
Increase PHP Memory Limit with php.ini
If you aren’t using cPanel, you can also edit the php.ini
file directly if you have access.
To do this, log in to your site via FTP or SSH (your hosting package must support this for it to work), go to your site’s root directory and open or create a php.ini
file.
If the file was already there, search for the “memory_limit” setting and modify it as necessary.
Increase PHP Memory Limit with wp-config.php
You can increase the PHP memory limit by adding the following code to your wp-config.php
file. Note: this may be overwritten by a server-level rule in place by your WordPress host.
define( 'WP_MEMORY_LIMIT', '256M' );
Increase 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 have access to php.ini
, we suggest you try this next. First, log in to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess
file there.
If there is you 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 error you should get a message in WordPress about it 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 issues going on with the permissions.