Working with your directories via SFTP, git, and some other operations related to installing plugins or themes can cause your file permissions to get changed. These changes can lead to errors and make it so that you can not make changes to files within your /wp-admin/. If you see the following errors then you know that your file permissions need to get reset:
- failed to open stream: Permission denied in /xxx/content/live/…
- Could not copy file.: /xxx/content/live/account_name/readme.html – Installation Failed
- Failed to load resource: the server responded with a status of 403 (Forbidden)
Essentially if you see any of these errors or anything that looks like these errors (those containing words like “forbidden”, ”denied” or “failed”) then it’s probably safe to assume that your file permissions need to be reset.
HOW TO RESET FILE PERMISSIONS
File permissions can be restored to their proper defaults eithin your WordPress Admin Dashboard. When resetting file permissions using either method, it will reset the permissions for both your live and staging environments.
WORDPRESS ADMIN DASHBOARD
Within your WordPress Admin Dashboard, you can find the option to reset file permissions in the Force WP tab.
- Log into your site’s WordPress Admin Dashboard (exampledomain.com/wp-admin/)
- Navigate to the Force WP tab in the top of the left navigation column
- Choose “Reset File Permissions”
- Allow 1-2 minutes for the file permissions reset to be performed (for smaller sites this takes a matter of seconds, but for sites with a large number of files the process could be longer).