How to Fix WordPress Image Upload Issue

What Is a WordPress Image Upload Issue?

WordPress image upload issues occur when you try to upload images (or other media files) through the WordPress media uploader, but the upload fails. You’ll see error messages like:

  • “The uploaded file could not be moved to wp-content/uploads”
  • “HTTP error”
  • “An error occurred uploading your file”
  • “Unable to create directory wp-content/uploads/yyyy/mm”
  • “The file is too large”
  • “No such file or directory”

The image upload functionality appears broken—you can’t add images to posts, update your avatar, or install themes with bundled images. Sometimes uploads work for small files but fail for large ones. Other times uploads fail for specific file types (WebP, SVG) while others work fine.

The frustrating part is that WordPress doesn’t usually tell you exactly what went wrong, just that it failed.


Common Causes of Upload Issues

  • Incorrect file permissions — WordPress can’t write to uploads directory
  • Disk space full — Server storage is at capacity
  • Memory limit too low — Image processing requires more PHP memory
  • Upload file size limit exceeded — Server has max upload size restrictions
  • Plugin conflict — Security or compression plugin interfering with uploads
  • Corrupted uploads directory — .htaccess or index.php file blocking access
  • Missing GD library — PHP image processing extension not installed
  • File type restrictions — Server blocking certain image formats
  • Execution time limit — Large file processing times out before completion
  • Suhosin restrictions — Server firewall blocking certain operations

Solution 1: Check File Permissions on Uploads Directory

This is the #1 cause of upload issues. WordPress needs write access to the uploads folder.

Correct permissions:

  • /wp-content/uploads/ directory: 755

Via FTP:

  1. Connect via FTP
  2. Navigate to /wp-content/
  3. Right-click uploads folder
  4. Select “File Permissions” or “Change Permissions”
  5. Enter 755
  6. Check “Apply to directories only”
  7. Click OK

Via SSH:

cd /home/username/public_html/wp-content
chmod -R 755 uploads

After fixing permissions, try uploading an image again. This fixes about 60% of upload issues.


Solution 2: Increase Upload File Size Limit

WordPress has multiple file size restrictions. If you’re uploading large images, you need to increase limits.

Method 1: Edit php.ini

Create or edit /php.ini in your WordPress root:

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
memory_limit = 256M

Method 2: Edit .htaccess

Add to your .htaccess:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value memory_limit 256M

Method 3: Edit wp-config.php

Add before /* That's all, stop editing! */:

define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
define('WP_FILESIZE_MAX_UPLOAD', 128 * 1024 * 1024); // 128MB

Method 4: Check hosting control panel

  1. Log in to cPanel or hosting dashboard
  2. Find “PHP Configuration,” “PHP Settings,” or “MultiPHP INI Editor”
  3. Update these values:
    • upload_max_filesize → 128M
    • post_max_size → 128M
    • memory_limit → 256M

Test uploading after making changes.


Solution 3: Check Available Disk Space

If server storage is full, uploads fail.

Via cPanel:

  1. Log in to cPanel
  2. Look at the disk usage meter (top right)
  3. If at 100%, you’re out of space
  4. Delete old backups, unused plugins, or cache files
  5. Or upgrade your hosting plan

Via SSH:

df -h

Look for your WordPress directory. If it shows 100% usage, you’re full.

What to delete to free space:

  1. Old backup files in /home/username/backups/
  2. Unused plugins and themes in /wp-content/
  3. Cache files if using caching plugins
  4. Old WordPress installation copies
  5. Log files that accumulated over time

Solution 4: Enable Debugging to See Exact Error

WordPress debug mode reveals the precise reason uploads fail.

  1. Open wp-config.php via FTP
  2. Add before /* That's all, stop editing! */:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
  1. Save the file
  2. Try uploading an image
  3. Check /wp-content/debug.log for error messages

The debug.log will show specific issues:

  • “mkdir(): Permission denied”
  • “No such file or directory”
  • “Allowed memory size exhausted”
  • “The uploaded file exceeds upload_max_filesize”

Solution 5: Disable Plugins Temporarily

Plugins can interfere with image uploads, especially security and compression plugins.

Via WordPress:

  1. Go to Plugins → Installed Plugins
  2. Deactivate all plugins
  3. Try uploading an image
  4. If it works, reactivate plugins one by one to find the culprit

Via FTP (if locked out):

  1. Rename /wp-content/plugins/ to /wp-content/plugins-disabled/
  2. Create new empty /wp-content/plugins/ folder
  3. Try uploading
  4. If it works, move plugins back one by one

