◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Errors → Failed To Write File Disk
Fixed: WordPress failed to write file to disk
Nothing kills your momentum like uploading a file in WordPress and hitting a vague, frustrating error: “Failed to write file to disk.” You’re just trying to upload an image or update a plugin—why is this happening?
Let’s walk through what causes the error, how to fix it step-by-step, and how to make sure it doesn’t happen again.
WordPress failed to write file to disk: what it means
This error pops up when WordPress doesn’t have permission to store files on your web server. It often appears during image uploads, plugin installations, or theme updates.
You might also see related messages like:
- “Unable to create directory.”
- “WordPress has failed to upload due to an error.”
- “Failed to write file to disk.”
In most cases, the problem isn’t WordPress. It’s a server or configuration issue that’s blocking WordPress from writing files to disk.
What causes this error in WordPress?
There are several reasons why WordPress might not be able to save files on your server:
- Incorrect file or folder permissions. WordPress needs permission to write to certain directories like /wp-content/uploads/.
- Incorrect ownership. If WordPress runs under a different user account than the files’ owner, uploads may be blocked.
- PHP temporary folder issues. If the upload_tmp_dir is missing or full, PHP can’t store files before passing them to WordPress.
- Disk quota limits. Shared hosting accounts may have file or inode limits that prevent new uploads.
- Out of disk space. If your server is full, WordPress can’t write anything—no matter the permissions.
- Plugin or security restrictions. Occasionally, security plugins or server firewalls interfere with file uploads.
How to fix “failed to write file to disk” in WordPress
Start with file permissions and work through the list. Most users can fix the issue without touching advanced server settings.
1. Check and reset file and folder permissions
WordPress files and folders need the correct permissions so your web server can write to them.
What permissions should be:
- Folders: 755
- Files: 644
How to check and fix this using cPanel File Manager:
- Log in to your hosting control panel (e.g. cPanel).
- Open File Manager and go to your WordPress root directory (usually public_html).
- Navigate to wp-content/uploads/.
- Right-click the uploads folder and select Change Permissions.
- Set the folder to 755 and apply changes to subfolders.
- Check individual files (like uploaded images) and set them to 644 if needed.
Using FTP (e.g. FileZilla):
- Connect to your site with FileZilla.
- Locate /wp-content/uploads/.
- Right-click the folder, choose File permissions, and set to 755.
- Check the box that says Recurse into subdirectories and apply to directories only.
- Repeat for files, setting permissions to 644.
Avoid 777 permissions. It might fix the error temporarily, but it opens your site to serious security risks.
2. Update file and folder ownership (advanced users)
If your files are owned by a different user than the one PHP runs under, WordPress might not be allowed to write to them, even with the right permissions.
This usually happens when:
- You move your site between servers.
- You switch between FTP and root SSH users.
- You’ve restored files using root privileges.
How to check and fix via SSH:
- Connect to your server using SSH.
- Run ls -l in your WordPress directory to check ownership. Look for something like www-data or apache as the owner.
- To fix ownership, run:
sudo chown -R www-data:www-data /var/www/html - Replace /var/www/html with your WordPress path and www-data with the correct web server user.
This step requires root access—if you’re on shared hosting, you’ll need to contact your host.
3. Clear or recreate the PHP temporary folder
Before WordPress stores an uploaded file in wp-content/uploads/, PHP places it in a temporary folder. If this folder is missing, full, or not writable, uploads will fail.
How to find your temp directory:
- Create a new file called phpinfo.php with the following contents:
<?php phpinfo(); ?> - Upload it to your WordPress root and visit yoursite.com/phpinfo.php.
- Search for upload_tmp_dir. If it’s blank or the path doesn’t exist, PHP can’t store temp files.
To fix:
- Create a new folder for temp uploads, e.g. /home/user/tmp.
- Make sure it’s writable: chmod 755 tmp
- Edit your php.ini file (if you have access) and add:
upload_tmp_dir = “/home/user/tmp” - Restart your web server (Apache or NGINX) for changes to take effect.
If you don’t have access to php.ini, ask your hosting provider to set the upload_tmp_dir for you.
4. Check disk space and hosting quotas
Even with perfect permissions, uploads will fail if your server is out of space or file quota.
On shared hosting:
- Log in to your cPanel.
- Check Disk Usage under Files.
- Look for storage limits or inode (file count) limits.
On VPS or dedicated servers:
- Connect via SSH and run:
df -h - This shows disk space usage across mounted volumes.
To check inode usage:
df -i
Fixes:
- Delete old backups or media files.
- Clear server logs or email queues.
- Upgrade your plan if you’re constantly hitting limits.
5. Disable plugins or security software temporarily
Sometimes, a plugin might block uploads by modifying permissions or interfering with file operations.
How to test:
- Go to Plugins > Installed Plugins in your dashboard.
- Deactivate all plugins.
- Try uploading a file again.
- If the upload works, reactivate plugins one at a time to find the culprit.
Also check:
- Security plugins like Wordfence, Sucuri, or iThemes Security
- File managers or upload restrictors
Once you find the problematic plugin, contact the developer or find an alternative.
6. Contact your hosting provider
If you’re not comfortable changing permissions, editing config files, or checking server storage, your hosting provider can help.
Include these details when submitting a ticket:
- The exact error message you’re seeing
- What action triggered it (uploading an image, installing a plugin, etc.)
- Any recent changes to your site or server
Many hosts can fix the issue in just a few minutes.
How to prevent this error in the future
Once you fix the issue, take a few steps to prevent it from happening again.
Monitor disk space and quotas
Use your hosting dashboard, watch for:
- Low disk space
- High inode usage
- PHP memory or file upload limits
Set up alerts if your host offers them.
Use managed WordPress hosting
Most permission and config issues are less common with fully managed WordPress hosting. Managed hosts configure servers specifically for WordPress and fix these issues for you if they do happen.
Backup your site before making changes
Before editing permissions, ownership, or server settings, make a full backup of your site files and database. Plugins like UpdraftPlus or BackupBuddy can help.
Getting started with fixing the “failed to write file to disk” error
This upload error stops your site cold, and it’s usually tied to permissions, ownership, or server storage.
Start with folder permissions and work your way through temp folders, disk space, and plugins. If you don’t have server access, your host’s support team can fix it quickly.
Ready to upgrade your WordPress experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy.
Don’t want to deal with server management and maintenance either? Our fully managed hosting for WordPress is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
Click through below to explore all of our hosting for WordPress options, or chat with a WordPress expert right now to get answers and advice.
Additional resources
Diagnosing WordPress errors on your site →
Even more common errors, how to troubleshoot them, and how to solve them
How to fix the HTTP error when uploading images to WordPress →
Find out how to fix the WordPress HTTP error when uploading images and get your media library working smoothly again.
What is managed WordPress hosting? →
What it means, what it includes, and how to decide if it’s right for you
Haritha Jacob is a knowledgeable System Engineer with extensive experience in resolving costumers’ complaints and issues. She has experience with various programming languages and operating systems, enterprise backup and recovery procedures, system performance-monitoring tools, and more.