The WordPress HTTP error shows up when something goes wrong while uploading images or videos using the media library tool. There are multiple possible causes for this problem, and it can be hard to fix since there is no information that indicates what’s wrong.
How to fix it?
The HTTP error usually 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:
1. Refresh the page
The first thing you should do when encountering the WordPress HTTP error is refresh the page in your browser. This is the most common fix. This is because your browser might have lost connection temporarily and the process simply failed to complete. If you refresh the page and try uploading again it the error sometimes will resolve itself.
Refreshing the page will also let you know if your WordPress session has expired, which is another possible cause for the HTTP error. Once you log back in, go back to the media library and try to upload the file again.
2. Shrink or resize the file
A big file could also trigger the HTTP error. You might need to edit your image file, which could entail reducing the file size (KB or MB) or decreasing the width/height (pixels). You could also install one of the many plugins developed to optimize media files for the web.
3. Rename the image file
It can never hurt to try and rename the image file. WordPress should automatically add 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 before uploading it.
Do not use special characters when naming your files. This includes international language symbols and characters such as apostrophes. WordPress should be able to support them, but this is a common fix for issues with media files.
4. Temporarily deactivate plugins and theme
It’s always a good idea 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 don’t want to affect your live site, simply clone your live site to a staging environment. 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.
5. Contact your host’s support team
If you’ve tried the steps above already and are still 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 little more advanced and a lot of times you can ask your host to do or check on this for you.
6. Increase PHP Memory Limit
Your server may lack 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
7. Move to the Latest Version of PHP
WordPress officially recommends PHP 7.3 or higher.
We recommend running the latest and supported versions of PHP for better security and performance, including bug fixes and functions that need to be deprecated.
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 production. If you look in “Media” under “Settings” in your WordPress dashboard and see a file path value listed, go ahead and delete it and click “Save Changes.” You want your media to be stored in the default /wp-content/uploads
folder.