Common problematic plugins:

  • Security plugins (Wordfence, iThemes Security) blocking uploads
  • Image compression plugins (Smush, ShortPixel) with aggressive settings
  • Cache plugins with upload restrictions
  • Custom code snippets plugins with errors

Solution 6: Check GD Library (Image Processing)

WordPress uses PHP’s GD library to process images. Without it, uploads fail.

Check if GD is installed:

Create phpinfo.php:

<?php phpinfo(); ?>

Visit yoursite.com/phpinfo.php, search for “GD” section. If it exists and shows “GD Support: enabled,” you’re good.

If GD is missing:

  1. Contact hosting support: “Can you enable the PHP GD library?”
  2. Most hosts can enable it immediately
  3. For VPS/dedicated: Install via SSH:
sudo apt-get install php8.1-gd
sudo systemctl restart apache2

(Replace php8.1 with your PHP version)


Solution 7: Create Uploads Directory If Missing

Sometimes the uploads folder gets deleted accidentally.

  1. Via FTP, navigate to /wp-content/
  2. Check if uploads folder exists
  3. If not, create it manually
  4. Set permissions to 755

Via SSH:

mkdir -p /home/username/public_html/wp-content/uploads
chmod 755 /home/username/public_html/wp-content/uploads

WordPress automatically creates year/month subdirectories inside uploads when you first upload.


Solution 8: Check .htaccess in Uploads Directory

An .htaccess file in the uploads folder might block access or image processing.

  1. Via FTP, navigate to /wp-content/uploads/
  2. Look for .htaccess file
  3. If it exists and contains blocking rules, delete it
  4. Test uploading

WordPress should recreate a safe version automatically.


Solution 9: Check File Type Restrictions

Some servers block certain image formats (especially newer ones like WebP or SVG).

Add support for more file types to wp-config.php:

// Allow WebP
add_filter('upload_mimes', function($mimes) {
    $mimes['webp'] = 'image/webp';
    return $mimes;
});

// Allow SVG (use with caution - security risk if not sanitized)
// Only if you trust your users
add_filter('upload_mimes', function($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    return $mimes;
});

Or ask your hosting provider to whitelist these file types.


Solution 10: Increase Execution Time Limit

Large image uploads need time to process. If processing times out, uploads fail.

Add to wp-config.php:

define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
set_time_limit(600); // 10 minutes

Or add to .htaccess:

php_value max_execution_time 600
php_value memory_limit 256M

This gives image processing 10 minutes instead of the default 30 seconds.


Solution 11: Check for Suhosin Restrictions

Some servers use Suhosin (PHP hardening extension) that blocks file operations.

Add to .htaccess:

<IfModule mod_suhosin.c>
suhosin.upload.max_uploads = 100
suhosin.post.max_vars = 5000
suhosin.request.max_vars = 5000
</IfModule>

Or contact hosting support to disable Suhosin if it’s causing persistent issues.


Solution 12: Test with a Simple Image

If uploads work for some files but not others, the issue might be file-specific.

Test upload:

  1. Create a very small image (10×10 pixels, under 1KB)
  2. Save as test.jpg
  3. Try uploading it
  4. If it works, the issue is with larger or specific file types
  5. If it fails, the issue is with the upload system itself

This helps narrow down whether it’s a file size limit or a permission issue.


Prevention Tips

  • Set correct permissions (755) on uploads directory from the start
  • Don’t install plugins or themes inside the uploads folder
  • Keep disk space above 20% free (don’t run at 100% capacity)
  • Optimize images before uploading (use TinyPNG, ImageOptim)
  • Use a CDN for large media libraries (offload file serving)
  • Regular backups of uploads directory
  • Monitor upload speeds and sizes regularly
  • Use image optimization plugins (Smush, ShortPixel) after uploads, not before

From experience: A client once couldn’t upload images larger than 2MB. Their hosting plan had a 5MB limit, but they didn’t know about it until I checked the control panel. One setting change in cPanel fixed the entire problem in 30 seconds. Always check hosting limits before troubleshooting.

Related: If you encounter other WordPress errors alongside upload issues, check How to Fix WordPress Memory Exhausted Error or How to Fix WordPress 500 Internal Server Error for additional troubleshooting steps.


Conclusion

WordPress image upload issues are usually caused by file permissions, memory limits, or disk space. Check permissions on the uploads directory first (755), then increase memory and file size limits if needed. Enable debug mode to see the exact error if simple fixes don’t work. Most upload problems are solved within 5 minutes once you identify the root cause. The key is understanding that WordPress needs both permission to write files and enough server resources to process them.

Leave a Comment