[SOLVED] WordPress Gives A HTTP Error When Uploading Images To The Media Gallery

If you’ve been around my blog for long, you know I am a bit of a WordPress fanboy. It’s my favorite CMS and blogging platform, primarily because of the fact that the community of developers who make themes and plugins for WordPress are amazing.

I’ve been working with WordPress for more than 10 years now, and it never ceases to amaze me what amazing solutions have been developed in the form of plugins.

That doesn’t mean that WordPress is perfect, though. Sometimes, the open source nature of the CMS can introduce bugs or incompatibilities that can cause errors or even bring an entire site down. If you’re going to work with WordPress, knowing how to troubleshoot and solve those issues are a good skill to have.

Today’s post is one that is written to help folks who are running into the infamous “HTTP Error” error that displays when you try to upload an image to the WordPress image gallery or media gallery.

If you found this post, you were probably searching Google for a term like:

  • HTTP error from WordPress when uploading an image
  • Why is WordPress giving me a HTTP error?
  • Troubleshoot HTTP error in WordPress
  • Why won’t WordPress let me upload my image? It’s giving me a HTTP error.

In my experience, there are two situations where WordPress might throw an HTTP error when uploading images. The first, is session-based and the second is configuration-based.

Session-based issues are quicker to fix, while configuration-based require a little more tech knowledge (but are still pretty easy to fix). Below are the recommended solutions for both scenarios.

Scenario 1 – A Session-Based HTTP error from WordPress

Here’s the situation. You are in the middle of writing a blog post. You took a break for a while and now, when you come back to work on your post, every time you try to upload an image to the WordPress image gallery, you get the HTTP error message shown in the image below.

WordPress shows a HTTP error when you try to upload an image to the media gallery

Well…that’s not really helpful, WordPress. What does an HTTP error mean? How to I troubleshoot it? What steps can I take to resolve it? Unfortunately, the error doesn’t really provide any troubleshooting tips.

No worries, this one is an easy one to tackle. More than likely, what happened is your WordPress session timed out. Usually, WordPress will display a login box to let you know that you need to log back in to continue the session, but sometime that just doesn’t happen.

So, in this scenario, here are the steps to take:

1) Before you do anything click that “Save Draft” button. Even if the session is timed out, it’s worth having WordPress try to commit any changes you have made to the database. If the session is truly timed out on the WordPress CMS, then it should take you to a login screen and it should attempt to save the changes in the background once you log in. It’s not guaranteed that your changes will be saved, but it’s worth trying.

2) With your changes saved, close your browser.

3) Open your browser again and log in to your WordPress console.

4) Edit the post you were working on and try adding the image again.

5) At this point, the browser session is new, the WordPress session is new, and the connection to your server is new. You should be able to upload your images now with no issues.

Scenario 2 – Configuration-Based HTTP errors from WordPress

Configuration-based errors usually occur when you’re first setting up WordPress and they usually are caused by the way your server is configured. The good news is for most hosts they are easy to fix.

NOTE: If you’re host doesn’t allow you to modify your .htaccess file, then you won’t be able to fix this one yourself. You’ll need to open a ticket with your host and have them fix the issue. My $.02 on this is that if a host doesn’t give you access to your .htaccess file, you should find a new host.

Working with the WordPress.org version of WordPress will require you to have full access to all your files, so consider moving to a host like SiteGround <–This is my Affiliate Link. I do get a small commission if you sign up.)

To fix a configuration-based HTTP error, perform the following steps:

1) Login to your host, either via their control panel (like cPanel) or via FTP. If you aren’t using FTP with WordPress, you should take some time to learn about FTP, set up your accounts with your host, and download a good FTP tool like FileZilla (which is free). Troubleshooting WordPress is a lot easier to do when you know how to use FTP.

2) If you are logged in via cPanel, open the File Manager

3) Locate the .htaccess file and download a copy to your local computer

4) Open the .htaccess file with a code editor like Notepad++.

NOTE: It is important that you use a code editor like Notepad++ NOT a text editor like Notepad or MS Word. If you use a text editor, you run the risk that your file will be encoded improperly, so use Notepad++…it’s free.

You may be able to resolve your http upload error in WordPress by adding a few lines of code to your WP-Config.php fileYou may be able to resolve your HTTP upload error in WordPress by adding a few lines of code to your WP-Config.php file

5) Next, create a new line at the top of your .htaccess file and add the following snippet of code on that first line:SetEnv MAGICK_THREAD_LIMIT 1

6) Save the file.

7) On your server, via FTP or via the File Manager, rename your current .htaccess file to .htaccess-good. This basically creates a backup copy of your .htaccess that you can revert to if something goes wrong.

8) Upload the modified .htaccess file from your local computer to your server. Be sure you place it in the same directory as the .htaccess-good file.

9) Test your site to make sure it loads up okay by refreshing your home page. If you get an error or the site doesn’t load, rename your changed .htaccess file to .htaccess-bad, then rename .htaccess-good back to .htaccess. Your site should load up just fine again. Take some time to repeat the steps again and only later the file by adding the code above on the first line.

10) If your homepage loads up just fine, then log out of your WordPress admin console and then log back in.

11) Try uploading your image now. It should work just fine.

Scenario 3 – Try Re-Saving The Image In A Different Format

One more thing to try if neither of the solutions above work. If you neither of the solutions work, try doing the following:

