Publisher Theme
English
  • العربية العربية
  • فارسی فارسی
  • Publisher WP Theme
    • Features
    • Demos
    • Showcases
    • Changelog
    • Support
    • Documentation
    • Publisher vs Others
      • Newspaper vs Publisher
      • Soledad vs Publisher
      • Jannah vs Publisher
      • Good News vs Publisher
      • JNews vs Publisher
      • MagPlus vs Publisher
      • Newsmag vs Publisher
      • SmartMag vs Publisher
  • Pricing
  • WP Plugins
  • Blog
    • Login
    • Create Account
Download Publisher
Publisher Theme
  • Publisher WP Theme
    • Features
    • Demos
    • Showcases
    • Changelog
    • Support
    • Documentation
    • Publisher vs Others
      • Newspaper vs Publisher
      • Soledad vs Publisher
      • Jannah vs Publisher
      • Good News vs Publisher
      • JNews vs Publisher
      • MagPlus vs Publisher
      • Newsmag vs Publisher
      • SmartMag vs Publisher
  • Pricing
  • WP Plugins
  • Blog
+
Download Publisher
English
  • العربية العربية
  • فارسی فارسی
  • WordPress

How to Fix WordPress Image Upload Error

An image upload error can happen for several reasons in WordPress. Here we have listed all the ways to fix WordPress image upload error.

November 2, 2019
0
BetterStudio Blog

Have you ever experienced an error while uploading image to WordPress? It is obvious that this error occurs when you try to upload a new image to your website. But, what is the reason? WordPress image upload error is one of the most occurred errors in WordPress.

Fortunately, there are many ways to fix this error. In this article, we discuss how you can fix the WordPress image upload error.

Like any other CMS platforms, WordPress has bugs and errors. However, since this CMS is developed for both amateur and professional users, then, fixing errors isn’t that difficult. Especially WordPress image upload error.

Before we introduce ways of fixing this error, have you thought about the error? Why WordPress image upload error occurs?

As you probably know, your website files are stored on your server. For your website to read files, it needs permissions. If there is any issue with the permissions of your files, you will get different errors and in this case WordPress image upload error.

WordPress image upload error

When your images disappear from your media gallery is another sign of this error.

But how do these permissions change? When you haven’t touched them or didn’t know they even exist. There are many reasons for it. For example, when your server is updated, these permissions may change, and you get a WordPress image upload error.

Table Of Contents
  • 1. Fix create directory error in WordPress
  • 2. Fix HTTP error while uploading an image to WordPress
  • 3. Fix Missing Temporary Folder error in WordPress
  • 4. Fix Uploaded Image File Exceeds the upload_max_filesize_directive error
  • 5. Fix HTTP error while uploading an image in GoDaddy
  • 6. Fix HTTP error while uploading an image in DreamHost

Fix WordPress image upload error

It’s time to look at a few ways to fix WordPress image upload error.

1. Fix create directory error in WordPress

In this method, you need to connect to your website with an FTP client. So, the first few things you need are an FTP account and FTP client. There are many FTP clients available, but the most popular one is FileZilla.

After connecting to your website with FTP, head over to your wp/content folder.

In this folder, you can find uploads. Your WordPress website stores every media you upload into this folder. Right-click on the uploads folder and click on file permissions. Just like the image below:

Once you click on file permissions a new window pops up. The first step you need to take is to set your Uploads folder and subdirectories permission to 744.

To do so, only type in 744 in numeric value. Don’t forget to check “Recurse to subdirectories” and “Apply to directories only”. Finally, click on OK. (If 744 didn’t fix the error, try 755)

The next step is to change permissions of your files inside the uploads folder. To do so, right-click on the uploads folder and click on file permission.

Now type in 644 in numeric value and make sure to check “Recurse into subdirectories” and “Apply to files only”. Then, click on OK.

Make sure you type in the correct values/numbers.

2. Fix HTTP error while uploading an image to WordPress

Another error that could occur while uploading an image to WordPress is the HTTP error.

