In this lesson, we will explore the question, where is your WordPress site stored or where does your files live?
Here are the learning objectives.
Access your server via FTP, gain a basic understanding of the file structure, learn how to download and upload files,
and get to know WordPress's main configuration file.
Your hosting provider's server is a computer that you can access to browse and interact with the files that make up your site.
There are several ways to do it.
The most straightforward is via FTP.
FTP stands for File Transfer Protocol, the standard way to transfer files between computers, such as your device and your hosting company's server.
You can use a standalone FTP app like FileZilla or CyberDuck, which enables more advanced options.
But for now, let's explore your server using CPanel's File Manager.
A common browser-based solution supported by most hosting providers.
From your hosting dashboard, open cPanel and select Files and then File Manager.
Next, we'll talk about file structure.
Welcome to your corner of the cloud.
If you've ever browsed around the file system on your local device, this shouldn't look too foreign.
On the left, there's the list of directories and on the right are the files and sub-directories.
Click on the public HTML directory to open it.
This is most likely the root of your WordPress site and contains all the files related to WordPress core, as well as your themes, plugins and any assets you uploaded, such as fonts, images and other media.
Take a moment to browse around and familiarize yourself with the file structure, user interface and different file extensions.
Feeling curious? Select the file and click the view button on the top menu to inspect its contents.
Next, let's explore the wp-content directory.
All the non-core user-controlled content of WordPress is stored in the wp-content directory.
This is where the plugins, themes, languages and uploads are, each with its respective files and sub-directories.
You may see other directories including upgrade, which is used by WordPress during upgrades and others used by plugins to store additional files.
What about downloading files?
If you want to manually backup your site, wp-content is the directory you need to download.
To do that from the cPanel File Manager, select the directory and click the Compress button on the top menu.
Note where the zip file would be saved.
The default is one directory up, so in this case, it would most probably be public_html.
You can type another path if you wish and click Compress files.
Now navigate to the relevant directory.
Select the zip file and click the Download button on the top menu.
Once the file is successfully downloaded to your device, you can delete it from the server.
Select the zip file and click the Delete button on the top menu.
Sometimes you want to upload plugins or themes manually, or otherwise troubleshoot your site.
Doing that via the admin dashboard is obviously easier but isn't always possible.
To upload a file via the cPanel File Manager, drag it from your device into the relevant directory on the server,
or navigate to the desired location and click the Upload button on the top menu.
Similar to the scenario described earlier in the download section, if you want to upload a directory, say an unzipped theme or plugin,
you would need to first compress it on your device.
Then upload the zip file to the server.
To unzip the file, select it and click the Extract button on the top menu.
Next, let's explore wp-config.php, a key file which contains your website's configuration.
WordPress creates the file during the setup process based on the information you provide in the course of the installation.
Interacting with wp-config.php is essential when troubleshooting or setting up Multisite, a network of WordPress sites.
We'll cover both topics in the following lessons so it's a good idea to get to know this file.
But please note, if you plan to enable Multisite, you would need to access a file named .htaccess that's located in the public_html directory.
If you don't see it, click the Settings button in the top right corner to open the Preferences pop-up window.
Select "Show Hidden Files" (dotfiles) and click save.
Let's move on.
Select wp-config.php from the list of files and click the View button on the top menu.
When you scroll down, you'll notice several sections comprised of comments in plain English.
These are the explanations enclosed in asterisks, followed by PHP functions that determine all sorts of settings responsible for how your site functions.
They specify things like database settings, authentication keys and debugging mode status.
For example, the line define( 'DB_NAME', 'MY_DATABASE_NAME' ); tells WordPress the name of your database.
And define( 'DB_USER', 'MY_DATABASE_USERNAME' ); specifies the username associated with it.
Depending on your site's configuration, you may also see additional settings, such as define( 'EMPTY_TRASH_DAYS', NUMBER ); to set the number of days before WordPress permanently deletes trash content.
Or define( 'DISALLOW_FILE_EDIT', true ); to disable the plugin or theme file editor and block access to these areas in the admin dashboard.
And then lastly, define( 'WP_AUTO_UPDATE_CORE', false ); to prevent automatic updates of WordPress Core.
There are dozens of other options.
For the complete list, refer to the Editing wp- config.php page in the WordPress developer resources.
In conclusion, even if you decide to never interact with your site's content outside the WordPress admin dashboard, understanding where it's stored and how to access it deepens your understanding of how the web works.
Hopefully, demystifying the cloud will boost your confidence, either when you work on your site or reach out to others for help.
To learn more, visit the beginner WordPress developer learning pathway, specifically the lesson dedicated to the WordPress file structure.