Setting Minimum File Permissions for a WordPress Site
To ensure the security and proper operation of a WordPress site, it's essential to correctly configure file and directory permissions. This task must be performed via the shell, from the site's root directory.
Recommended minimum permissions
The recommended settings for secure and functional operation are:
- 755 for directories (
-rwxr-xr-x) - 644 for files (
-rw-r--r--)
These permissions provide the minimum security level needed to prevent unauthorized access while ensuring that WordPress functions correctly.
Commands to execute
Navigate to your site's root and run the following shell commands:
# Set 755 permissions on all directories
find /var/www/clients/client23/web62/web -type d -exec chmod 755 {} \;
# Set 644 permissions on all files
find /var/www/clients/client23/web62/web -type f -exec chmod 644 {} \;
Make sure to replace /var/www/clients/client23/web62/web with the actual path to your WordPress site's directory.
Warning
Only run these commands if you have shell access and the necessary privileges. Incorrect use of recursive permissions can compromise your site's accessibility or functionality.