The correct directory permissions for WordPress

Here are the correct directory permissions for WordPress:

  1. Directories:
    • WordPress directory (usually the root directory of your website): 755
    • wp-content directory: 755
    • wp-content/themes directory: 755
    • wp-content/plugins directory: 755
    • wp-content/uploads directory: 755
  2. Files:
    • wp-config.php: 600
    • .htaccess: 644
    • Files within wp-content/themes/*: 644 or 755 (depending on the requirements of the theme)
    • Files within wp-content/plugins/*: 644 or 755 (depending on the requirements of the plugins)

In Linux/Unix systems, directory permissions and file permissions are typically set as follows:

  • 755: Owner has read, write, and execute permissions; Group and Others have read and execute permissions. This is a typical directory permission setting.
  • 644: Owner has read and write permissions; Group and Others have read permissions. This is a typical file permission setting.

Ensure the permissions are set correctly to prevent unauthorized access while allowing WordPress to read, write, and execute the necessary files.

Additionally, if your WordPress site needs to use FTP for file uploads or plugin/theme installations, you may need to set the owner of directories and files to the web server user, such as the Apache or Nginx user. This ensures that the web server has sufficient permissions to manage files and directories.

Published
Categorized as wp