Fixing WordPress media upload errors

How to fix WordPress media uploads failing with HTTP errors, permission problems or file size limits, covering uploads folder permissions, PHP limits, plugin conflicts and server restrictions.

Media uploads are one of those things that work perfectly for months and then stop without warning. You drag an image into the media library, the progress bar crawls to the end and, instead of a thumbnail, you get a red error message, or nothing at all.

Almost every upload failure comes down to one of four things: folder permissions, PHP limits, a plugin getting in the way or a server-level restriction. Working through them in that order usually finds the cause.

Start with the exact error message

The wording of the error usually tells you which cause you're dealing with. These are the messages WordPress itself uses:12

"Unable to create directory wp-content/uploads/2026/09. Is its parent directory writable by the server?" This is a permissions problem. WordPress can't create the month folder it wants to put your file in. Go to the permissions section below.

"The uploaded file could not be moved to wp-content/uploads/..." Also permissions, but one step later. The file reached the server and WordPress couldn't write it into place.

"The uploaded file exceeds the upload_max_filesize directive in php.ini." or "... exceeds the maximum upload size for this site." A PHP limit. Your file is bigger than the server is set up to accept.

"Sorry, you are not allowed to upload this file type." WordPress only allows a set list of file types by default. Common image, document, audio, video and archive formats are allowed, but others (SVG files, for example) aren't. This is deliberate rather than broken, since some file types can carry harmful code.

"The server cannot process the image..." WordPress shows this when the server runs out of resources while processing an image. The message itself suggests trying a smaller image, with a maximum of 2560 pixels.2 The PHP limits section below covers this.

"Unexpected response from the server. The file may have been uploaded successfully..." The general catch-all. It covers timeouts, memory problems, a security plugin blocking the request and server firewall rules. Check the media library first in case the file did upload, then work through the PHP limits and plugin sections. Older versions of WordPress showed a plain "HTTP error." for the same problems.

No message at all, and the upload simply fails. Check disk space, covered at the end of this article.

Check permissions on the uploads folder

WordPress needs to be able to write into wp-content/uploads. If it can't, uploads fail regardless of file size or type.

WordPress's own guidance is that folders should normally be 755 (or 750) and files 644 (or 640).3 Your host may use different values on purpose, so if you're not sure, ask them before changing anything.

If you do change them, connect via SFTP or your host's file manager, go to wp-content and set the uploads folder and the folders inside it to 755, and the files to 644. Most FTP clients have a "recurse into subdirectories" option. Make sure you apply 755 to folders only and 644 to files only, rather than one value to everything.

If you have SSH access and are comfortable using it, these commands do it correctly in one pass. Double-check the path before running them, since they change every file and folder under it:

find /path/to/wordpress/wp-content/uploads -type d -exec chmod 755 {} \;
find /path/to/wordpress/wp-content/uploads -type f -exec chmod 644 {} \;

You may see advice online suggesting 777. Don't use it. WordPress's documentation says no folders should ever be 777, even upload folders.3 It allows other users on the server to write to your uploads folder, which on shared hosting is a well-known route to someone planting a harmful file on your site.

If 755 doesn't help, the problem is often ownership rather than permissions. The uploads folder needs to be owned by the user that WordPress runs as, which varies between hosts.3 If files were restored from a backup, migrated from another host or created over SSH as a different user, ownership can end up wrong even though the permission numbers look correct. Your hosting provider can confirm the right owner and fix it.

Raise PHP's upload limits

If the error mentions file size, or larger images fail while smaller ones work, PHP's limits are probably too low for what you're uploading.

You can see your current limits under Tools → Site Health → Info, in the Server and Media Handling sections. Four values matter:

  • upload_max_filesize is the largest single file PHP will accept.
  • post_max_size is the largest total upload. It needs to be larger than upload_max_filesize.4
  • memory_limit is how much memory PHP can use, including while resizing images.
  • max_execution_time is how long a script can run before it's stopped.

A common mistake is raising upload_max_filesize alone. If post_max_size is still lower, the upload fails anyway, because the whole request is larger than the file inside it.