Out of all errors, WordPress HTTP error is the last error that every user would want to see. Because fixing this error is very time-consuming.

This error, doesn’t leave a trace behind, therefore, locating the source can be difficult at times and you need to try every fix until you find the right one.

Below, we mentioned a few ways to fix HTTP error in WordPress:

Refresh page or change browser

Also, the time-frame you are allowed to stay in WordPress may have expired and you need to re-login to your account.

This method may be too simple to work, but you would be surprised how many times this method has actually worked. You just need to refresh your browser. This error may occur when you are disconnected from your website and by refreshing you reconnect.

The other issue could be the internet. By refreshing your page, you may realize that your internet is not working. Changing your browser could also fix this error. The browser you are using may not be compatible or cause errors.

Delete your browser’s cache

Deleting your browser’s cache is another way to fix HTTP error while uploading an image.

The cache is a set of information about the websites you have visited before, saved on your browser’s memory.

To delete cache only for the specific page that you are on click on ctrl + f5 for Windows and in Mac and Safari use the hotkeys below:

WordPress image upload error

Mac: CMD+Shift+R

Safari: Shift+Reload

But if you want to completely delete your browser’s cache, you need to head over to your browser’s settings and click on clear browsing data.

Deleting cache is different for every browser. You can use Google search to find settings for your browser or you can read our previous articles on how to delete browser’s cache.

Also, you can read our previous articles if you wish to know more about HTTP error in WordPress.

Rename your file

WordPress duplicates files by adding a number at the end. This process is usually automatic but sometimes it may not happen and could cause errors.

Rename your image and make sure you are not using any name with special characters. For example use a name like this: file-name-01.png.

Compress your image

WordPress image upload error

Another way to fix this error is by reducing the size of your image. The image you are trying to upload may exceed the WordPress upload limitations. To compress your images without losing their quality, you can use Imagify plugin.

Change your image format

Change your image format. If the image you are trying to upload is in .png, change it to .jpg and try again. Also, if the error occurred while you were uploading a .jpg image, try changing the format to .png.

Deactivate plugins and themes

Deactivate your plugins and themes. This is only temporary. Some security plugins may cause HTTP error. You can also try your luck by using the default theme.

Increase your PHP memory limit

Your server uses PHP memory to run your website and your website uses PHP memory to upload your files.

If your PHP memory is too small or filled, you get HTTP error. Therefore, increasing your PHP memory could be another fix to HTTP error. If you have any questions about PHP memory feel free to leave a comment below or read our previous articles.

Update PHP version

WordPress image upload error

As you probably know, PHP is the main language of your WordPress website. WordPress developers strongly believe that by updating your PHP version you can prevent many errors.

From your cPanel head over to Software and click on “Select PHP Version”. You can view your current PHP version and select the newer version.

Delete Media path

If you have recently changed your media path, then you had this error coming. The only path that WordPress uses to save your uploaded media is wp-content/uploads. If you have created another file, delete it so WordPress can re-use the original path.

Deactivate mod-security

Mod-security is an open-source firewall. In some cases, if this mod is activated it could cause HTTP error while uploading an image. To deactivate it, head over to your .htaccess file and copy & paste the code below:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
/<IfModule>

Change the WordPress library from Imagick to GD Library

Both Imagick and GD Library are used in WordPress. However, due to lack of memory Imagick could cause HTTP error.

Therefore, switching to the GD Library could possibly fix HTTP error while uploading an image. Simply copy and paste the code below to your function.php file:

