What is the recommended permission for WordPress files and folders?
| Item | Permission |
|---|---|
| Folders | 755 |
| Files | 644 |
| wp-config.php | 600 or 640 |
| 777 | Never use it |
The numbers decide who can read, write and run the file (owner, group and others). Also the user of the web server must own the files or be able to write in wp-content/uploads, otherwise uploads and updates fail.
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 600 wp-config.php
See WordPress Security.
Learn more about the similar topics:
| Tutorials |
|---|
| WordPress Security |
| WordPress Data Validation, Sanitizing and Escaping |
| Exercises & Assignments |
|---|
| Save a plugin setting with a sanitize callback |