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.
Handling WordPress files requires care and understanding of their functions. Here are some key points to consider:
Understanding Core Files & Folders
WordPress is fundamentally an assortment of files and folders, each with a different function and task. Some of the key files and folders include wp-admin, wp-content, wp-includes, .htaccess, index.php, and wp-config.php. Each of these files and folders has a specific role in the functioning of your WordPress site.
Backing Up Files
When making changes to user files it’s imperative that you make a backup.
There are a few ways you can do this:
- 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.
- 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.
Editing Files
Some files, like .htaccess and wp-config.php, may require editing to fix common issues or perform tweaks and manual changes. Always be careful when editing these files, as a single mistake can break your website or introduce a fatal vulnerability.
Remember, always have a backup before making any changes to your files or folders. If you’re unsure about making these changes yourself, you may want to consider hiring a professional for assistance.