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
- Access cPanel → File Manager → navigate to
wp-content/uploads/
. - 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
- Log into cPanel → Select PHP Version → Click Options.
- Adjust
upload_max_filesize
andpost_max_size
to at least 64M.- Ensure
max_execution_time
andmax_input_time
are set appropriately (e.g., 300).
- Ensure
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
- In cPanel → Select PHP Version → Options, 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
- For unsupported file types (e.g., SVG), use the Safe SVG plugin to safely allow uploads.
- 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
- From your WordPress dashboard, go to LiteSpeed Cache → Manage → Purge All to clear the cache.
- 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
- Disable all plugins temporarily and try uploading.
- If successful, re-enable them one by one to identify the culprit.
- 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
- In cPanel, locate ModSecurity.
- Temporarily disable it for the domain and attempt the upload again.
- If this resolves the issue, adjust the security rules to allow uploads without blocking.