Skip to content
Launch offer 50% off your first year of Keel Pro. See prices →

WordPress file permissions explained: 755, 644 and wp-config.php

What the numbers mean, the settings WordPress and hosts recommend, why 777 is dangerous, and how to check and fix permissions safely.

Keel team · · 3 minutes read

Every file and folder on a Linux server has permissions: who may read it, change it, or run it. Wrong permissions are a quiet risk. Too strict, and WordPress cannot update itself. Too loose, and anyone else on the server, or any script that gets in, can change your site.

Reading the numbers

Permissions are written as three digits, for three groups of people:

  1. the owner of the file (usually your hosting account);
  2. the group (often the web server);
  3. everyone else.

Each digit adds up what that group may do: 4 to read, 2 to write, 1 to execute (for folders: to open them).

Number Means
7 read, write and execute (4+2+1)
6 read and write (4+2)
5 read and execute (4+1)
4 read only
0 nothing

So 644 means: the owner reads and writes, the group and everyone else only read. 755 adds “execute” for everyone, which folders need so they can be opened.

What WordPress recommends

What Permission
Folders 755
Files 644
wp-config.php 600 or 640 if your host supports it, otherwise 644
.htaccess 644

On most modern hosting, PHP runs as your own account, so these settings let WordPress update plugins and write uploads, while other accounts on the server cannot change anything.

Why 777 is dangerous

777 means everyone may write. On shared hosting, “everyone” includes every other account on the same server. If one of those sites is hacked, the attacker can write into your folders too. Tutorials sometimes suggest 777 to “fix” an upload or update error. It does fix the error, by removing all protection.

If an upload or update fails with a permission error, the right fix is usually that the files belong to the wrong owner. Ask your host to set the correct owner, rather than opening the permissions.

How to check

  • Your host’s file manager shows permissions in a column, often as numbers or as rwxr-xr-x.
  • FTP or SFTP clients show them in the file list, and can change them with “File permissions”.
  • Keel: Keel › Hardening › Security tools shows who may read and change the key files and folders.

How to fix

For one file or folder, use the file manager or FTP client. For a whole site, your host can reset them, or, if you have SSH access, run these from the WordPress folder:

find . -type d -exec chmod 755 {} ;
find . -type f -exec chmod 644 {} ;
chmod 600 wp-config.php

Check the site afterwards. If wp-config.php at 600 gives an error, your host’s setup needs 640 or 644.

Permissions are one layer

Correct permissions stop other accounts and some attacks from writing to your site. They do not stop an attacker who logs in as an administrator, or a plugin with a hole that writes files through WordPress itself. Combine them with updates, two-factor login and server rules such as “never run PHP in the uploads folder”.

Common questions

Why does WordPress ask for FTP details when I update?

Usually because PHP cannot write to the plugin folders, often because the files belong to a different user. Ask your host to fix the owner rather than loosening permissions.

Should uploads be 777 so images can be uploaded?

No. With the correct owner, 755 for folders and 644 for files is enough for uploads to work.

Is 400 better than 600 for wp-config.php?

It is stricter: nobody can write to it, including WordPress. Tools that update wp-config.php, such as changing the security keys, then cannot work until you change it back.

Keel does this for you.

Speed, security and SEO in one WordPress plugin, with plain-language settings. Free on any number of sites.

Get Keel free

Five minutes from now

Give your site a keel.

Steady when traffic spikes, calm when attacks come, found when people search. Start free; go Pro when a site needs more.