The "PHP Warning: mkdir(): Permission denied in wp-content/plugins/" error means a WordPress plugin cannot create a directory because of incorrect file ownership or permissions. It commonly appears with page builders like Swift Framework, caching plugins, or anything that writes files into wp-content. The fix is to correct ownership and permissions, which most often drift after a migration or restore.
Fix ownership and permissions
Via SSH: chown -R $USER:$USER ~/public_html/wp-content, then set directories to 755 and files to 644. No SSH? Fix permissions in cPanel File Manager, and open a ticket if the cause is ownership.
01. Why This Happens
- Wrong ownership - wp-content or a subdirectory is owned by a different user than your account, so PHP cannot write there. This is the same root cause as the SoftException UID error.
- Too-restrictive permissions - directories need 755 so PHP can create subfolders inside them.
- After a migration or restore - backups and transfers often reset ownership or permissions to the wrong values.
02. Fix Ownership and Permissions
With SSH access, run:
chown -R $USER:$USER ~/public_html/wp-content
find ~/public_html/wp-content -type d -exec chmod 755 {} \;
find ~/public_html/wp-content -type f -exec chmod 644 {} \;
Without SSH, fix permissions in cPanel File Manager by right-clicking a directory and choosing Change Permissions (755 for directories, 644 for files). If the problem is ownership rather than permissions, you cannot fix that in File Manager - open a ticket and we will correct it.
Do not set files or directories to 777 to force it to work. The real issue is ownership; 777 leaves the data world-writable, which is a security risk and still may not resolve the error.
03. Add FS_METHOD direct
Add define('FS_METHOD', 'direct'); to your wp-config.php so WordPress writes files directly instead of falling back to an FTP prompt. With correct ownership this is safe and is the normal method on our hosting. See WordPress FTP Credentials.
04. Prevent It After a Migration
Ownership and permission errors most often appear right after moving a site in or restoring a backup. After any migration, reset ownership to your account user and permissions to 755/644 across wp-content, and confirm the plugin's upload or cache folders are writable. Doing this once after the move prevents the recurring mkdir warnings.
Permission Errors Persist?
Open a ticket and we will fix file ownership and permissions across your WordPress installation.
Open a Support TicketFrequently Asked Questions
What causes the mkdir Permission denied error in WordPress?
A plugin cannot create a directory in wp-content because of wrong file ownership or too-restrictive permissions, often after a migration or restore. PHP needs the files owned by your account and directories at 755 to write subfolders.
How do I fix mkdir Permission denied?
Over SSH, run chown -R $USER:$USER on wp-content and set directories to 755 and files to 644. Without SSH, fix permissions in File Manager; if ownership is wrong, open a ticket since that cannot be changed from File Manager.
Should I use 777 permissions to fix it?
No. The real issue is ownership, not permissions. Setting 777 makes the files world-writable, which is a security risk, and often does not resolve the error. Use 755 for directories and 644 for files with correct ownership.
Why did this start after I migrated my site?
Migrations and backup restores frequently reset file ownership or permissions to the wrong values. Resetting ownership to your account user and permissions to 755/644 across wp-content after the move prevents the mkdir errors.
Quick Recap
- Fix ownership - chown -R $USER:$USER ~/public_html/wp-content.
- Fix permissions - directories 755, files 644.
- Add FS_METHOD direct to wp-config.php.
- Never use 777.
- Reset ownership after a migration to prevent recurrence.
WordPress permission errors · Last updated November 2026 · Browse all Error articles
