Why won't my images upload to WordPress? (the upload_max_filesize fix most guides get wrong)
TL;DR: Raising upload_max_filesize alone frequently does not fix upload failures because two other PHP settings, post_max_size and memory_limit, also need to be large enough to accommodate the same file, and if any one of the three is left at a lower default, the upload still fails despite the first setting being "correctly" raised. Separately, a meaningful share of upload failures have nothing to do with file size limits at all and instead trace back to incorrect file or folder permissions on wp-content/uploads.
Why raising one setting alone often doesn't work
Most troubleshooting guides for WordPress upload failures focus entirely on upload_max_filesize, the PHP setting that directly caps the maximum size of an individual uploaded file, and stop there. This is necessary but frequently not sufficient, because PHP's request handling involves two additional settings that constrain the same upload from different angles, and WordPress's own defaults do not always keep all three in sync automatically when only one is manually changed.
If you raise upload_max_filesize to, say, 64MB, but post_max_size (which caps the total size of an entire form submission, including the file plus any other form data) is still left at its previous, lower default, uploads of files close to that new limit will still fail, because the overall request exceeds post_max_size even though the individual file is technically under the newly raised upload_max_filesize.
The three settings that all need to agree
upload_max_filesize caps the maximum size of a single uploaded file directly. This is the setting most guides mention and the one most people change first.
post_max_size caps the total size of the entire HTTP POST request, which includes the uploaded file plus any accompanying form data (which is typically small but nonzero). This value should always be set equal to or, more safely, slightly larger than upload_max_filesize, since a post_max_size smaller than or equal to upload_max_filesize can silently truncate or reject uploads that are technically within the file size limit but push the total request size over this second, separate cap.
memory_limit caps how much memory a single PHP script execution can use, and image processing specifically, generating thumbnails, resizing, any manipulation WordPress performs on an uploaded image, consumes memory proportional to the image's dimensions and complexity, not just its file size. A large, high-resolution image can exceed a low memory_limit during processing even if the raw file size itself is comfortably within both of the above limits, producing a different failure (often a blank page or a memory exhaustion error, covered in our memory exhausted fatal error guide) rather than an explicit "file too large" message.
How to check and change all three correctly
Check your current values via Media → Add New in the WordPress admin, which displays the current maximum upload size (this reflects the lower of upload_max_filesize and post_max_size as currently configured), or more precisely by creating a small PHP info file temporarily, or checking your hosting control panel's PHP settings page directly if available.
To change them: on hosts offering a PHP settings panel (common with cPanel-based hosting), this is usually the most direct method, a dedicated interface for adjusting these three values without editing configuration files by hand. Alternatively, adding directives to a .htaccess file (on Apache-based hosting) or a php.ini/user.ini file in your site's root can work depending on your specific hosting configuration, though not all hosts allow overriding these via .htaccess, in which case a hosting-level change or a request to your host's support is necessary instead.
Whichever method you use, change all three together rather than one at a time, and set post_max_size to a value larger than upload_max_filesize (a common convention is post_max_size roughly 10-20% larger), and memory_limit generously above both, since image processing memory needs scale with resolution in ways not directly tied to the file's raw byte size.
The other cause: permissions
A meaningful share of upload failures, particularly ones that show a generic "unable to create directory" or "unable to write to file" error rather than anything mentioning file size, have nothing to do with any of the three settings above and instead stem from incorrect file system permissions on the wp-content/uploads directory, or a specific dated subfolder within it that WordPress cannot write to.
WordPress needs write access to wp-content/uploads (and the year/month subfolders it creates automatically within it) for the web server process to save uploaded files there. If these permissions were set incorrectly, commonly after a migration, a manual file transfer that did not preserve original permissions, or a security hardening step that was applied too broadly, uploads fail regardless of how generously the PHP size limits above are configured.
The standard correct permission level for WordPress directories is 755 (readable and executable by everyone, writable only by the owner), and 644 for individual files; a permissions issue is usually fixable by resetting wp-content/uploads (and its subfolders, recursively) to these standard values via your FTP client or hosting file manager's permissions tool.
How to tell which cause you actually have
The specific error message WordPress or your browser shows is the fastest differentiator. A message explicitly referencing file size ("exceeds the maximum upload size," or similar) points directly at the PHP settings covered above. A message about being "unable to create directory" or "unable to write to file," or the upload simply failing silently with no clear size-related message at all, points at permissions instead. A blank page or a memory exhaustion error during upload, rather than an explicit rejection message, points at the memory_limit component specifically, distinct from the file-size-focused settings.
A comparison table
| Symptom | Likely cause | Where to look |
|---|---|---|
| "Exceeds the maximum upload size" message | upload_max_filesize or post_max_size too low | PHP settings, check both together |
| Upload fails on large, high-resolution images specifically | memory_limit too low for processing | PHP memory_limit setting |
| "Unable to create directory" or "unable to write to file" | Permissions issue | wp-content/uploads folder/file permissions |
| Upload fails silently with no clear message | Could be any of the above | Check browser console/network tab for the actual server response |
| Works for small images, fails only on large ones | Combination of size limits and/or memory | Check all three PHP settings together |
Other less common causes
A security plugin or web application firewall blocking certain file types or a specific upload pattern it has flagged as suspicious, worth checking if the failure is specific to a particular file type or name pattern rather than universal. A disk space limit on the hosting account being reached, which produces write failures similar in symptom to permissions issues but requires freeing up or increasing storage rather than adjusting permissions. And, rarely, a corrupted or unusually formatted image file itself failing WordPress's own file validation, worth testing with a different, known-good image file to rule out.
FAQs
I raised upload_max_filesize but uploads still fail on files under that new limit. Why?
Check post_max_size specifically; if it was not raised alongside upload_max_filesize and is still at a lower previous value, the overall request size cap it enforces can block an upload that is technically within the individually-raised file size limit but exceeds this separate, still-lower total request cap.
How do I check my current PHP settings without server access?
Create a simple PHP file containing <?php phpinfo(); ?>, upload it to your site temporarily, and visit it directly in a browser to see all current PHP configuration values including all three settings discussed here; delete this file immediately after checking, since it exposes server configuration details that should not remain publicly accessible.
Can my hosting provider limit how high I can raise these settings?
Yes, particularly on shared hosting, where hosts often cap the maximum values you can set for these settings to protect overall server resources shared across many accounts; if you consistently need higher limits than your host allows, this is a legitimate reason to consider a VPS or a hosting tier with more configurable resource limits.
Does compressing my images before upload help avoid this issue entirely?
Yes, reducing file size and dimensions before upload (using an image compression tool or your camera/phone's own size settings) reduces demand on all three PHP settings simultaneously, and is a reasonable practical workaround alongside, or even instead of, raising server-side limits, particularly for images larger than what your page layouts actually need to display.
Is 755 permissions always correct for the uploads folder, or does it vary by host?
755 for directories and 644 for files is the standard WordPress recommendation and works correctly on the overwhelming majority of hosting configurations; some more tightly locked-down or unusual hosting environments may have slightly different specific requirements, in which case your host's documentation or support can confirm the exact correct values for their particular server setup.
Can a CDN in front of my site cause upload failures?
Generally not directly, since file uploads typically go straight to your origin server rather than through the CDN's caching layer, but if your CDN or a WAF sitting in front of your site has its own separate file size or request size limits configured, those could independently block an upload that would otherwise succeed at the origin server level, worth checking as a secondary possibility if origin-level settings all look correctly configured.
Why does this happen more often after a site migration?
Permissions specifically are a very common casualty of migrations, since some file transfer methods do not preserve the exact original permission settings, and a restored backup or a fresh file copy can end up with permissions that differ from what the original, working site had, making a permissions check a good first step to include as standard practice after any migration.
Conclusion
Image upload failures in WordPress have two largely independent root causes that require different fixes: PHP configuration limits (three settings that all need to be raised together, not just one) and file system permissions on the uploads directory (unrelated to size limits entirely). The specific error message you see is the fastest way to tell which category you are dealing with before spending time on the wrong fix.
Raise upload_max_filesize, post_max_size, and memory_limit together rather than one at a time if the issue is size-related, and check wp-content/uploads permissions directly, especially after any recent migration, if the error mentions being unable to write or create a directory rather than referencing file size.
HostCloud's hosting plans ship with generous default upload and memory limits sized for real media libraries, and our support team helps diagnose whether a specific upload failure is a settings issue or a permissions issue rather than leaving you to guess. Plans start at ₹99 a month at https://hostcloud.in.
