Changing permissions for directories and files in WordPress is an advanced task that may be required in certain situations. For example, if you are having problems installing plugins or themes, or you are seeing error messages indicating incorrect file permissions, changing permissions can help resolve these issues. It is also important to set permissions for directories and files correctly in WordPress to ensure the security of your website.
Please notethat you changing the right always a backup ofa WordPressinstallation firstellen to ensure that you in case of problems a functionending version you can fall back on.
To correct permissions for directories and files in WordPress recursively via SFTP, FTP and SSH, please follow the steps below. Note that the recommended permissions for each folder are listed in the table:
Recommended WordPress permissions
folder / file | right |
---|---|
wp-config.php | 644 |
.htaccess | 644 |
wp-includes/ | 755 |
wp-content/ | 755 |
wp-content/themes/ | 755 |
wp-content/plugins/ | 755 |
wp-content/uploads/ | 755 |
It is important to note that these permissions should be used as a starting point and may need to be adjusted depending on your server configuration and plugins. Some sources also recommend setting the permissions for wp-config.php and .htaccess to 440 or 400 for increased security. It is also important to note that incorrectly configured permissions can cause problems when installing and running WordPress.
SFTP
SFTP (Secure File Transfer Protocol) is a network protocol used for secure access, transfer, and management of large files and sensitive data. It was developed as an extension of SSH (Secure Shell) and allows access, transfer, and management of files over a network. SFTP is used for secure file transfers over Transport Layer Security and transfer of data for Virtual Private Network (VPN) applications.
- Connect to your server via SFTP using an FTP client such as FileZilla use.
- Enter the credentials found under the "Info" tab. These include the "Host", "Username", "Password" and "Port". Make sure you have set the protocol to SFTP.
- Navigate to your WordPress root directory.
- Right-click the directory for which you want to change the permissions and select “File Permissions” or “Properties” from the context menu.
- Change the permissions to the recommended values from the table and activate the “Apply recursively” option to change the permissions for all underlying folders and files.
FTP
FTP (File Transfer Protocol) is a network protocol used to access, transfer and manage files on a server. It uses a two-channel approach to establish connections between computers: the command channel initiates and sends FTP commands between each computer to facilitate the transfer. FTP is not encrypted and is therefore vulnerable to attacks.
- Connect to your server via FTP using an FTP client such as FileZilla use.
- Enter the credentials found under the "Info" tab. This includes the "Host", "Username", "Password" and "Port". Make sure you have set the protocol to FTP.
- Navigate to your WordPress root directory.
- Right-click the directory for which you want to change the permissions and select “File Permissions” or “Properties” from the context menu.
- Change the permissions to the recommended values from the table and activate the “Apply recursively” option to change the permissions for all underlying folders and files.
SSH
SSH (Secure Shell) is a cryptographic network protocol used to securely access a remote computer and transfer data. It provides a secure connection and authentication between computers over an insecure network. SSH is often used to establish secure connections to servers and transfer files via SFTP.
- Connect to your server via SSH using an SSH program such as PuTTY use.
- Enter the SSH credentials to connect to the server. These credentials should also be found under the Info tab.
- Navigate to your WordPress root directory.
- Use the command
chmod
followed by the recommended permissions from the table and the directory name to change the permissions for the corresponding directory. Run the command with the option-R
to apply the permissions recursively to all underlying folders and files. For example:chmod -R 755 wp-content/themes/
.
Please note that changing permissions for directories and files in WordPress is an advanced task. Make sure you understand the implications of the permission changes before making them. Incorrectly configured permissions can lead to security issues.