WordPress File Permissions Explained: 644, 755 and wp-config.php
File permissions are the rules your server uses to decide who can read, change, or run each file and folder in your WordPress install. When they are right, you never think about them. When they are wrong, uploads fail, updates refuse to run, and another account on the same server can change your files.
Here are the numbers, the safe values, and how to check and fix them safely.
One rule before you touch anything: make a full backup first — database plus files — and write down the current permission of anything you change. A change is easy to undo only if you know what it was before.
1. What the numbers mean
Every file and folder has three permissions: read, write, and execute. In the three-digit numbers you see in cPanel or an FTP client, each digit is a sum: read is 4, write is 2, and execute is 1.
The three digits stand for three different people, in order: the owner, the group, and everyone else.
So 644 means the owner can read (4) and write (2), while the group and everyone else can only read (4). And 755 means the owner can read, write, and execute (4 + 2 + 1 = 7), while the group and everyone else can read and execute (4 + 1 = 5) but cannot change anything.
For a folder, “execute” really means “enter”: the server needs it to open the folder and reach the files inside. That is why folders and files use different numbers, and why copying one number onto everything is a mistake.
2. The safe values for most sites
For most WordPress installs on Linux hosting, these are the starting values:
| Path | Value | Why |
|---|---|---|
| All folders | 755 | The owner can change them; everyone else can enter and read, but not change |
| All files | 644 | The owner can edit; everyone else can only read, which is all the web server needs |
| wp-config.php | 600 or 640 (see below) | Holds your database password and security keys |
| .htaccess | 644 | The server must read it; WordPress and some plugins need to update it |
| wp-content/uploads | Folders 755, files 644 | WordPress must be able to create files here when you upload media |
These are starting values, not a blanket reset. WordPress itself says the right values vary by host, and your host may use slightly different ones — 750 for folders and 640 for files on some shared hosting, for example. If your host gives you its own numbers, use those.
Two values to remember above all: never set anything to 777. That gives the owner, the group, and every other account on the server full read, write, and execute access. It is the value people reach for when an upload fails, and it turns a small problem into a security hole. And never run a single recursive command that gives files and folders the same number — chmod -R 755 . gives every file execute permission, which no file needs.
3. wp-config.php deserves tighter treatment
wp-config.php is the one file that deserves special care. It holds your database name, username and password, and your authentication keys and salts. Anyone who can read it has the keys to your database.
WordPress’s own hardening guide says wp-config.php should be readable only by you and the web server, generally a 400 or 440 permission. Many hosts and security guides instead recommend 600 or 640, which also work. The honest answer is that the right value depends on how PHP runs on your host: if PHP runs as the file owner, 400 or 600 works; if PHP reads through the group, you need 440 or 640.
So the rule is simple: use the strictest value that still lets your site work. Try 400 first; if the site breaks, step up to 440, then 600, then 640 — and stop at the first value that works. Never loosen it further than that. Our wp-config.php security guide covers the other protections for this file.
4. How to check your current permissions
You need one of three tools: your host’s file manager, an FTP client, or SSH. The dashboard alone cannot show you permissions.
In cPanel File Manager: open File Manager, go to the folder where WordPress is installed (usually public_html), right-click a file or folder, and choose Permissions or Change Permissions. A box shows the current number and checkboxes for read, write, and execute.
In FileZilla (FTP): connect to your server, find the file or folder, right-click it, and choose File permissions. The same number and checkboxes appear. FileZilla can also change a whole folder’s contents at once — use that carefully, and only on folders, never mixed with files.
With SSH: run ls -l in your WordPress folder to list files with their permissions. This also shows you the owner and group, which matter as much as the number: a correct number with the wrong owner can still block WordPress.
5. How to fix them safely
Fix permissions only for the thing that is actually broken. Do not reset the whole site because one upload failed.
First, confirm the backup from the start of this guide, and note the current value of anything you are about to change.
With SSH, the safe pattern sets folders and files separately, from inside your WordPress folder:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 640 wp-config.php
Then test the exact thing that failed — upload an image, save a post, run an update. If it works, stop. If it still fails, the cause is probably not permissions at all: ownership, a full disk, or a server rule can block the same action with correct numbers. Loosening permissions further will not fix those.
With cPanel or FileZilla, change one file or folder at a time, using the same numbers. After each change, test the site: homepage, one post, and the dashboard. If anything breaks, put the old value back at once — this is why you wrote it down.
If the values keep reverting, or you are on managed WordPress hosting, stop and ask your host. Managed hosts often control ownership and server rules themselves, and their reset tool knows the correct account user for your site.
6. What breaks when permissions are wrong
Most permission problems show up as one of these:
- Uploads fail, or WordPress says it could not create a directory. The uploads folder, or the folder WordPress is trying to create inside it, is not writable by the account running PHP. Our guide to the “could not create directory” error walks through the full fix order — permissions are only one of its causes.
- Updates fail, or a plugin will not install. WordPress cannot write the new files. Check the folders first, then ask whether the disk is full before loosening anything.
- A 403 Forbidden error, or a blank page after a change. A file WordPress needs to read has been locked down too tightly — wp-config.php at 400 on a host where PHP reads through the group is a classic case. Step the value up one notch, as in section 3.
- A file keeps changing back, or new files appear that you did not create. That is not a permissions problem to fix by tightening numbers — it is a sign the site may already be compromised. Follow our guide to the signs of a hacked WordPress site instead.
Permissions are one layer of security, not the whole of it. They sit alongside updates, strong logins with two-factor authentication, and backups — the same layers our hardening checklist and our DIY security audit checklist walk through.
FAQ
Do I need to change permissions on a new WordPress install?
Usually no. WordPress sets secure values during installation — folders 755 and files 644. Check them only when something fails, or when you have changed hosts.
Is 777 ever the right answer?
No. If something only works at 777, the real problem is ownership or which account runs PHP, and your host should fix that.
Why do folders and files use different numbers?
Because they need different things. A folder needs execute permission so the server can enter it; a file needs read permission so the server can serve it, and only the owner needs to write to it.
Will tightening permissions break my site?
It can, if you go too far — the most common break is wp-config.php set so tightly that PHP cannot read it. That is why the guide says to test after each change and to step up one value at a time. A backup and a note of the old value make any break reversible in a minute.