The Media Library Shows “Unable to Create Directory” for New Uploads

You drag an image into the Media Library. The upload bar fills. Then it stops. A red error appears:

“Unable to create directory. Is its parent directory writable by the server?”

Your media uploads are broken. New images, PDFs, and files won’t go through. Old media still works — but nothing new.

This error is frustrating, but it has a small set of known causes. This guide walks you through exactly how to fix it.

Table of Contents

  1. What the Error Actually Means
  2. The 5 Most Common Causes
  3. Step-by-Step Fixes
  4. Prevention Tips

1. What the Error Actually Means

WordPress organizes uploads by year and month. When you upload a file, it tries to create a folder like:

/wp-content/uploads/2024/03/

The error “Unable to create directory” means WordPress cannot create that month’s folder.

What WordPress is trying to do:

  1. Check if /wp-content/uploads/ exists
  2. Check if /wp-content/uploads/2024/ exists
  3. Check if /wp-content/uploads/2024/03/ exists
  4. If any are missing, create them
  5. If creation fails → error

The server says: “I don’t have permission to create that folder.”

2. The 5 Most Common Causes

CauseLikelihoodQuick Test
Wrong folder permissionsHIGHUpload folder is not writable
Wrong folder ownershipMEDIUMFile owner ≠ web server user
Disk space fullMEDIUMHost says storage is maxed
Missing uploads folderLOW/uploads/ doesn’t exist at all
PHP directory creation disabledVERY LOWRare hosting restriction

3. Step-by-Step Fixes

Follow these in order. Test after each step.

Fix #1: Check and Fix Folder Permissions (Most Common)

WordPress needs the /wp-content/uploads/ folder to have the right permissions.

Correct permissions:

  • Folders: 755
  • Files: 644

How to check via FTP (FileZilla, etc.):

  1. Connect to your site via SFTP/FTP
  2. Navigate to /wp-content/
  3. Right-click the uploads folder → File Permissions
  4. Set numeric value to 755
  5. Check “Recurse into subdirectories”
  6. Select “Apply to directories only”
  7. Click OK

Then fix file permissions inside:

  1. Right-click the uploads folder again → File Permissions
  2. Set numeric value to 644
  3. Check “Recurse into subdirectories”
  4. Select “Apply to files only”
  5. Click OK

Via hosting File Manager (cPanel, etc.):

  1. Open File Manager
  2. Navigate to public_html/wp-content/
  3. Right-click uploads → Change Permissions
  4. Set to 755 for folders, 644 for files (most file managers have a recursive option)

Why 755? The web server needs write access to create new folders. 755 gives the owner (server) full control, and others read/execute access.

Fix #2: Check and Fix Folder Ownership

Permissions can be correct, but if the wrong user owns the files, the web server still can’t write.

How to check (if you have SSH access):

bash

ls -la /path/to/wp-content/

Look for the owner and group of the uploads folder. It should match the user running the web server (often www-datanobody, or your hosting username).

How to fix (SSH):

bash

cd /path/to/wp-content/
chown -R www-data:www-data uploads/

(Replace www-data:www-data with your server’s correct user:group.)

No SSH access? Contact your hosting support. Ask them:

“My WordPress uploads folder is not writable. Can you check the ownership of /wp-content/uploads/ and ensure the web server user owns it?”

Fix #3: Check Disk Space

If your hosting account is out of space, WordPress cannot create new directories or files.

How to check:

  • cPanel: Look for “Disk Usage” on the home page
  • Managed hosting (Kinsta, WP Engine, Cloudways): Check your dashboard for storage metrics
  • Ask support: Most hosts will tell you instantly

How to free up space:

  • Delete old backups (keep only 2-3 recent)
  • Remove unused plugins and themes (not just deactivate — delete)
  • Clear old media files via Media Library (sort by “Uploaded to” and remove unused)
  • Delete old post revisions (use a plugin like “Advanced Database Cleaner”)
  • Clear expired transients
  • Move large files (videos, PDFs) to external storage (YouTube, Google Drive, etc.)

Quick SQL to count revisions (for reference):

sql

SELECT COUNT(*) FROM wp_posts WHERE post_type = 'revision';

Fix #4: Create the Uploads Folder Manually

Sometimes the /uploads/ folder doesn’t exist at all (after migration or fresh install).

How to fix via FTP:

  1. Connect to your site
  2. Navigate to /wp-content/
  3. Right-click → Create Directory → name it uploads
  4. Set permissions to 755
  5. Inside uploads, create the current year folder (e.g., 2024)
  6. Set that to 755
  7. Inside that, create the current month folder (e.g., 06 for June)
  8. Set that to 755

Or let WordPress try again:
Simply create the empty uploads folder with 755 permissions. WordPress will create year/month subfolders automatically on the next upload.

Fix #5: Disable Year/Month Folder Organization (Workaround)

If you’ve tried everything and still can’t fix permissions, you can tell WordPress to stop organizing uploads into year/month folders.

Add this to wp-config.php (before the “stop editing” line):

php

define('UPLOADS', 'wp-content/uploads');
add_filter('upload_dir', function($uploads) {
    $uploads['subdir'] = '';
    $uploads['path'] = $uploads['basedir'];
    $uploads['url'] = $uploads['baseurl'];
    return $uploads;
});

Warning: This is a workaround, not a proper fix. All new uploads will go directly into /uploads/, which can become messy. Use only if your host refuses to fix permissions properly.

Fix #6: Check Hosting-Specific Restrictions

Some managed hosts have unique behaviors.

Kinsta:

  • File permissions are locked. Contact support if you see this error — they will fix it in minutes.
  • Their file system is read-only in some environments (like staging). Check you’re not trying to upload to a staging site’s media library.

WP Engine:

  • They enforce strict permissions. The error usually means disk space is full.
  • Check your “Storage” usage in the WP Engine dashboard.

Cloudways:

  • Usually a permissions issue after migration. Use their “Fix Permissions” tool in the application settings.

Local development (XAMPP/MAMP/Local by Flywheel):

  • On Windows, permissions are often not the issue. Check that the folder isn’t set to “Read-only” in Windows file properties.

4. Prevention Tips

Set correct permissions at install
When you first install WordPress, ensure /wp-content/uploads/ is created with 755 permissions. Many hosts do this automatically.

Monitor disk space
Set up alerts for when you reach 80%, 90%, and 95% of your storage limit. Most managed hosts offer this.

Don’t manually move or rename uploads via FTP
Moving folders via FTP can reset ownership and permissions. Use the WordPress Media Library for management instead.

Use a backup plugin that stores off-server
If you use a backup plugin (UpdraftPlus, etc.), store backups in cloud storage (Google Drive, Dropbox, S3), not on the same server.

Regular cleanup schedule
Once a month:

  • Delete unused media files
  • Remove old post revisions
  • Clear expired transients
  • Delete inactive plugins and themes

Final Thoughts

The “Unable to create directory” error has a simple cause: the web server can’t create a folder. The solution is almost always fixing permissions or freeing up disk space.

Remember:

  • Start with permissions: /uploads/ should be 755
  • If permissions look right, check ownership (contact host if needed)
  • If ownership is fine, check disk space
  • If all else fails, create the folder manually

This error is annoying, but it’s almost never a WordPress bug. It’s a server configuration issue — and that means it’s fixable.

Was this post helpful?
Buy us a coffee!
Tags:

Free eBook!

Subscribe to our newsletter to receive it free!