One of the frequent questions by WordPress users across the globe is “how to overcome the error caused due to incorrect file and folder permissions?”. We will show the method to solve the WordPress permission error easily in this article.
Table of Contents
Why File and Folder Permissions are important in WordPress?
Your WordPress site lies in a distributed or a cloud system that is taken care of by the hosting provider. Special software is used to manage the site’s files and folders and serve them when demanded by the browsers.
WordPress needs certain permissions to read, write and modify these files and folders on the server. Because Retrieval and storage of data will not be possible without the appropriate file and folder permission. Incorrect file & folder permission will prevent WordPress from the functioning and even become a threat to the security of the site.
Permission for Folders and Sub-folders
In WordPress, We have certain recommendation to determine what type of permission is to be given for folders and sub-folders. “755” s the right type of permission to all the folders and sub-folders of WordPress. 755 permission allows anyone to read and execute the folder & subfolder. Only the owner has the write access.
- Connect your WordPress site using an FTP client such as FileZilla, WinSCP, etc.,
- Go to the Root folder of your WordPress site
- Select all the folders in the root directory and right-click on your mouse to select “File Permissions”
- In the permission dialogue box enter 755 in the “Numeric value” field
- Select “Recurse into subdirectories” checkbox
This will create the same permission to all the sub-folders present inside the main folders
- Select “Apply to Directories only” button and click “OK” button
Now, the FTP client will start to set permission to all the folders and sub-folders in your WordPress directory. It takes some extra time to change the permission in some cases
Permission for Files
In WordPress, Like the folder permission, We also have certain recommendation to determine what type of permission is to be given for files. “644” is the right type of permission to all the files of WordPress. 644 permission allows the owner to read and write the file. Anyone other than owner only has the read access.
- Go to the Root folder of your WordPress site
- Select all the files & folders in the root directory and right-click on your mouse to select “File Permissions”
- In the, permission dialogue box enter 644 in the “Numeric value” field
- Select “Recurse into subdirectories” checkbox
This will create the same permission to all the files present in the folders and sub-folders.
- Select “Apply to Files only” button and click “OK” button
Now, the FTP client will start to set permission to all the files in your WordPress directory. It takes some extra time to change the permission in some cases.
Permission for wp-config File:
Wp-config.php file is a crucial file for the functioning of WordPress. This wp-config file holds all the information about the site’s databases. If the contents of this file is accessed by any intruder, they might take control of an entire website. To ensure maximum security, it is recommended to give “600” permission to this file. 600 permission allows the owner to read and write the file.
- Go to the Root folder of your WordPress site
- Select wp-config.php file
- Right-click on your mouse to select “File Permissions”
- Enter 600 in the “Numeric value” field of the permission dialogue box
- Select “Apply to Files only” button and click “OK” button
Permission for .htaccess File:
The final step in completing the file & folder permission issue is to give proper 644 permission to the .htaccess file. With this permission, anyone on the system can read the file but the owner only has both read and write access.
- Go to the Root folder of your WordPress site
- Select .htaccess file
- Right-click on your mouse to select “File Permissions”
- Enter 644 in the “Numeric value” field of the permission dialogue box
- Select “Apply to Files only” button and click “OK” button
Ensure everything mentioned in the blog is done properly to avoid issues like “Internal server error”, and “404-Page not found” errors etc,
We really hope this article will be helpful to solve your file and folder permission errors in WordPress. Share this knowledge to your friends and colleagues in the social platform and be a hero!