Files and folders play a big role in WordPress. One single file that has the wrong set of permissions or faulty code can either break your website or introduce a fatal vulnerability, so have care in changing or editing files/folders.
Backing Up Files
When making changes to WordPress files it’s imperative that backups are made.
- Login to cPanel and navigate to File Manager. Locate the file you want to edit – you may have to change the Settings in order to see hidden files.
- Download the file as is.
- Rename the file in File Manager by adding a random extension. The convention is adding .bak for example. So imagine you were going to change .htaccess, this would become .htaccess.bak.
2.1. Then you’d create a new file and name it .htaccess, and paste it into the clean code, then test.
If changes don’t work, you can always restore the backup file or the renamed file.
Permissions
It’s very important to make sure the files you’re adding/manipulating retain the same permissions as the ones you’re adding. This is especially true if you’re uploading a file instead of changing the one in the environment.