HoganHost blog

[email protected]

WordPress Can’t Upload Images? Here’s How to Fix It

Are you having difficulty uploading media to your WordPress website?

This issue may seem to come out of nowhere. Often, making changes to a website on WordPress can cause the problem of failing to upload images. It will need some troubleshooting to find out why media files aren’t uploading to WordPress. But it is easy to fix this problem.


Issues Uploading a Single File

If all the files upload except for one, it is most likely one of two errors:

The file size is too large

If the file size is too large, increase the maximum upload size, especially when uploading images. The best option to solve this issue is to go to your site’s root directory and create a php.ini file.

Upload the php.ini file to the appropriate WordPress folder to allow a larger image size. Add these lines of text to the php.ini file to make adjustments to the file size limit:

upload_max_filesize = 128M post_max_size = 128M max_execution_time = 300These changes will increase the image upload size limit.

Also Read How to Increase the Maximum File Upload Size in WordPress

Invalid Image File Name

The file name may be causing WordPress image upload issues. Especially if it contains special characters ($, *, &, # …) or accent letters (ñ, á, é).

If this is the case, rename the file and remove special characters or accent letters. Then upload the file to WordPress again.

Issues Uploading Images to Your Media Library

The following error may appear when uploading an image file:

‘Unable to create directory wp-content/uploads/2023/04. Is its parent directory writable by the server?’

There may also be blank images instead of the original images in the WordPress media library. This is most likely an error with the upload folder.

Ensuring the upload folder has the right permissions will likely fix this issue.

Kindly Login to your cpanel to change the file permission:

  1. Login to cpanel
  2. locate file manager
  3. click on public html
  4. Go to the /wp-content/ folder after connecting to your website through FTP. Then access your wp-content uploads within the uploads folder.
  5. Right-click on the uploads directory and select File Permissions.                                               
  6. In the file permissions dialog box, type 755 into the numeric value field. 

Now click on Change permission

Having changed the file permissions, access the WordPress admin area. Try to upload an image file again.

Kindly check out our cheap and reliable shared hosting hoganhost.com.ng

Leave a Comment

Your email address will not be published. Required fields are marked *