How to Fix Image Upload Issues in WordPress

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)

chmod -R 755 /home/your_user/public_html/wp-content/uploads/

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.
  2. Adjust upload_max_filesize and post_max_size to at least 64M.
    • Ensure max_execution_time and max_input_time are set appropriately (e.g., 300).

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, set the memory_limit to 256M or 512M if needed.

4. Incorrect File Formats

WordPress only supports common formats like JPG, PNG, and GIF. SVG uploads are blocked by default due to security risks.

Fix: Convert or Enable SVG Uploads
  1. For unsupported file types (e.g., SVG), use the Safe SVG plugin to safely allow uploads.
  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 CacheManagePurge All to clear the cache.
  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 (e.g., Twenty Twenty-Three) 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–