1) Open your image in a free image editing tool like Paint.NET. NOT Microsoft Paint. Paint. NET is a great free image editor.

2) Save the image to a different format by choosing File –> Save As and selecting a different format.

3) If the original file that wouldn’t upload was a .jpg, then save the file as a .png. If it was originally a .png, save it as a .jpg.

4) Try uploading the file now. Sometimes, the file encryption gets a little scrambled and saving it as a different file format can solve the issue.

Scenario 4 – Nothing Works, Change Host

This is the doomsday scenario, but one that I had to do recently. I tried my steps above, as well as 3-4 other things to try to get past the HTTP error in the WordPress image library.

At this point, though, I was also having other issue with the host that my client was using. After a discussion about this issue, along with the other, we decided that it was time to change hosts.

After spending a couple hours migrating their site form GoDaddy to SiteGround (the migration team at SiteGround is AMAZING) and waiting 24 hours for the domain change to propagate, guess what.

No HTTP Error uploading to WordPress

Yep, that’s right. Simply changing from GoDaddy to SiteGround resolved the issue and we haven’t see it since. So, if you have done your due-diligence testing everything you can on your current host, you might consider whether a host change is in order.

I hope that helps some folks troubleshoot those nebulous HTTP errors in WordPress. Have another way of fixing the HTTP error? Be sure to share it in a comment!

–Sean


Share This Post With A Pin!

The WordPress Media uploader is causing a HTTP error when I try to upload a photo image to my gallery

Content So Good You Can Almost Taste It!

Subscribe to my email list and get updates in your inbox

Join my mailing list and get all of my social media tips, tricks, and comics in your inbox. Spam-free, guaranteed!





Comments And Reactions

  1. Kathy Hill Starks says:

    I was able to clear the notification on the desktop site, but it still showed up on my Samsung Galaxy S5, and long pressing didn’t bring up a “clear badge” option. So I followed the suggestion from the poster below and cleared the data and the cache for both Facebook and Messenger and it worked! Whew…

  2. Wendulka Glover says:

    Thank you for that, it was driving me mad seeing the notification there. Going to facebook through the browser helped. There was some message requests i couldn’t see in the messenger app

  3. THANK YOU! I was extremely frustrated until I came across this post. For me it was the “clear unread threads” via the desktop that finally did it.

  4. THANK YOU!

  5. Tried all suggested solutions on Android.
    Didn’t work. I then found out a way.

    Cleared messager app data. Logged out from messager and logged in again …

    Then found that there was an unread messager missed call notification that didn’t appear before the steps I did above. I opened the notification and closed the app.

    Finally notification badge came to zero again and gone. Peace at last .

    Hope that helps.

    • seanrnicholson says:

      Glad you got it figured out. If it’s not one of the tips in the article, please share what worked for you so others can get rid of the annoying persistent message icon 🙂

  6. BluePotion says:

    For me it says “new message” after I reply to my sister’s message. It happens everyday and not just once. Several times within minutes or hours of my single reply. I end up having to archive our discussion. It’s the only way for it to disappear. I will try the Mark All as Read option. But it shouldn’t alert me to my own reply.

  7. I have an iPhone and iPad and the notifications I’m getting are a little different. On both devices in the locked screen or pull down notifications (Widgets) it shows Facebook “you have 8 new notifications and 2 messages”. But when I go to my FB page it only shows the 8 new notifications. I have searched everywhere for the new messages. It does not show up on my FB page or messenger as unread messages, only on the widgets screen. When I clear my widgets the next day it will show back up either showing I have new notifications and 2 messages or just showing the 2 messages. The new notifications are always correct. I’ve checked the area for messages from non-Facebook users and there are no new messages there. HELP!!

    • seanrnicholson says:

      Hey Jeanette,

      Did you try the last bonus tip in the article? It shows you how to clear all unread messages on the desktop (browser) view of Facebook and then that should clear the rogue notification on your iOS devices. Let us know if that doesn’t fix it.

      –Sean

  8. Hunter Hearst Helmsley says:

    Didn’t work for me..

  9. Yeah this doesn’t work

  10. For android mobile the above does not work. Uninstalling (and reinstalling) the MSN app solved the problem – and no data got lost as far as I see.

  11. Doesn’t work.

  12. Shana Zinn says:

    Dear God, thank you! It worked.

  13. The easiest method: Delete messenger on phone. No more irritating little “1’s” on the screen.

  14. Lise James says:

    My frustration isn’t the notification button, but I came across your blog while searching for a solution to this issue, “why do messenger windows keep popping up, after I have read, and responded to them?” So, while on my desktop, which is where I usually am, I go through all the new facebook notifications. Each time I click on a notification, the browser then takes me to that page, and with that navigation, the last 3, or more, messenger windows pop up again, taking up real estate on my monitor. I constantly have to “x” them out, but when I navigate to another page, they pop up again. So pissed that this issue is wasting my time. Unlike most people on facebook, I am responding to business, client questions, and trying to make a living. Oye!!!

  15. Allie Tyre says:

    worked perfectly for me.. even though the desktop didnt show any notifications, just pressing “mark all as read” cleared it on my iPhone. Thanks

  16. S. Dudley says:

    OMG… how do I thank thee…. let me count the message notifications GONE!! Thank you. 🙂


Speak Your Mind, Share A Comment, Ask A Question

*