How to Fix File and Folder Permission Errors in WordPress
WordPress is by far one of the most user-friendly content management systems for creating websites and blogs. The reasons why WordPress is popular are many, however, this isn’t to say that it doesn’t come with its own share of problems. For example, sometimes you may run into an error message regarding file and folder permissions.
Why Does WordPress Need File And Folder Permissions?
You see, all the files in your WordPress website are actually on a computer run by your WordPress hosting company known as the server. This server, through the use of some special software, manages all your files and serves them to the browser.
For WordPress to manage all the files and folders on the server, it needs specific permissions. Without proper permissions, the CMS won’t be able to read, run or modify any of the files hosted on your server.
Now sometimes, due to whatever reason, these file permissions might get changed. This will prevent you from creating folders, uploading images or even running scripts on your website. It could even compromise your WordPress site’s security.
Even though issues with file permissions can cause many problems, luckily all of them can also be quickly resolved. For the purpose of this read, we will be providing you with a step-by-step guide on how to fix files and folders permissions errors in WordPress.
So without further ado, let’s get started!
How To Fix File and Folder Permission Errors?
Do remember to backup your WordPress website before going through any of these steps. In case, something goes wrong, the backup will make sure that your site doesn’t get jeopardized.
Step 1: Access Your WordPress Directory
You can do this either through a cPanel or an FTP Client.
- By Using cPanel
If your hosting provider offers a Control Panel (cPanel), then accessing the root folder will be a piece of cake. All you have to do is log in to your WordPress cPanel – the login credentials should have been provided by your hosting provider. Next, search for the ‘File Manager.’ Once inside look for three specific folders – wp-admin, wp-content, and wp-includes.
- By Using FTP Client
Since some users might not have the privileges of a cPanel, the same can also be done by using an FTP Client. Access your site’s server using the FTP client and search for the same three folders we did before – wp-admin, wp-content, and wp-includes. These folders can generally be found inside ‘public_html.’
Step 2: Fix The Directory’s Permission Settings
Regardless of which method you use, once you locate the three files, select all three of them and right-click. You should be able to spot ‘File permissions’ or ‘Change permissions’ option in the list of choices that pops up.
Click on that, and a new pop-up box will open up. Here you should see three attributes – Read, Write, and Execute, each of which is present for three different owner permissions – User, Group, and Public. You can tweak around with this options if you like, but if you don’t know what you are doing it is best to leave them with their default setting.
What we are actually interested in is the numeric value field down below. This is where we need to insert the number ‘755’ as a measure to solve the problem. These number basically identify the permission levels for the owners we discussed above.
Now once you have inserted the number, down below, you should notice another option. Tick on the ‘Recurse into subdirectories’ options and follow it up by selecting ‘Apply to directories only.’ Next up just click on ‘OK’ and you are done.
Following these steps will now give you full access, and WordPress will be able to read and open folders. However, it will not be able to delete any folders.
Now let’s solve the issue with your files.
Step 3: Fix WordPress File Permission Settings
Previously, you simply selected the three wp folders. Now it’s time to select all the folders and files in the ‘root’ directory. Just press CTRL+A to select all the files and folders, do a right-click, and again click on ‘File permissions’ in the pop-up list.
The same box should appear again. However this time, we won’t be putting in the same numeric values. Instead of ‘755’ type in ‘644’ in the numeric value field.
Once done, this little step will grant you – the owner, the power to read and modify every file. But the visitors and your other group members will only have reading access. Security wise, this is the perfect setting which will reduce security threats and potential hacking attacks.
However, there is one last thing to do before you hit the ‘OK’ button. Like before tick the ‘Recurse into subdirectories’ option, but this time, select ‘Apply to files only.’ Thus, the new setting will only affect your files, and your folders will retain the same options we assigned to them earlier.
Following the above steps should have solved all the file and folder permissions errors you were having. So now it’s time to head on over to your site and check if it worked. Everything should work as it used to and the error you were facing should have disappeared.
However, in case the issue persists, there might be other underlying problems on your website. It is time you get in touch with your hosting provider asap.
What To Do To Avoid Such Issues?
Problems such as these are usually a result of tampering with the core settings of your WordPress website. While WordPress has a user-friendly dashboard, the rule of thumb here is to avoid messing with settings you are not familiar with. And if you need to satisfy your curiosity, avoid experimenting on your main website.
Also, it is advised that you restrict regular users and even collaborators on your website from accessing your WordPress core files. In fact, no one but the administrator should hold the necessary file and folder permissions to modify the site.
Just follow these precautionary steps, and your website should not face this annoying file and folder permissions errors. But if it does, you now know how to fix it!