Are you want to learn WordPress files and directory structure?
WordPress files and directory structure are important to learn for beginners, who are just started to learn WordPress.
As we all know, WordPress is open-source software and is available for everyone for free.
Here in this article, we are going to learn about the WordPress file and directory structure in detail.
What is WordPress:
WordPress is an open-source and free content management system basically called CMS.
It is made on the PHP programming language paired with the MySQL and Maria DB database. Its architecture is based on the template and plugin system.
You can expand the feature of WordPress by adding different plugins to WordPress. Change the design and appearance of the website by installing the themes.
There are thousands of themes and plugins available in the WordPress directory for free. Which you can use to extend the functionality of your WordPress website.
WordPress was released on 27 May 2003, by its founder American developer Matt Mullenweg.
You can make any type of website using WordPress from portfolio websites to eCommerce websites.
Why you should learn about WordPress files and directory structure:
Many of the users are using WordPress for running their website and they don’t know about the basic of WordPress.
How WordPress works, its file and directory structure.
If you are a WordPress user and run your website on WordPress. Then it is best to know the WordPress file and directory structure so that you can also solve the basic errors.
There are many WordPress problems that occur which can be solved easily if you have knowledge of WordPress files and directory structure.
Here in this article, you will learn about WordPress files and directory structure in detail.
So, if you are just entering into the WordPress world then this article will really add value to your knowledge.
What you will get from this article:
- You will learn which WordPress files are the core files of WordPress.
- You will get to know how WordPress stores your images and uploads.
- Where the plugins and themes are stored.
- Where the WordPress configuration files are stored during the installation.
Now let’s see everything step by step.
WordPress files and directory structure:
WordPress is software which is based on the PHP programming language. Knowing the file structure and directories will short out most of the WordPress problems.
Let’s understand the structure of the WordPress files and directories by the infographic, given below:
After seeing the above infographic, you will get the quick idea about the WordPress files and directory structure.
For accessing the files and directory of the WordPress from the server, you have to use the FTP client such as the FileZilla or the other file manager, so that you can easily connect to the server.
Or if you want to see the WordPress files and directory in the local host you can also do the same by following the same process.
After the connection to the server, you can see the following files and directory structure which looks like this:
Inside the root folder, you will see the files which help WordPress to run properly.
Inside the root folder, there are two files that will create during the installation of WordPress. And these two files are the .htaccess file and the wp-config.php file.
These are the WordPress core files and folders which you will see in the WordPress website’s root directory.
Three WordPress directories in the root folder:
apart from these directories, you will also see other core files of WordPress.
All these files are WordPress core files and we recommend you not to change any of the files because when you change them.
They will directly affect your website performance and even break your website completely.
Now let’s see the function of each file.
WordPress Configuration Files:
For the configuration with the database and other settings, WordPress will auto-generate the two files during the installation process.
And these two files are .htaccess and wp-config.php files.
Now let’s see what are the uses of these files in WordPress and how they work.
.htaccess file: .htaccess is a configuration file used by the Apache web server software. It can be used to configure various settings for a website, including URL rewriting, password protection, and custom error pages.
wp-config.php: wp-config.php is a configuration file used by WordPress. It contains important information such as the database connection settings and security keys.
This file is typically located in the root directory of a WordPress installation and should be kept secure to prevent unauthorized access to the website’s database.
Both these files are important for the proper functioning of a WordPress website.
In short, the key features of the .htaccess file are as follows:
- URL rewriting: This allows you to create custom URLs for your website, which can make it easier for users to remember and navigate.
- Password protection: Allows you to restrict access to certain parts of your website by requiring a username and password.
- Custom error pages: Allows you to create custom error pages for different types of errors, such as “404 Not Found” or “500 Internal Server Error”.
In short, the key features of the wp-config.php file are as follows:
- Database connection settings: This includes the database name, username, password, and server. WordPress uses this information to connect to the database and retrieve the necessary information to display your website.
- Security keys: These are random strings of data that are used to encrypt information in the WordPress database, such as passwords. It is important to keep these keys secure to prevent unauthorized access to your website’s data.
- Other settings: It also includes various other settings such as table prefixes, debugging options, and language settings.
It is important to keep both of these files secure to prevent unauthorized access to your website. If either of these files is compromised, it could result in data loss or your website being hacked.
It is recommended to take regular backups of both these files and keep them in a safe place.
The wp-admin folder:
The wp-admin folder is the most important folder in the WordPress root folder and it is responsible for the WordPress admin control.
wp-admin folder in a WordPress installation contains the files and scripts that power the WordPress dashboard or administration area.
This is the area where users with administrative access can manage the content, settings, and appearance of their websites.
The wp-admin folder contains several subfolders and files that are used to manage different aspects of a WordPress website.
Some of the key files and folders within the wp-admin folder include:
- includes: This folder contains a number of PHP files that are used to include various functions and classes used by the WordPress dashboard.
- images: This folder contains images used by the WordPress dashboard.
- CSS: This folder contains the stylesheets used by the WordPress dashboard.
- php: This file is responsible for creating the main menu structure for the WordPress dashboard.
It’s important to note that you should never modify any of the files in the wp-admin folder unless you know exactly what you are doing as it could cause errors or break the functionality of the website.
If you need to make changes, use a child theme or a plugin that allows customization without modifying core files.
Also, it is important to keep the wp-admin folder and all the files within it secure.
It is a common target for hackers, so it is recommended to use a strong username and password for the administrator account and limit the number of users with administrative access.
The wp-content Folder:
The wp-content folder is also an important folder where all the media files and uploads are stored.
“wp-content” folder in the WordPress root directory is where users can store their themes, plugins, and uploads.
Themes control the appearance of a WordPress site, while plugins add specific functionality.
The “uploads” folder within the “wp-content” folder is where any media files, such as images and videos, are stored when they are uploaded to the site.
This folder can be customized or replaced by some plugins. It’s important to keep a backup of this folder as it contains all the important data of the website.
The wp-includes folder:
The wp-includes folder is also an important folder and is responsible for the proper functioning of the website.
“wp-includes” folder in the WordPress root directory contains the core code and libraries that power the WordPress platform.
This folder is not intended to be modified by users and any changes made to it can cause issues with the website.
This folder contains the bulk of the functionality that makes WordPress work, such as the database abstraction layer, the API for various features, and the code that handles user authentication and permissions.
It also contains the core code that generates the web pages, as well as the code that handles comments, taxonomies, and other features of the platform.
In short, it’s a core part of WordPress and should not be modified unless you’re an experienced developer and know what you’re doing.
All these are the important files that we have discussed above and are not to be changed as they are the core files.
If you want to make any changes to your website then ask for an expert developer to do so.
Before doing any changes to your website it is highly recommended to take back up your website.
The wp-content folder is the most important folder where all the important files and uploads are get saved.
There is no need to take back up of whole files and folders which are outside the wp-content folder, only take the backup of the wp-content folder.
It makes it easy to restore the website in case you break your website accidentally.
This is all about the WordPress files and directory structure, hope you understand all about each folder and file in the WordPress CMS.
It will help you in solving problems related to WordPress file errors.
If you still have issues with your WordPress website then you can contact us for any technical support.