Common causes
- PHP memory_limit too low to resize a large, high-resolution image
- Imagick using too many threads or hitting resource limits on shared hosting
- max_execution_time reached while creating many thumbnail sizes
- Too many registered image sizes from the theme and plugins
- Unusual image formats or color profiles (CMYK, very large PNGs)
- A security rule (ModSecurity, WAF) blocking the async-upload.php request
How to fix it
- Try a smaller image. Resize the image to about 2560 pixels wide and save it as a standard RGB JPEG. If that uploads, the problem is resources or the image itself.
- Raise the memory limit. Add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php and set memory_limit = 256M in php.ini. Image editing in wp-admin uses WP_MAX_MEMORY_LIMIT, which defaults to 256M.
- Limit Imagick threads. Add SetEnv MAGICK_THREAD_LIMIT 1 to .htaccess on Apache, or set it in the PHP-FPM pool with env[MAGICK_THREAD_LIMIT] = 1. This often fixes uploads on shared hosting.
- Switch to the GD editor. Add a small plugin or mu-plugin that puts WP_Image_Editor_GD first in the wp_image_editors filter. GD uses less memory for some images.
- Check logs for blocks. Look at the browser network tab for the async-upload.php response and check the server error log. A 403 or ModSecurity entry means a firewall rule is blocking uploads.
mu-plugin: prefer GD over Imagick for image processing
<?php
// wp-content/mu-plugins/prefer-gd.php
add_filter( 'wp_image_editors', function () {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
} ); How to stop it happening again
- Resize photos before uploading them
- Remove unused image sizes registered by themes and plugins
- Keep memory_limit at 256M or more on media-heavy sites
- Use RGB JPEG or WebP for web images