{"id":34170,"date":"2021-10-05T22:56:02","date_gmt":"2021-10-05T22:56:02","guid":{"rendered":"https:\/\/www.hostduplex.com\/kb\/?post_type=ht_kb&#038;p=34170"},"modified":"2021-10-05T22:56:02","modified_gmt":"2021-10-05T22:56:02","slug":"how-to-fix-the-wordpress-http-error-when-uploading-images-to-the-media-library","status":"publish","type":"ht_kb","link":"https:\/\/www.hostduplex.com\/kb\/article\/how-to-fix-the-wordpress-http-error-when-uploading-images-to-the-media-library\/","title":{"rendered":"How to fix the WordPress HTTP error when uploading images to the media library"},"content":{"rendered":"\n<p>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\u2019s wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to fix it?<\/h3>\n\n\n\n<p>The HTTP error usually originates from two things:&nbsp;the first is a&nbsp;client-side or user error&nbsp;(your login session, bad characters in the file name, etc.), and the second is a&nbsp;problem or setting on your WordPress host&nbsp;(server issue, memory list, third-party plugin, shared hosting throttling resources, etc.).&nbsp;So we\u2019ll dive into a little of both.<\/p>\n\n\n\n<p>Here are some recommendations and things to check to fix the error:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Refresh the page<\/h4>\n\n\n\n<p>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\u00a0might have lost connection temporarily\u00a0and the process simply failed to complete. If you refresh the page and try uploading again it the error sometimes will resolve itself.<\/p>\n\n\n\n<p>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.<br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. Shrink or resize the file<\/h4>\n\n\n\n<p>A big file could also trigger the HTTP error. You might need to edit your image file, which could entail\u00a0reducing the file size\u00a0(KB or MB)\u00a0or\u00a0decreasing the width\/height\u00a0(pixels). You could also install one of the many plugins developed to optimize media files for the web.<a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/imagify\/\" target=\"_blank\"><\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3.\u00a0Rename the image file<\/h4>\n\n\n\n<p>It can never hurt to try and rename the\u00a0image file. WordPress should automatically add a number on the end if you try to upload a duplicate file name, but in case that doesn\u2019t work, try renaming your file before uploading it.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4. Temporarily deactivate plugins and theme<\/h4>\n\n\n\n<p>It\u2019s always a good idea to try\u00a0deactivating your plugins\u00a0and even\u00a0switch your WordPress theme to the default\u00a0to 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).<\/p>\n\n\n\n<p>If you don\u2019t want to affect your live site, simply clone your live site to a\u00a0staging environment. If the WordPress HTTP error is also happening on staging, then you can quickly\u00a0deactivate all your plugins\u00a0to start narrowing it down.<\/p>\n\n\n\n<p>Remember, you won\u2019t 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 \u201cPlugins\u201d and select \u201cDeactivate\u201d from the bulk actions menu. This will disable all of your plugins.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ask-wordpress-host\">5. Contact your host&#8217;s support team<a href=\"https:\/\/kinsta.com\/blog\/wordpress-http-error\/#ask-wordpress-host\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<p>If you\u2019ve tried the steps above already and are still getting the WordPress HTTP error, we recommend\u00a0reaching out to your WordPress host\u00a0for 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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"increase-php-memory-limit\">6. Increase PHP Memory Limit<a href=\"https:\/\/kinsta.com\/blog\/wordpress-http-error\/#increase-php-memory-limit\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<p>Your\u00a0server may lack the available memory\u00a0for 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.\u00a0256 MB is recommended<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/kinsta.com\/legal\/terms-service\/\"><\/a><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/kinsta.com\/legal\/privacy-policy\/\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"latest-php-version\">7. Move to the Latest Version of PHP<a href=\"https:\/\/kinsta.com\/blog\/wordpress-http-error\/#latest-php-version\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<p>WordPress officially\u00a0recommends PHP 7.3 or higher. <\/p>\n\n\n\n<p>We recommend running the latest and\u00a0supported versions of PHP\u00a0for\u00a0better security and performance, including bug fixes and functions that need to be deprecated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-custom-media-library-path\">10. Remove Custom Media Library Path<a href=\"https:\/\/kinsta.com\/blog\/wordpress-http-error\/#remove-custom-media-library-path\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<p>It very well could be that your media library path isn\u2019t setup correctly. We typically see this when users migrate their local development site over to production. If you look in \u201cMedia\u201d under \u201cSettings\u201d in your WordPress dashboard and see a file path&nbsp;value listed, go ahead and delete it and click \u201cSave Changes.\u201d You want your media to be stored in the default&nbsp;<code>\/wp-content\/uploads<\/code>&nbsp;folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019s wrong. How to fix it? The HTTP&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"class_list":["post-34170","ht_kb","type-ht_kb","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/comments?post=34170"}],"version-history":[{"count":1,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34170\/revisions"}],"predecessor-version":[{"id":34171,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34170\/revisions\/34171"}],"wp:attachment":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/media?parent=34170"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=34170"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=34170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}