Many hosts let you change these in the control panel, often under a PHP Options or MultiPHP INI Editor section. That's the cleanest and safest place to change them. Make a note of the current values before you change anything, so you can put them back.

If your host doesn't offer that, don't copy php_value lines into .htaccess, as a lot of older guides suggest. They only work when PHP runs as an Apache module,5 and on the more common PHP-FPM, FastCGI and LiteSpeed setups they cause an immediate 500 internal server error. Our guide to fixing "The link you followed has expired" covers the safer options, including .user.ini files, or you can ask your host to change the limits for you.

If uploads still time out, the images may simply be too large for your server to process. Since version 5.3, WordPress automatically scales down images larger than 2560 pixels,6 so there's rarely a reason to upload full-size camera originals. Resizing images to the size your site actually displays them before uploading makes uploads faster and more reliable.

Your host may also have its own memory and time limits at server level that override what you set. If your changes don't seem to take effect, ask them.

Check for plugin conflicts

Plugins that hook into the upload process can cause upload errors. The most common culprits are image optimisation plugins (which process images during or after upload), security plugins (which may scan uploads) and plugins that add custom media handling.

If uploads stopped working after you installed or updated a plugin, try deactivating that plugin and testing the upload again. If you're not sure which plugin is responsible, deactivate plugins one at a time, testing the upload after each. Deactivating plugins on a live site switches their features off for visitors too, so do it on a staging copy or at a quiet time if you can.

If the upload fails inside the block editor with "The response is not a valid JSON response", try the same file in Media → Add New, which usually gives a clearer error. Our JSON response guide covers the editor side.

Security plugins deserve particular attention. Some scan uploads and can time out on larger files, or block file types they consider suspicious even when WordPress allows them. If deactivating a security plugin fixes the problem, reactivate it straight away and look in its settings for upload scanning, file type or request size options, rather than leaving it switched off.

Check for server-level restrictions

If you've ruled out PHP limits, permissions and plugins, a server firewall may be blocking the upload. Server firewalls (such as ModSecurity, which is common on shared hosting) inspect incoming requests and can block ones that look suspicious. Large uploads or files with certain content can sometimes trigger them.

Your hosting provider can check the server's firewall logs for blocked uploads and add an exception if a legitimate upload is being blocked. Firewall blocks often show up as a 403 forbidden error.

Some hosts also have their own upload size limits separate from PHP's, for example in the web server's settings. Your host can tell you whether that's the case and adjust it.

Check available disk space

If uploads fail without any error message, your hosting account may have run out of disk space. Check your hosting control panel for disk usage. If you're near your limit, you'll need to free up space before you can upload more files.

Common ways to free space include removing old backups stored on the server (after checking you have a recent copy stored somewhere else), clearing plugin and server caches, deleting unused themes and plugins and removing media you no longer need. Take a backup before deleting anything, and check media isn't still used on a page before you remove it. If you've outgrown your plan's storage, your host can tell you what options you have.

Need help with upload errors?

If media uploads keep failing after working through these steps, my freelance WordPress development and emergency WordPress support can help diagnose server configuration issues, fix permissions and resolve upload problems. For server settings you can't change yourself, your hosting provider is the best first contact.


  1. file.php, WordPress source code on GitHub. 

  2. script-loader.php, WordPress source code on GitHub.  

  3. Changing file permissions, WordPress Advanced Administration Handbook.   

  4. Description of core php.ini directives, PHP Manual. 

  5. How to change configuration settings, PHP Manual. 

  6. image.php, WordPress source code on GitHub. 

Adam Greenough

Written by Adam Greenough

Freelance web developer with over 15 years of experience building and fixing WordPress sites. I work with businesses across the UK on everything from emergency support to full builds.

Need emergency WordPress support today?

If your site is down, hacked or throwing errors, send me the details and I will assess the problem quickly. Support starts from £50, you will get a fixed quote before any work begins, and if I cannot fix the issue, you will not pay.