{"id":33260,"date":"2021-08-17T18:51:36","date_gmt":"2021-08-17T13:06:36","guid":{"rendered":"https:\/\/rarathemes.com\/blog\/?p=33260"},"modified":"2024-08-21T11:55:02","modified_gmt":"2024-08-21T06:10:02","slug":"http-error-uploading-images-to-wordpress","status":"publish","type":"post","link":"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/","title":{"rendered":"How to Fix &#8220;HTTP Error When Uploading Images to WordPress&#8221;"},"content":{"rendered":"\n<p>Running across errors is quite common in WordPress. One of such errors is the HTTP error. Users mostly encounter an HTTP error when uploading images to WordPress. While this error is quite straightforward to resolve, it can be annoying that you have to pause your workflow.&nbsp;<\/p>\n\n\n\n<p>This comprehensive guide covers multiple proven ways to fix HTTP errors when uploading images to WordPress. First, let us know what the HTTP error is and what causes it.<\/p>\n\n\n\n<p>Let\u2019s begin:&nbsp;<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#What_is_an_HTTP_Error_in_WordPress\" >What is an HTTP Error in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#What_Causes_the_HTTP_Error_When_Uploading_Files_to_WordPress\" >What Causes the HTTP Error When Uploading Files to WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#How_to_Fix_it\" >How to Fix it?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#1_Confirm_the_HTTP_error\" >1. Confirm the HTTP error.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#2_Refresh_the_Page\" >2. Refresh the Page.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#3_Switch_Browsers\" >3. Switch Browsers.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#4_Resize_the_Image_File\" >4. Resize the Image File.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#5_Renaming_the_File\" >5. Renaming the File.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#6_Temporarily_Deactivate_Your_Plugins_and_Themes\" >6. Temporarily Deactivate Your Plugins and Themes.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#7_Increase_Your_PHP_Memory_Limit\" >7. Increase Your PHP Memory Limit.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#8_Update_to_the_Latest_PHP_Version\" >8. Update to the Latest PHP Version.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#9_Check_the_Uploads_Folder_Permission\" >9. Check the Uploads Folder Permission.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#10_Changing_Your_Default_Image_Editor\" >10. Changing Your Default Image Editor.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#11_Using_the_htaccess_File\" >11. Using the .htaccess File.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#12_Remove_Library_Path_for_Custom_Media\" >12. Remove Library Path for Custom Media.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#13_Take_Help_From_Your_Hosting_Provider\" >13. Take Help From Your Hosting Provider.&nbsp;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/rarathemes.com\/blog\/http-error-uploading-images-to-wordpress\/#Summary\" >Summary&nbsp;<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_an_HTTP_Error_in_WordPress\"><\/span>What is an HTTP Error in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>WordPress displays an HTTP error when something goes wrong while uploading media such as images and videos to your site. You can regard an HTTP error as a code that signals something faulty in the file upload process.&nbsp;<\/p>\n\n\n\n<p>The \u201cHTTP error\u201d is a vague term without any signal of what exactly went wrong. It might be confusing even to begin troubleshooting the error as there may be many causes for the failure. WordPress does not know the exact reason and thus shows the error message as below:&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"344\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/example-http-error.png\" alt=\"\" class=\"wp-image-33296\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/example-http-error.png 700w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/example-http-error-300x147.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/example-http-error-122x60.png 122w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Causes_the_HTTP_Error_When_Uploading_Files_to_WordPress\"><\/span>What Causes the HTTP Error When Uploading Files to WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There can be many scenarios when the HTTP error might occur, such as:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Large file size<\/li><li>unsupported format<\/li><li>Older WordPress version<\/li><li>Interfering plugins or theme<\/li><li>The unsupported file name, and more.&nbsp;<\/li><\/ul>\n\n\n\n<p>WordPress is not sure which reason is causing the problem while uploading the file. Thus, it displays the generic error message to sum it all. Since the error message does not give you a clue of the cause, you have to try various ways to solve it.<\/p>\n\n\n\n<p>Here are a few easy ways that will help you fix the HTTP error in a breeze:&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Fix_it\"><\/span>How to Fix it?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Following are 13 easy ways to help you fix the HTTP error:&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Confirm_the_HTTP_error\"><\/span>1. Confirm the HTTP error.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, due to a temporary glitch in the server, WordPress may display the HTTP error. So, it is best to confirm if the HTTP error exists even after a few tries. Wait a few minutes and upload the file you were trying to earlier. If the error persists, move on to the other solution on the list.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Refresh_the_Page\"><\/span>2. Refresh the Page.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After confirming the error a few times, try refreshing your website or even the browser. Check your internet connection. You may even restart the router. Now, check if you can upload the file in WordPress.&nbsp;<\/p>\n\n\n\n<p>Refreshing the page is quite an obvious step. However, it is the most common solution to the HTTP error.<\/p>\n\n\n\n<p>The first reason that this step works could be that your browser might have temporarily lost the internet connection. Due to this, the upload process fails. It could be due to a connection hiccup with the WordPress host or an ISP glitch. So, refreshing the page and browser may solve the error if this is the case.<\/p>\n\n\n\n<p>The second reason could be that your WordPress login session expired. We have seen coming back to the WordPress editor from another tab kicks you out of WordPress more often than not. It is a signal that your login session expired.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"433\" height=\"581\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/login-session-expired.png\" alt=\"login session expired\" class=\"wp-image-33297\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/login-session-expired.png 433w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/login-session-expired-224x300.png 224w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/login-session-expired-45x60.png 45w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/figure><\/div>\n\n\n\n<p>In such a case, log back in and manually refresh the page. Now, uploading the file should complete.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Switch_Browsers\"><\/span>3. Switch Browsers.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, the issue may not be in your WordPress but your web browser. You can try uploading the file using a different browser. Doing this will confirm if the problem is browser-related or not.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Resize_the_Image_File\"><\/span>4. Resize the Image File.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You may even want to edit the file and try uploading it again. You could reduce the pixels (height and width) or decrease the file size. You can use third-party image optimization plugins to do this automatically.&nbsp;<\/p>\n\n\n\n<p>One of such plugins is <a href=\"https:\/\/wordpress.org\/plugins\/imagify\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Imagify<\/a>. Imagify lets you shrink the file size without losing quality. There are many other plugins too that you can find online. Whichever you use, make sure they don\u2019t optimize the files locally. If the plugin localizes the optimization, it impacts your site\u2019s performance.<\/p>\n\n\n\n<p>It is okay to upload high-resolution images. However, if you are not a photographer or a business house that needs HD images, we recommend keeping the size under 100 KB and not more. Sometimes the PNG and JPG format may also determine the image size and quality. Try both the formats to see which one works.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Renaming_the_File\"><\/span>5. Renaming the File.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>WordPress automatically adds a number if you try to upload a file with the same name twice. You cannot rename the file of the uploaded file. So, you need to rename the file locally and upload it back.&nbsp;<\/p>\n\n\n\n<p>If you are going to upload a file with a number in its name, make sure to add a dash sign\u2014for example, image-1, image-01, and so on. Also, make sure not to use special characters and symbols in the file name like an asterisk, apostrophes, and so on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Temporarily_Deactivate_Your_Plugins_and_Themes\"><\/span>6. Temporarily Deactivate Your Plugins and Themes.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, plugins and themes even create a nuisance when trying to upload a file in WordPress. The most common of such plugins are image optimization plugins and security plugins. Thus, we recommend deactivating all the plugins on your WordPress and check if you can upload the file or not.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to your WordPress dashboard.&nbsp;<\/li><li>Scroll down the \u2018Plugins\u2019 section at the left sidebar.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"613\" height=\"392\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/plugin-section-on-the-dashboard.png\" alt=\"plugin section on the dashboard\" class=\"wp-image-33301\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/plugin-section-on-the-dashboard.png 613w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/plugin-section-on-the-dashboard-300x192.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/plugin-section-on-the-dashboard-94x60.png 94w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Select the \u2018Deactivate\u2019 option in the bulk action menu and click on the \u2018Apply\u2019 button.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"455\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/deactivate-all-the-plugins.png\" alt=\"deactivate all the plugins\" class=\"wp-image-33300\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/deactivate-all-the-plugins.png 700w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/deactivate-all-the-plugins-300x195.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/deactivate-all-the-plugins-92x60.png 92w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure><\/div>\n\n\n\n<p>If you can upload the file now, then activate the plugin one by one. Don\u2019t forget to check if you can upload a file after activating each plugin. If you can\u2019t upload the file, then the last plugin you activated is the culprit.&nbsp;<\/p>\n\n\n\n<p>Either find its alternative or reach out to the plugin developer for support.&nbsp;<\/p>\n\n\n\n<p>Similarly, you can also try switching your <a href=\"https:\/\/rarathemes.com\/wordpress-themes\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">WordPress theme<\/a> to the default Twenty Seventeen theme. See if it fixes the error. The settings and content are all in the database, so you don\u2019t need to worry about losing content. You can even <a href=\"https:\/\/rarathemes.com\/blog\/setup-wordpress-staging-site\/\"><strong>set up a WordPress staging site<\/strong><\/a> if you are cautious.&nbsp;<\/p>\n\n\n\n<p>Also, make sure that your plugins and theme are up to date. An outdated plugin and theme can also cause an HTTP error.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Log in to your WordPress dashboard.&nbsp;<\/li><li>Click on the Dashboard option from the left sidebar. It is located at the top of your page.&nbsp;<\/li><li>Click on the \u2018Updates\u2019 option.&nbsp;<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"381\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/updating-the-theme-and-plugins-on-WP-dashboard.png\" alt=\"updating the theme and plugins on WP dashboard\" class=\"wp-image-33304\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/updating-the-theme-and-plugins-on-WP-dashboard.png 706w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/updating-the-theme-and-plugins-on-WP-dashboard-300x162.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/updating-the-theme-and-plugins-on-WP-dashboard-111x60.png 111w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Install all the available updates from here.&nbsp;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Increase_Your_PHP_Memory_Limit\"><\/span>7. Increase Your PHP Memory Limit.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Another reason for the HTTP error while uploading images could be your server lacks the available memory to store the files. By default, the memory allocation for WordPress is 64M. But when your site exceeds that limit, you may receive the HTTP error.<\/p>\n\n\n\n<p>Increasing the PHP memory limit on your WordPress can solve the issue here. Here is how you do it:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Log in to your website with an FTP client or a file manager.&nbsp;<\/li><\/ul>\n\n\n\n<p>Here is an example of accessing the website using FileZilla.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"445\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/wp-config-file.png\" alt=\"access the wp-config file\" class=\"wp-image-33206\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/wp-config-file.png 700w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/wp-config-file-300x191.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/wp-config-file-94x60.png 94w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure><\/div>\n\n\n\n<p>The right quadrant shows the list of folders that contain your website\u2019s file.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Scroll down to your website\u2019s root folder. Mostly, it is named after your domain name or public_html. Open it.&nbsp;<\/li><li>Right-click on the wp-config.php file<\/li><li>Click on the \u2018Edit\u2019 option.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"448\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/edit-wp-config.png\" alt=\"how to edit the wp-config\" class=\"wp-image-33208\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/edit-wp-config.png 700w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/edit-wp-config-300x192.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/edit-wp-config-94x60.png 94w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure><\/div>\n\n\n\n<p>Don\u2019t tamper with any other file or code line except the one we will discuss below. <a href=\"https:\/\/rarathemes.com\/blog\/backup-wordpress-website\/\"><strong>Backing up your WordPress files<\/strong><\/a> is a good idea here. By creating a backup, you can restore any unwanted changes you make in the files.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Paste the following code above the line that reads, \u201cThat\u2019s all, stop editing! Happy blogging.\u201d<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_MEMORY_LIMIT', '256M' );<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"440\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Pasting-the-code-in-wp-config.png\" alt=\"Pasting the code in wp-config\" class=\"wp-image-29447\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Pasting-the-code-in-wp-config.png 730w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Pasting-the-code-in-wp-config-300x181.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Pasting-the-code-in-wp-config-100x60.png 100w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure><\/div>\n\n\n\n<p>256 MB memory allocation is sufficient for most of the websites.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Save the changes and exit the editor.&nbsp;<\/li><li>Check if you can upload the file now.&nbsp;<\/li><\/ul>\n\n\n\n<p>For more information, check out <a href=\"https:\/\/rarathemes.com\/blog\/resolve-wordpress-memory-limit-error\/\"><strong>How to resolve the WordPress Memory Limit Error<\/strong><\/a><strong>?<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Update_to_the_Latest_PHP_Version\"><\/span>8. Update to the Latest PHP Version.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If increasing the memory limit did not work, you could try updating to the latest PHP version. An outdated PHP version can result in poor security, performance and even cause an HTTP error.&nbsp;<\/p>\n\n\n\n<p>But before <a href=\"https:\/\/rarathemes.com\/blog\/update-php-version-wordpress-website\/\">updating to the latest PHP version<\/a>, it\u2019s best to backup your WordPress site and check for PHP compatibility.&nbsp;<\/p>\n\n\n\n<p>After doing so, here is how you update the PHP version:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Log into your control panel.&nbsp;<\/li><li>Locate and click on the \u2018Select PHP Version\u2019 tab.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"418\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/selecting-PHP-version.png\" alt=\"selecting the PHP version on cPanel\" class=\"wp-image-33311\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/selecting-PHP-version.png 697w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/selecting-PHP-version-300x180.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/selecting-PHP-version-100x60.png 100w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>You will see your current PHP version on the following page.&nbsp;<\/li><li>From the drop-down menu, select the latest PHP version.&nbsp;<\/li><li>Click on the \u2018Select as current\u2019 button at the side.&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"360\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Select-the-latest-version-of-PHP-on-cPanel.png\" alt=\"Select the latest version of PHP on cPanel\" class=\"wp-image-29641\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Select-the-latest-version-of-PHP-on-cPanel.png 730w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Select-the-latest-version-of-PHP-on-cPanel-300x148.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/02\/Select-the-latest-version-of-PHP-on-cPanel-122x60.png 122w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n\n\n\n<p>You may even contact your hosting provider for this. They may provide you instructions or update the PHP for you as a part of their customer support.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_Check_the_Uploads_Folder_Permission\"><\/span>9. Check the Uploads Folder Permission.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Incorrect or error in the folder permission can also block WordPress from writing to the directory. It then results in the HTTP error when you try to upload images or other files. Here is how you fix it:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to wp-content on your FTP client and click on the \u201cuploads\u201d folder.&nbsp;<\/li><li>Check the \u201cRecurse into subdirectories\u201d and the \u201cApply to directories only\u201d options.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"483\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/changing-the-file-permission..png\" alt=\"changing the file permission.\" class=\"wp-image-33314\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/changing-the-file-permission..png 700w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/changing-the-file-permission.-300x207.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/changing-the-file-permission.-87x60.png 87w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_Changing_Your_Default_Image_Editor\"><\/span>10. Changing Your Default Image Editor.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>WordPress has two different PHP modules for managing images &#8211; Imagick and GD Library. While both of these modules are great, Imagick is slightly infamous for exhausting the memory limit. In such a case, your WordPress may show the HTTP error. Thus, changing your image editor to the GD Library may help sort the problem:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Access the functions.php file from your FTP client (wp-content &gt; themes &gt; your theme name &gt; functions.php)<\/li><\/ul>\n\n\n\n<p>Or,&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to your WordPress dashboard.&nbsp;<\/li><li>Go to the Appearance &gt; Theme Editor.&nbsp;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"352\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/01\/Theme-editor-setting.png\" alt=\"Theme editor setting\" class=\"wp-image-31777\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/01\/Theme-editor-setting.png 667w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/01\/Theme-editor-setting-300x158.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/01\/Theme-editor-setting-114x60.png 114w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Now select the \u201cfunctions.php\u201d from the theme files options at the right-hand side list.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>Now paste the following code:&nbsp;<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>function wpb_image_editor_default_to_gd( $editors ) {\n    $gd_editor = 'WP_Image_Editor_GD';\n    $editors = array_diff( $editors, array( $gd_editor ) );\n    array_unshift( $editors, $gd_editor );\n    return $editors;\n}\nadd_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"558\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/adding-code-to-the-function-php.png\" alt=\"adding code to the function.php\" class=\"wp-image-33317\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/adding-code-to-the-function-php.png 856w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/adding-code-to-the-function-php-300x196.png 300w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/adding-code-to-the-function-php-768x501.png 768w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2021\/08\/adding-code-to-the-function-php-92x60.png 92w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Check if you can upload the image to WordPress now.&nbsp;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"11_Using_the_htaccess_File\"><\/span>11. Using the .htaccess File.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Many shared hosting providers set Imagick to use multiple threads. While it promotes faster image processing, it may also result in HTTP errors when you upload images. You can sort this by adding the following code to your .htaccess file:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>SetEnv MAGICK_THREAD_LIMIT 1<\/li><\/ul>\n\n\n\n<p>Adding this code limits Imagick\u2019s ability to use a single thread while processing images.<\/p>\n\n\n\n<p>Check if it solved the HTTP error. If not, you can also try the following code snippets:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;IfModule mod_security.c&gt;\nSecFilterEngine Off\nSecFilterScanPOST Off\n&lt;\/IfModule&gt;\n\nOr, \n\n# Exclude the file upload and WP CRON scripts from authentication\n&lt;FilesMatch \"(async-upload\\.php|wp-cron\\.php|xmlrpc\\.php)$\"&gt;\nSatisfy Any\nOrder allow, deny\nAllow from all\nDeny from none\n&lt;\/FilesMatch&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"12_Remove_Library_Path_for_Custom_Media\"><\/span>12. Remove Library Path for Custom Media.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, the HTTP error may occur due to incorrect media library path setup. It commonly happens when migrating a local development website over to production.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to the \u201cSettings\u201d on your dashboard.&nbsp;<\/li><li>Click on the \u201cMedia\u201d option.&nbsp;<\/li><\/ul>\n\n\n\n<p>Typically, the options should look as follows:&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"473\" src=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2017\/03\/word-image-2.png\" alt=\"media settings\" class=\"wp-image-19067\" srcset=\"https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2017\/03\/word-image-2.png 659w, https:\/\/rarathemes.com\/blog\/wp-content\/uploads\/2017\/03\/word-image-2-300x215.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/figure><\/div>\n\n\n\n<p>There should not be a library path on this page. If you do see a media library path with a certain value, delete it and save the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"13_Take_Help_From_Your_Hosting_Provider\"><\/span>13. Take Help From Your Hosting Provider.&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you have tried all of the steps that we have mentioned above but still face the HTTP error, it is time to take help. You can ask your <a href=\"https:\/\/rarathemes.com\/blog\/best-wordpress-hosting\/\">WordPress hosting provider<\/a> to help you out. Many hosting plans come with 24\/7 dedicated support. Don\u2019t feel shy to reach them.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As you see, there are multiple ways to fix the HTTP error. You may already be familiar with some of the steps, while some steps are a bit advanced. Nevertheless, the HTTP error is quite a common experience in WordPress. So, knowing how to fix the HTTP error is helpful.&nbsp;<\/p>\n\n\n\n<p>You just learned 13 different ways to fix the HTTP error when uploading images to WordPress. Which one worked for you?&nbsp;<\/p>\n\n\n\n<p>Let us know in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running across errors is quite common in WordPress. One of such errors is the HTTP error. Users mostly encounter an HTTP error when uploading images to WordPress. While this error &hellip; <\/p>\n","protected":false},"author":15,"featured_media":33663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_be_single_description":"","_be_image_uploader":0,"_be_meta_button_label":"","_be_meta_button_url":"","_be_meta_button_newtab":false,"_be_meta_rel_attribute":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-33260","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","latest_post"],"_links":{"self":[{"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/posts\/33260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/comments?post=33260"}],"version-history":[{"count":0,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/posts\/33260\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/media\/33663"}],"wp:attachment":[{"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/media?parent=33260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/categories?post=33260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rarathemes.com\/blog\/wp-json\/wp\/v2\/tags?post=33260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}