WordPress is so easy to install, you may never need to look at the WordPress server directories and file structure of a WordPress site on a server.
However, understanding WordPress server directories and file locations can help if you ever need to expand and customize WordPress for yourself or your clients.
WordPress developers should understand the importance and usage of each folder and file in WordPress, but if you are just getting started or need a “refresher,” we will look at the most important aspects of WordPress server directories.
Default WordPress Server Directories
wp-config.php & .htaccess
wp-config.php – The wp-config.php file is the main configuration file of your WordPress site.
- If your site is having trouble connecting to the database, there is a good chance there is an issue with this file.
- The database name, username, password, and location of the database are all defined in the wp-config.php file.
- The WordPress SALT keys and other variables can be and are defined in this file.
.htaccess – While this file may be hidden from your view it still exists on most WordPress sites.
- (The period (.) before the file name indicates it is a hidden file.)
- If your server is an Apache-based server (not an Nginx-based server), then your site needs this hidden file to create the nice looking URL structure you set in the Settings -> Permalinks area of the WordPress admin area.
- The three folders you see above are essential parts of the WordPress server directories structure.
The 3 Required Folders
The following folders are required by WordPress. If you ever find that you are missing one of these folders, you will either need to restore a backup or reinstall WordPress.
/wp-includes/ – This folder contains all the PHP files and classes that WordPress needs to function.
- You do not want to edit ANY of the files in it.
- Every time a WordPress update comes out, this folder will get overwritten.
- In this folder, you will find files like all the included jQuery files and so many other included functions and classes.
/wp-admin/ – This folder contains all the necessary files to create the WordPress admin dashboard.
- You will find the functionality to write posts, moderate your comments, install plugins and themes, and every other function you can do in the admin dashboard.
- This is another folder, like the /wp-includes/ folder, that you do not want to edit ANY files.
/wp-content/ – This folder contains all of your files that are unique to your own WordPress site.
- Most developers would say this folder is the most important folder of all your files and folders in the WordPress server directories.
- This means all plugins, themes, custom functions, file uploads, images, etc will all be stored in folders contained within the /wp-content/ folder.
3 Important Files
Inside the /wp-content/ folder you will find multiple folders but the three most important folders are:
/wp-content/plugins/ – The /plugins/ folder will contain all of your uploaded plugins (including the two default plugins that come with WordPress). Individual plugins can either be a single file plugin or inside a unique folder for each plugin.
/wp-content/themes/ – All of your uploaded (and default) WordPress themes will be stored in this folder.
/wp-content/upload/ – Any time you upload an image or add files through the visual editor or Media Manager in WordPress, those files will be stored in this /upload/ folder. Normally, your uploaded files will be stored in additional folders that are broken down to Year and Month.
If you ever find yourself on a WordPress snippet code site and the instructions have you placing the code in your functions.php file, you can normally find the correct functions.php file in the /theme/ folder.