WordPress uploading image error:
You will get this WordPress error while you’re trying to upload an image on your WordPress site.
There are different reasons for this error, and we will try to find the best solution to get rid of it.
Check your image file name
First of all, check your image’s name. If it contains special characters, this might be the reason. Rename the image with simple words, even random words.
Post-processing of the image failed.
This happens when you are trying to upload an image that is large in pixel size, for example, an image with 3000 x 2000 pixels. Which is too large for your server to process.
Read more here: [SOLVED] Post-processing of the image failed. If this is a photo or a large image, please scale it down to 2500 pixels and upload it again.
Other possible solutions:
- Decrease your image size before uploading. You can use GIMP (it’s a free and very useful photo editor software). After install, select (from the menu above): Image -> Scale Image -> put a lower image size.
- Increase PHP Memory – Again, the PHP Memory limit has a crucial role for each WordPress site.
- ModSecurity – Your hosting server may have mod_security enabled, and it might be the cause of this error, so you may disable it and check if works.
To disable the mod_security, add the following code to the .htaccess:
ATTENTION: EACH MODIFICATION ON THIS FILE MAY BREAK YOUR SITE. BEFORE DOING ANYTHING, DOWNLOAD A COPY OF THAT FILE INTO YOUR COMPUTER, OR COPY THAT FILE ON YOUR SERVER AND RENAME IT BY ADDING AN “-OLD” TO THE FILE. IN CASE SOMETHING GOES WRONG, REINSTATE THE OLD FILE.
<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>
Unable to create the directory and broken images in the Media Library
Do you see this error when you try to upload a new image: “Unable to create directory wp-content/uploads/2022/02. Is its parent directory writable by the server”?. If so, the folder permission is not well configured. Here is the solution:
- Navigate to wp-content/uploads/ (with Filezilla, or even through cPanel and Files Manager feature)
- Use your FTP program to change the uploads folder permission to 755, apply it to all enclosed items.
- This will make sure all items and folders within your uploads folder are set to 755.