The image upload issue is one of the most irritating errors of WordPress. For most of the beginner image upload errors can be quite complex because it occurs without doing anything different. But it is quite easy to fix this image upload error in WordPress. Have a look at how WordPress display this error (screenshot below)
How to fix the image upload error?
There are 2 different scenarios you have to focus on. Check whether the image upload issue occurs for all images that are already available in the library or for only one image?
If it is occurring for all images then you can try the following solution:
- Change the file permission
- Deactivate plugin
- Increase the memory limit
- Remove file path for media settings
And if it occurs for only one image then you can resolve it by following methods:
- Rename the image
Let’s discuss them in detail and resolve the issue of image upload in WordPress.
1. Change file permissions
It might possible that when your host makes an update on your server they affect your site file permissions which causes the image upload error in wordpress. To change your file permissions do the following steps:
- Access your site through FTP
- Access your site files and open site root directory
- Open your wp-content folder, you will find your upload folder init
- Right-click on Upload folder and select file permissions
- Set the numeric value to 744 (note of the numeric value that is already there)
- Select the Apply to the directory only radio button
- Click on the Ok button to save changes.
Try these steps and if it doesn’t work for you then move to the next solution.
2. Deactivate Plugins
If you are using the plugin to optimize your images, deactivate it before uploading the image and see if that fixes the error or not? Simply deactivate the plugins by going to the plugin list in your dashboard. This will deactivate all plugins. If this fixes your issue that means one of your plugins is the cause of this error. Now activate them one by one, reload your site after each activation and note when your image begins to upload then that is a misbehaving plugin. Reach out the plugin developer for help.
Continue to the next solution if deactivating plugins doesn’t work for you.
3. Increase PHP memory limit
It might possible that you can not upload the image due to the PHP memory limit. To resolve this issue you have to increase the PHP memory limit. For this purpose, you have to add the following line of code to your wp-config.php file.
You can also use the .htaccess file in your wordpress root directory to increase the memory limit. Simply add the following line in it.
php_value memory_limit 64M
4. Remove File Path from Media Settings
If the above solutions don’t work for you then try this solution to resolve the issue of image upload error in wordpress. Remove the file path from your media library page. To do this follow these steps:
- Sign in to your admin area
- Open your settings menu and select media library
- If you see a file path with a textbox displaying where the files should be uploaded to, delete the text in the file path textbox
- Click on save button to save your changes
Refresh your site and try to upload the image again.
5. Rename your file
If you are facing this issue with one image, then try this solution it is easier than previous solutions. Try to rename your file on your computer before uploading it to WordPress. Keep in mind these three things:
- Make sure that there are no apostrophes in your file name which can cause this error.
- Make sure your file names are written in lowercase letter
- Change your file type e.g from .jpg to .png file
Try these solutions to resolve the issue of image uploading in WordPress. if you have any questions regarding this article or you face any difficulty in resolving this image uploading issue in wordpress mention it in comments.