functionwpb_image_editor_default_to_gd( $editors){
$ gd_editor= 'WP_Image_Editor_GD;'
$ editors= array_diff( $editors, array( $gd_editor) );
array_unshift( $editors, $gd_editor);
return$editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd');

Limit Imagick in .htaccess

By default, the number of operations in Imagick can be set to multiple operations at the same time. But since this library lacks memory, it could end up causing errors.

To limit Imagick to 1 operation at a time, you need to copy and paste the code below to your .htaccess file:

SetEnv MAGICK_THREAD_LIMIT 1

Install Add From Server plugin

This plugin could be a great help to you, whether you have HTTP error or not. With this plugin, you can upload high volume files to your WordPress. This plugin uses SFTP.

Ask your hosting provider

Your last resort is contacting your hosting provider. If you have tried every possible way and you still get an HTTP error, it is best to contact your hosting provider and ask them for help.

3. Fix Missing Temporary Folder error in WordPress

Missing Temporary Folder error blocks uploading an image, plugins, updating WordPress and even add-ons.

What causes this error? The main reason behind this error could be your PHP settings in your host. Some PHP settings allow you to save some data in a temporary folder which you need to relocate later on.

When you upload an image, update your WordPress or install a plugin, WordPress needs to have access to these folders.

If these folders are not accessible, you get Missing temporary folder error. To fix this error follow the steps below:

  • Connect to your host with an FTP client or through cPanel.
  • Look for wp-config.php file.
  • Open it in an editor, or you can download it to your computer and re-upload it once you are done with it.
  • Copy and paste the code below before “That’s all, stop editing! Happy blogging”.
define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/');
  • Save the changes and re-upload the file.
  • Go to the wp-content folder.
  • Create a new folder and call it “Temp”.
  • Head back to your WordPress website and try to upload your image again.

4. Fix Uploaded Image File Exceeds the upload_max_filesize_directive error

The uploaded file exceeds the upload_max_filesize directive in php.ini error occurs when you are trying to upload a large file.

This file could be an image or even a theme. The reason behind this error is the fact that your WordPress website has upload limitations.

As you probably can tell, you need to increase your upload_max_filesize limit. You have a few ways to fix this error:

Increase upload max filesize from .htaccess file

To do so, you only need to have access to your .htaccess file. It doesn’t matter whether you open it from your cPanel or FTP. Locate the .htaccess file and edit it.

Now, copy and paste the code below to your .htaccess file:

php_value upload_max_filesize 256M

Save your changes and re-upload your .htaccess file back where you found it. If you face the same error again, copy and paste the code below to your .htaccess file:

php_value post_max_size 256M
php_value memory_limit 512M
php_value max_input_time 180
php_value max_execution_time 180

Make sure you save your changes. Otherwise, these won’t take place. Also, you can change the numbers to the maximum limit of your host.

Increase filesize from the wp-config.php file

From cPanel or FTP connect to your website. Look for wp-config.php file. Usually, you can find this file in your root directory. Copy and paste the code below before “Happy Blogging” sentence:

@ini_set('upload_max_size' , '256M' );

Update php.ini file

Another way to increase your memory size is by updating your php.ini file. In etc/php/7.0/cli/php.ini/ look for php.ini file. Open the file and look for upload_max_filesize. Now you need to increase the amount and save your file.

If you don’t have access to any of the files mentioned above, you need to contact your hosting provider and ask them to increase your upload filesize.

5. Fix HTTP error while uploading an image in GoDaddy

As you know GoDaddy is a popular hosting provider. GoDaddy gives you access to cPanel.

To fix HTTP error while uploading an image in GoDaddy you need to copy and paste the code below to your function.php file:

<?php 
add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
?>

6. Fix HTTP error while uploading an image in DreamHost

HTTP error while uploading an image in DreamHost is one of the most common occurred errors with no trace. Often, you need to change your hosting provider, or by deactivating your themes and plugins you can fix this error.

But we recommend trying to deactivate your plugins and themes first. Delete your unused themes and plugins.

Please Share This:
  • Home
  • Blog
  • WordPress
  • How to Fix WordPress Image Upload Error
Get notified of new articles
Subscribe to our newsletter to be notified on new post and product releases.
BetterStudio
  • Contact us
  • Hire us
  • Blog
  • Affiliates
Products
  • Publisher Theme
  • Better Ads Manager
  • Our Plugins
Useful Links
  • 30 Days Refund Guarantee
  • Refund Request Form
Support
  • Publisher Support
Connect
  • Follow on Twitter
  • Join us on Facebook
  • Follow on Google+
Copyright © 2021 — BetterStudio. Terms & Conditions — Privacy Policy