
How to Manage WordPress File Permissions via cPanel
How to Manage WordPress File Permissions via cPanel
Proper file permissions are essential for securing your WordPress website and ensuring it runs smoothly. This guide will show you how to check and set correct file permissions using cPanel’s File Manager.
Why Are File Permissions Important?
File permissions control who can read, write, or execute files and folders on your server. Incorrect permissions can lead to security vulnerabilities, such as unauthorized access or website hacks.
Recommended File Permissions for WordPress
- Folders: 755 (rwxr-xr-x) — Owner can read, write, and execute; others can read and execute.
- Files: 644 (rw-r–r–) — Owner can read and write; others can only read.
- wp-config.php: 600 or 640 — Restricts access to this critical configuration file.
Step 1: Log into Your cPanel Account
Go to your cPanel login page (https://yourdomain.com/cpanel
) and enter your credentials.
Step 2: Open File Manager
In the cPanel dashboard, locate and click on File Manager under the Files section.
Step 3: Navigate to Your WordPress Directory
Browse to the root folder of your WordPress installation. This is usually the public_html
directory or a subfolder within it.
Step 4: Check and Set Folder Permissions
- Select a folder (e.g.,
wp-content
). - Right-click and choose Change Permissions or click the Permissions button in the toolbar.
- Set the permission value to
755
. - Click Change Permissions to apply.
Step 5: Check and Set File Permissions
- Select a file (e.g.,
index.php
). - Right-click and choose Change Permissions.
- Set the permission value to
644
. - Click Change Permissions to save.
Step 6: Secure wp-config.php
Locate the wp-config.php
file in your WordPress root directory.
- Right-click on
wp-config.php
and select Change Permissions. - Set the permission value to
600
or640
to restrict access. - Save the changes.
Additional Tips
- Never set permissions to
777
as it allows anyone full access, risking your site’s security. - If you’re unsure about changes, consult your hosting provider or a WordPress professional.
- Regularly review file permissions to maintain your site’s security.