What is true chmod for WordPress?

For all the folders and files.

Please give some explained answer.

Solutions Collecting From Web of "What is true chmod for WordPress?"

All files should be writable only by your user account. So the correct permissions for files and directories are:

  • Directories: 755
  • Files: 644

You may want to secure some files:

  • wp-config.php: for maximum security, this file should be made writable by your user only or its group. This means 400 or 440 permission
  • .htaccess: 666 permission, so that WordPress can automatically generate rewrite rules for you
  • wp-content/: some plugins and themes may require write access to this directory. you will be prompted when necessary.
  • wp-content/themes/: 664 permission if you want to use the theme editor

References:

  • Changing File Permissions
  • Hardening WordPress