Fix WordPress file and folder permission errors
Correct WordPress filesystem permissions (755 directories, 644 files), how to set them in cPanel or FTP, and what not to recurse.
Correct WordPress filesystem permissions (755 directories, 644 files), how to set them in cPanel or FTP, and what not to recurse.
WordPress needs the web server user to read (and sometimes write) specific files. If permissions are too tight, updates, uploads, and plugin installs fail. If they are too loose, attackers have an easier time changing PHP on disk.
These permissions are server filesystem rules (owner / group / others). They are not the same thing as WordPress user roles inside wp-admin.
| Path | Type | Typical permission |
|---|---|---|
| Directories (folders) | dir | 755 |
Most files (.php, .css, .js, etc.) | file | 644 |
wp-config.php | file | 440 or 400 when the host allows (otherwise 644) |
.htaccess (if present) | file | 644 |
Meaning of the digits (owner, group, others):
4 = read, 2 = write, 1 = execute (for directories, execute means “enter”)7 = read+write+execute (4+2+1)5 = read+execute4 = read onlySo 755 on a directory: owner full access, group and others can enter and list. 644 on a file: owner can edit, everyone else can read.
Never set 777 on WordPress directories to “make the error go away.” That lets any local user (and often the whole server environment) write your PHP.
wp-includes or other directories to 644 (directories need execute bits; use 755)755 onto files inside a folder (PHP files should stay 644)wp-config.php world-writableExact ownership (www-data, nginx, your cPanel user) depends on the host. Shared hosting often wants files owned by your account with the permissions above.
public_html, www, or the domain’s document root).755. Prefer fixing top-level dirs (wp-admin, wp-content, wp-includes) and only recurse directories if your File Manager can apply “directories only.”644.wp-config.php, try 440/400 if updates and the site still work; otherwise leave 644 and ask the host what they recommend.755.755 to all files.644 (recurse files only if available).wp-config.php.CLI equivalent on a shell host you control (run from the WordPress root, as the correct user):
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 440 wp-config.php # or 400 / 644 per host policy
Only run bulk chmod if you understand ownership on that server. Managed WordPress hosts may reset permissions on deploy.
DISALLOW_FILE_MODS set in wp-config.phpPermission fixes solve “cannot create directory” / “unable to write” class errors. They do not replace updates, strong logins, or malware cleanup. Broader hardening: WordPress hardening guide.
Found this useful? Share it.