How to Fix Image Upload Issues in WordPress

This guide is for cPanel hosting. If your site is on Onyx Managed WordPress, you don't have cPanel, File Manager or Select PHP Version - PHP settings are changed a different way. See changing PHP settings using user.ini instead, and the rest of the advice below still applies.

If you're encountering problems uploading images, it’s often due to permission settings, file size limitations, or PHP configurations. Here's how to troubleshoot and resolve common issues.

1. File Permissions Issues

Incorrect file permissions on the uploads directory are a common cause for upload failures.

Fix: Correct Folder Permissions
  1. Access cPanel → File Manager → navigate to wp-content/uploads/.
  2. Set directory permissions to 755 for folders and 644 for files.

Command Line Fix (SSH)

find /home/your_user/public_html/wp-content/uploads/ -type d -exec chmod 755 {} \;
          find /home/your_user/public_html/wp-content/uploads/ -type f -exec chmod 644 {} \;

Two commands, because folders and files need different permissions. Running chmod -R 755 over the whole directory would make every image executable as well as readable, which you do not want in a folder the web server can write to.

2. Exceeded Maximum Upload File Size

Your hosting environment might restrict the maximum file upload size, which causes failures for large images.

Fix: Increase Max File Upload Size
  1. Log into cPanelSelect PHP Version → Click Options. See our guide on changing your PHP version, extensions and options if you have not used this screen before.
  2. Check upload_max_filesize and post_max_size. On Krystal shared hosting these are usually already 512M, which is far larger than any normal image - so if you see those values, your upload is failing for one of the other reasons below and there is nothing to change here. Do not lower them.
    • If they have been reduced at some point, put them back up, and check max_execution_time and max_input_time are set sensibly (300 is plenty).

3. PHP Memory Limit Exceeded

Insufficient PHP memory can cause uploads to fail, especially for large files or when the server is under load.

Fix: Increase PHP Memory Limit
  1. In cPanelSelect PHP VersionOptions, check memory_limit. It is normally 256M on Krystal shared hosting; raise it to 512M if you are working with very large images and you are still seeing failures.

4. Incorrect File Formats

WordPress supports JPG, PNG and GIF, and has also supported WebP since version 5.8 and AVIF since 6.5. If a WebP or AVIF file is refused, that is usually the server's image library rather than WordPress - check Tools → Site Health → Info → Media Handling to see which formats your site can actually process. SVG uploads are a different matter: they are blocked by default because an SVG can carry scripts.

Fix: Convert or Enable SVG Uploads
  1. For unsupported file types (e.g., SVG), use the Safe SVG plugin, which sanitises them first.
  2. Alternatively, convert files to supported formats like PNG or JPG.

5. Temporary Folder Missing

In certain cases, missing or inaccessible temporary folders can block uploads.

Fix: Define a Temporary Directory

Add the following to your wp-config.php:

define('WP_TEMP_DIR', '/home/your_user/public_html/wp-content/temp/');

Ensure the temp directory exists and is set to 755.

6. Browser Cache Issues

Sometimes, issues may arise from cached content preventing you from seeing uploaded files.

Fix: Clear Browser Cache

Clear your browser cache or check in a different browser or incognito mode.

7. LiteSpeed Caching Conflicts

LiteSpeed Cache can sometimes interfere with the upload process.

Fix: Purge LiteSpeed Cache
  1. From your WordPress dashboard, go to LiteSpeed CacheToolboxPurge All to clear the cache. If you do not have the plugin, our guide on installing the LiteSpeed cache plugin covers it.
  2. Also ensure object cache settings in LiteSpeed don’t conflict with uploads.

8. Plugin or Theme Conflicts

Sometimes a plugin or theme can cause upload errors, particularly if outdated or incompatible.

Fix: Disable Plugins or Switch Theme
  1. Disable all plugins temporarily and try uploading.
  2. If successful, re-enable them one by one to identify the culprit.
  3. If plugins are not the issue, switch to a default WordPress theme (Twenty Twenty-Five, or whichever ships with your version) and test again.

9. Permissions and Security Modules

Ensure that server security modules (such as ModSecurity) aren't blocking the upload process.

Fix: Disable ModSecurity Temporarily
  1. In cPanel, locate ModSecurity.
  2. Temporarily disable it for the domain and attempt the upload again.
  3. If this resolves the issue, adjust the security rules to allow uploads without blocking.


How did we do?

Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–