File and Folder Permission is one of the major factors for Website Security. Incorrect File and Folder permission in WordPress can create errors while using WordPress Theme Editor or uploading any files. In this article, I will discuss how to quickly fix WordPress File and Folder Permissions error using multiple methods.
What are File and Folder Permissions?
File Permissions are set of controls mods that is used to define who can access and modify files and folders. It help in improving the file security by restricting its access to set of users.
There are three types of users:
- User – Administrator of the Website(WordPress).
- Group – Set of people with various roles like subscribers, editors, etc.
- World – Publicly accessible to everybody else.
There are 3 types of Permission that can be assigned to each group
- Read – Permission to read a file.
- Write – Permission to modify a file.
- Execute – Permission to execute a file.
All the above permission are denoted with specific numbers.
- Read – 4
- Write – 2
- Execute – 1
- None – 0
Combination of above numbers are used to set permission for particular users
- 0 – No permission
- 1 – Permission to execute the file
- 2 – Permission to modify the file
- 3 – Permission to modify and execute a file
- 4 – Permission to read a file
- 5 – Permission to read and execute a file
- 6 – Permission to read and write a file
- 7 – Permission to read, write and execute a file
For instance, setting file permission to 644 will allow:
– Administrator to read and write a file
– Group to read a file
– Public to read a file
WordPress File and Folder Permssions
All the folders and subfolders should be set to 755. As per this, only the owner can read, write, and execute, whereas the group and others/public have only read and execute access.
All .php files inside WordPress need to be set to 644. As per this, only the owner can read and modify the file, whereas the group and others/public can only read the file.
This permission needs to be applied to the wp-config.php file. wp-config is the most sensitive file as it contains all the configuration details including database credentials. Only the owner can read and modify the file, whereas the group can only read the file and others have no access to the file.
Now we will see how to change or fix File and Folder permission in WordPress.
Fix WordPress File and Folder Permission error
Here i will show you two ways to fix your File and folder permission error.
- Using WordPress Plugin
- Using FTP
How to fix File and Folder Permission error in WordPress using Plugin?
For this step, we will use the WP Security plugin. It reduces security risk by checking for vulnerabilities, and by implementing and enforcing the latest recommended WordPress security practices and techniques.
- Log in to your WordPress dashboard and go to Plugins » Add New.
- Search for WP Security using the search bar.
- Install and activate the All In One WP Security & Firewall plugin.
- After installation from the left sidebar hover on “WP Security” and select “Filesystem Security“
You will get the list of recommended file and folders with its permission.
You can click on the “Set Recommend Permissions” button to fix the file and folder permission errors.
How to fix File and Folder Permission error in WordPress using FTP Client?
We will use FileZilla to access our WordPress files and change the permission of required files and folders. Follow the steps below:
- Get FileZilla and connect to your server using your login details.
- In the remote site go to your WordPress directory and right-click on any folder and select “File Permissions“.
Now set the numeric value to 755 and select the “Recurse into subdirectories” option. Choose “Apply to directory only” and click on OK. This will apply 755 permission to all subfolders including that folder.
Again right-click on the same folder and select “File Permissions“. Set Numeric value to 644 and select the “Recurse into subdirectories” option. Choose “Apply to files only” and click on OK. This will apply 644 permission to all files inside that folder.
Follow the same step for all folders. For other .php files in the WordPress root directory only change the numeric value to 644 and for wp-config.php set it to 640.
I hope this article helped you fix the WordPress file and folder permissions error. You may also want to see our other articles on WordPress. If you still face any issue in resolving permission issues you can avail premium support using our contact page. Please share this article with your friends and provide your valuable feedback in the comment section below.