WordPress: Image Upload errors or cannot set featured image
When uploading an image to the media library, you may get an HTTP error or 0 file size, or notice the image is never set or appears broken.
This is usually due to one of the following:
- The image you are uploading is too large
- Your connection is timing out before the file is received on your server (slow internet, server issues, etc)
- The permissions set on your uploads folder or a security plugin is preventing the uploads from saving
- You deleted the original and are trying to replace it, and caching is preventing the new image from being set.
Verify your images
Ensure images you upload are less than 2MB in file size or that your max file size is large enough. On WordPress MultiSite, this is set by the Nework administrator in the Site settings. On single installs, this is defined by your server’s PHP configuration and defaults to 2MB.
Turn off caching
If you have caching enabled via a plugin, clear the cache and then temporarily deactivate the plugin, then try again.
If you have a security plugin installed that changes your .htaccess rules, reset or restore your original .htaccess, temporarily deactivate the plugin and try again.
Some hosts offer these services server-side, such as Dreamhost’s Enhanced Security and Cloudflare. If you know these are enabled, try disabling them temporarily, wait at least 10 minutes, then try again.
Verify server permissions
- Connect to your site with an FTP client
- Ensure your wp-content/uploads folder is CHMOD to 755 or 777 and all sub-directories are the same.
- See Changing Persmissions on the WordPress Codex for detailed steps
Did you know?
Our friends at Jetpack are doing some incredible work to improve the WordPress experience. Check out Jetpack and improve your site's security, speed and reliability.