Trying to upload an image in WordPress and getting an error? “Image upload failed,” “HTTP error,” “exceeds the maximum upload size” — these messages are frustrating when you’re just trying to add a photo to your site.
This guide covers every WordPress image upload error and exactly how to fix each one.
Error 1: “HTTP Error” During Image Upload
The generic “HTTP error” during upload is the most common and can have several causes.
Fix A: Regenerate Media Settings
Go to Settings → Media in WordPress. Without changing anything, click Save Changes. This refreshes media settings and often resolves the HTTP error immediately.
Fix B: Disable Image Compression Plugins Temporarily
Some image optimisation plugins (Smush, Imagify) conflict with uploads. Temporarily deactivate them, try uploading, and reactivate one by one to identify the conflict.
Fix C: Increase PHP Memory Limit
Add this to your wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
Fix D: Check Server Error Log
The HTTP error is vague — your server error log has the real message. Check error_log in your root directory or in your hosting panel under Logs. Look for “PHP Fatal error” or “permission denied.”
Error 2: “Exceeds the Maximum Upload Size”
WordPress’s default maximum upload size is often 2MB — too small for high-resolution photos. Fix it by increasing the limit.
Fix A: Edit php.ini
Create or edit php.ini in your WordPress root:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Fix B: Edit .htaccess
php_value upload_max_filesize 64M
php_value post_max_size 64M
Fix C: Via Hosting Panel
Most hosts (Hostinger, cPanel) let you change PHP limits in the control panel under PHP Configuration or PHP Settings. Change upload_max_filesize to 64M.
Error 3: Incorrect File Permissions
If WordPress can’t write to the uploads folder, images fail silently. Correct permissions:
/wp-content/uploads/folder should be 755- Files inside should be 644
Fix via FTP — right-click the uploads folder, select File Permissions, set to 755, and apply recursively to all files and folders.
Error 4: “The Uploaded File Could Not Be Moved”
This means WordPress doesn’t have write access to the uploads directory. Two causes:
- Wrong file permissions — fix as above
- Wrong file ownership — if your server runs PHP under a different user than your files, uploads will fail. Contact your host to ensure your WordPress files and PHP process use the same user.
Error 5: Missing or Incorrect uploads Folder
Go to Settings → Media and check the upload path. It should be blank (WordPress uses the default) or set to wp-content/uploads. If it points to an incorrect path, clear it and save.
Also verify the uploads folder exists at /wp-content/uploads/ via FTP. If it doesn’t exist, create it with 755 permissions.
Error 6: Plugin or Theme Conflict
Deactivate all plugins and switch to a default theme (Twenty Twenty-Four) and test the upload. If it works, a plugin or theme was interfering. Reactivate one by one to identify the culprit.
Prevent Future Upload Errors
- Compress images before uploading — use tools like TinyPNG or Squoosh
- Resize images to display dimensions before upload (e.g., max 1920px wide)
- Keep plugins updated to avoid compatibility issues
- Keep PHP updated to 8.1 or 8.2 for best compatibility
Still Stuck?
If none of these fixes resolve your upload issue, the problem may be server-level. At debrajx, we diagnose and fix WordPress errors quickly. Contact us for fast support.
Error 4: “The Uploaded File Exceeds the Maximum Upload Size”
This error means your image is larger than the server’s maximum allowed upload size. Here’s how to fix it:
Method 1: Increase via php.ini
If you have cPanel access, go to cPanel → PHP Selector → Options and increase upload_max_filesize to 64M and post_max_size to 128M. Save changes and try uploading again.
Method 2: Add to wp-config.php
Open your wp-config.php file via FTP or File Manager and add these lines just before /* That's all, stop editing! */:
@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '128M' );
@ini_set( 'memory_limit', '256M' );
@ini_set( 'max_execution_time', '300' );
@ini_set( 'max_input_time', '300' );
Method 3: Edit .htaccess
Add these lines to your .htaccess file (located in your root WordPress directory):
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
Error 5: “File Type Not Permitted” or “Sorry, This File Type Is Not Permitted”
WordPress restricts which file types can be uploaded for security reasons. By default, it allows common image formats (JPEG, PNG, GIF, WebP, SVG is blocked by default). If you need to upload an SVG or other file type, you need to explicitly allow it.
Add this to your theme’s functions.php or a WPCode snippet to allow SVG uploads:
function allow_svg_upload($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'allow_svg_upload');
Note: Only allow SVG uploads if you trust all users who can upload files to your site. SVG files can contain malicious code.
Error 6: Images Upload But Don’t Display
Sometimes images upload successfully but show a broken image icon on the front end. This is almost always a file permissions issue.
Correct WordPress File Permissions
- Folders: 755 (or 750)
- Files: 644 (or 640)
- wp-config.php: 440 or 400
Connect via FTP (FileZilla is free), navigate to wp-content/uploads, right-click → File Permissions, set to 755 for folders and apply recursively. Then set files to 644.
How to Optimise Images Before Uploading to WordPress
The best way to avoid upload errors is to properly prepare images before uploading. Here’s a quick checklist:
- Resize first: For blog posts, images should be 1200×630px maximum. Use Canva or Squoosh.app to resize.
- Compress: Use Squoosh.app (free, browser-based) to reduce file size before uploading.
- Use WebP format: WebP images are 25-35% smaller than JPEG at the same quality. WordPress supports WebP from version 5.8+.
- Recommended plugins: Smush or ShortPixel can auto-compress images on upload without quality loss.
Quick Troubleshooting Checklist
Work through this list when you encounter any WordPress image upload error:
- Increase PHP memory limit to 256M in wp-config.php
- Increase upload_max_filesize to 64M
- Temporarily deactivate all plugins and retry
- Switch to a default theme (Twenty Twenty-Four) and retry
- Check wp-content/uploads folder permissions (should be 755)
- Rename the uploads folder and let WordPress recreate it
- Clear all caches (plugin cache, browser cache, CDN cache)
- Contact your hosting provider — some hosts have aggressive upload restrictions
Still stuck? Contact us for professional WordPress support. We fix image upload errors same day.