Beginner's Guide To WordPress File Structure & Database
Beginner's Guide To WordPress File Structure & Database
✕
START FREE a
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
After WordPress installs on your website, two things happen. One, a bunch
✕
START
of files are installed into your site and two; a database is created. FREE
And in
Enter
orderyour
tosite URL to SCANthe
understand for malware on 150+ parameters
basic WordPress file structure, we must
understand these files and the database. SCAN >>
To understand the WordPress file structure, let’s take a look at the files of
WordPress. Files of WordPress can be thought of as follows: codes,
uploads, and configurations.
1> Code –
Codes to WordPress is what bricks are to a building. They are used to build
a WordPress site. Codes can be divided into three parts – Core, Plugins,
and Themes. Core, Plugins and Themes work in tandem to create your
site.
The core is the heart of WordPress. The CMS’ most important files are
stored here. WordPress has 3 Core files – wp-admin, wp-content, wp-
includes. Any modification in the core could break your site.
Plugins and themes help design your WordPress site in any way you
desire. When you install a plugin it is stored in a file called Plugins. And
themes are stored in a file called Themes.
2> Uploads –
When you write a post with images, it becomes a part of WordPress. The
images are uploaded and stored as a file, and the file is called Uploads.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 2/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
WordPress Files:
WordPress consists of a bunch of files, and the main ones are wp-admin,
wp-content, wp-includes, and wp-config. Going ahead, we’ll learn
what the files are and where can they be found which will give us an idea
of WordPress file structure.
To access these files, you will have to visit your web host account. Log in
to your web host and go to a page called cPanel. There, you should be able
to find an option for File Manager. Select that, and a page will open that
would look something like this:
This is a typical file manager page. On the left-hand side, there are a
bunch of folders. The wp-admin, wp-content, wp-includes, and wp-config
files can be found in a folder called public_html. (In the picture below,
you can see wp-admin, wp-content, wp-includes, and wp-config right
under public_html).
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 3/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
1. wp-admin
The wp-admin folder contains administrative files that power the
WordPress dashboard. The first thing that you see after logging into your
WordPress site is the WordPress dashboard. It looks like this:
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 4/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
When you are trying to log in to the dashboard, WordPress checks whether
the credentials that you have provided are correct, or whether you are an
admin or a simple contributor with limited access to the site. The files in
the wp-admin folder enable WordPress to carry out these functions. The
files also enable a bunch of other functions like loading of the dashboard,
making a connection to the database, etc.
2. wp-includes
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 5/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
Files in the wp-includes are responsible for how WordPress looks. This
folder is large in size, and most of the WordPress core files are ✕
START FREE
stored
Enter yourhere. Thetotext
site URL SCANthat
forwe see on
malware onWordPress, the font of the text – all
150+ parameters
these are enabled by the files in the wp-includes folder. TheSCAN >>
files also
contain rules, hierarchies, and action command for some of the WordPress
features.
3. wp-content
The wp-content folder is where themes, plugins and other uploads
are stored. Whenever you install a theme, it’s stored in the Themes
folder; plugins are installed in the Plugins folder and the images that you
upload are stored in the Uploads folder.
– Plugin Folder
Understanding how things work in wp-content will help us further
understand the WordPress file structure. Let’s install a WordPress plugin on
my site. I have quite a number of plugins on my site. As you can see
(image below) on the right-hand side, there are plugins like Better WP
Security, BJ Lazy Load, BlogVault Real Time Backup, etc.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 6/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
The plugin now appears in the Plugin folder of the database which you can
see in the screenshot below.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 7/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
– Upload Folder
Everytime you upload a picture on your WordPress site, it goes into the
Upload folder. To demonstrate, I’ve uploaded an image on my site. I’ve
named the image, MalCare.
After uploading the image, when I visit the File Manager page again, I can
see the image, along with its variations (WordPress generates different
sizes on its own) in the wp-content folder.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 8/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
wp-con g
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 9/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
.htaccess File
.htaccess is present in the public_html folder, and you’d notice that it has
no extension like .html or .txt. or php to this file. Using .htaccess you
can make several changes to your WordPress site. It can help you
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 10/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
With this, we come to the end of the WordPress file structure. Going ahead
we’ll discuss WordPress database as it tends to work very closely with the
WordPress files and directories.
Database:
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 11/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
To access your database, you will have to visit your web host account. Log
in to your web host and go to a page called cPanel. There, you should be ✕
START FREE
able your
Enter to find
site an
URLoption forfor
to SCAN phpMyAdmin. Select
malware on 150+ that, and a page will open
parameters
that would look something like this: SCAN >>
Table 1: wp_commentmeta
wp_commentmeta stores metadata for comments left on your WordPress
site. Information on things like whether a comment is approved, or
pending or trashed are stored in this table.
Table 2: wp_comments
wp_comments stores information surrounding comments left on your
account. It includes unique number assigned to each comment, email
addresses, IP Addresses and URL for the comment author, pingback or
trackback, replies to comments, time and date of the comment, among
other things.
Table 3: wp_links
wp_links takes care of blogrolls (a list of hyperlinks to other blogs or
websites) that was fashionable in the past. WordPress websites had
blogroll by default in the past, but since version 3.5 there have been no
blogrolls. The table remains in the database for backward compatibility,
i.e. if someone is still using older versions of WordPress that has blogrolls,
this particular table will help taking care of the blogroll feature.
Table 4: wp_options
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 12/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
I visited the Setting option from my WordPress dashboard. As you can see
in the picture above, my Site Title is ‘My Blog’, and the Tagline is ‘Just
another WordPress site’. I found that the same information is stored in my
wp_options table. Look at the picture below.
Table 5: wp_postmeta
wp_postmeta stores metadata (like Post ID, meta ID, among other things)
for posts and pages. Identification numbers allotted to each post helps to
store them in a structured manner. The IDs also makes it easier to find
posts and web pages when they are needed.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 13/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
Table 6: wp_posts
✕
START
wp_posts stores information from posts, pages, and the navigation FREE
menu.
Enter
Howyour
is itsite URL tofrom
different SCANwp_postmeta?
for malware on 150+ parameters you’ll find unique
In wp_postmeta,
SCAN >>
identification number allotted to posts and pages whereas in
wp_posts consists of information like post name, author name, post
date among other things. Let’s see how the information of a post is stored
in this table.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 14/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
Table 7: wp_terms
wp_terms stores three things: categories for tags of posts, categories of
posts and link categories. To understand what these things are, let’s take a
look at the pictures below:
Tags of posts
Post Categories
Link Categories
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 15/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
These tags, post categories, and link categories are present in the
wp_terms table of my database.
Table 8: wp_term_relationships
wp_term_relationships stores relationship data for categories and tags
from the wp_terms table. What does that mean? Let’s say there is a post
on your website named A. It belongs to the category 9. This table helps
determine that post A belongs to 9 categories and not some other
category.
Table 9: wp_term_taxonomy
wp_term_taxonomy stores descriptions of the taxonomy (tag, link, or
category) for the entries in the wp_terms table. This table helps
differentiate between tags, or links or categories.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 16/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
I looked up my wp_users table and saw information of the new user had
been stored in there.
With that, we have covered the basics of the database and WordPress file
structure.
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 17/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
✕
Enter Your Goto Email ... START FREE
Enter your site URL to SCAN for malware on 150+ parameters
SCAN >>
Yes, Let's Grow Now
Step-by-Step
How To Install Checklist: 17 How to Set Up
and Setup Important Right WordPress
WordPress Things To Do File
Multisite After Installing Permissions?
Network? WordPress
Key Features ▼
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 18/19
14/04/2020 Beginner’s Guide To WordPress File Structure & Database
Help Resources ▼ ✕
START FREE
Enter your site URL to SCAN for malware on 150+ parameters
Affiliate Partners ▼ SCAN >>
Comparison Pages ▼
Social ▼
Top Articles ▼
Contact Us ▼
About ▼
SHARE
https://www.malcare.com/blog/beginners-guide-to-understanding-the-structure-of-a-wordpress-site/ 19/19