How to fix the error when uploading images
Any website must have images since they make your site even better. Today, most of us find it impossible to think of creating a blog post without using any photographs.
Undoubtedly, the text on your blog will always be crucial to SEO. The use of photos in your content, however, will make it stand out and increase site traffic.
It’s normal to occasionally get an error when uploading while routinely adding photos to your WordPress website. You shouldn’t worry, though. Fortunately, even the most difficult WordPress image upload problems may be quickly identified.
Nothing is worse than searching for the ideal picture for your blog post or e-commerce site for ten minutes, going to upload it, and then, all of a sudden, being greeted with a cryptic error when uploading images.
Error when uploading images is among the most prevalent picture problems with WordPress. There are many other things that might cause these picture upload problems.
File Permissions
Connect to your website using FTP and navigate to the /wp-content/ directory to alter the file permissions. You’ll discover the uploads folder there, which houses all of your uploaded files, including pictures. Select File permissions from the context menu by right-clicking the uploads folder, as shown below.
In the number value field, enter 744, then select the checkbox next to the Recurse into subdirectories option. Select the “Apply to directories only” radio button at this point.
The files in the uploads directory must all have file permissions configured, which must be done next.
To achieve this, use the right-click context menu to choose the File permissions option from the Uploads directory’s menu. In the file permissions dialogue box, change the numerical value to 644.
Ensure that Recurse into subdirectories is checked. The radio button that says “Apply to files only” must be chosen last. Click the OK button to save your changes.
Image Resizing
The image can also be too large, both in terms of its dimensions and its file size. Use picture compression tools to see if you can reduce the size. However, if this error when uploading images keep coming up for you, you may increase the limit by adding code to the site’s php.ini file.
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
Image renaming
Start by examining the file name if you have an error when uploading images. If you use accented letters (, á, é) or special characters ($, *, &, #), the WordPress uploader could have trouble uploading your picture. Reupload the image after giving it the proper file name.
PHP Memory Limit Increase
You can see an HTTP error from WordPress while attempting to upload a picture. This issue might potentially be caused by low server resources or unexpected traffic patterns. Therefore, it is usually a good idea to wait a few minutes before attempting to re-upload the image.
You may have exceeded the WordPress memory limit if the error when uploading images continues. By connecting your website via FTP, you may expand the RAM. By including the following code snippet in your wp-config.php file, you may remedy the issue by raising the limit to 256MB.
define('WP_MEMORY_LIMIT', '256M');
Verify the PHP Version
Check your website’s PHP version. Problems will arise if you use anything older than version 7, especially if you’re using the most recent WordPress release. WordPress will work with earlier versions of PHP, although it officially recommends PHP 7.4 or above.
From your WordPress dashboard, go to Tools > Site Health to verify the version. Your server information may be found by clicking the Info tab and choosing the Server section.