Where are WordPress Pages & Posts Stored? How to Find Them?
WordPress contributes to the creation of a lot of websites. To be precise, WordPress powers 43% of the websites on the internet. This is an astonishing figure.
This popularity of WordPress is due to the following reasons:
- You can build a website without even knowing how to code
- Several features like adding these stunning modern homepage slider designs come out of the box
- The open-source platform allows a lot of developers to build additional functionalities on it
- Layouting a website is as easy as creating slides
- Above all, it is a Content Management System (CMS) that comes for free
CMS is often used by website developers a lot. With this technology, the development of websites is very easy.
What is a Content Management System (CMS)?
A Content Management System is application software that allows users with different roles to add, update, read, produce, and store digital content.
Several CMSs are built on many platforms. Joomla, Drupal, Magento, and Prestashop, to name of few. Several others belong to both open-source and proprietary.
What is WordPress?
WordPress is one of the many CMSs out there that does a great job. It has a user interface that makes it so easy to handle and a lot of additional functionalities that you can extend using its themes and plugins.
While the themes extend the cosmetics of the website, the plugins extend functionalities from small ones to major applications.
WordPress technologically is built on PHP and MySQL. While HTML and CSS are added to the cosmetics of the creation.
How does WordPress work?
WordPress platform is divided into Root, Admin, Include, and Content.
- Include and Root contains the Core files.
- The admin folder contains the files required to run the admin panel
- The content folder contains the themes like Kadence, Astra, Blocksy, plugins like Essential Grid, WooCommerce, and media
Among the core files, only the one in the root folder by the name wp-config.php can be changed. Changing any other fire other than this will be at your own risk.
Using these files and a database (connect to the WordPress database by following this article), WordPress works as a dynamic application that is full of PHP and MySQL codes.
Where is the content stored in WordPress?
All the content that we write and add to the website, in the form of text, photos, videos, links, audio, and many more file formats are all stored in the database.
Of course, the media files like images, videos, audio, etc. are first uploaded to the “Media” folder in the “Content” folder. After they are uploaded, their path is saved in the database corresponding to different activities.
The immediate question that arises is:
What is a Database?
A database is an organized set of structured data typically used for easy access, management, creation, and updating. They are usually stored in rows and columns and are managed using queries.
If you are unable to understand anything from what we said earlier, you don’t need to worry. We will make you understand what exactly we mean in the previous section, going forward.
Where are WordPress pages and posts stored?
As told earlier, the content is stored in the database. We are not going to get into details of what a database is. For now going by our definition from the previous section, let us start to understand where WordPress Stores its pages and posts slowly using screenshots.
Since we know that the pages and posts are stored in the database, we will have to get access to the database where they are stored. There are many ways of getting this access. Let us first follow the most common way, via cPanel.
How to Login to cPanel?
The most common way of login into cPanel is via a browser that you like. We are using Google Chrome here.
To log in you need a URL. This URL cannot be accessed the same way throughout. It depends on the portal which we have purchased the hosting services from.
The most popular hosting providers are:
We are using the service of NameCheap. It will be more or less the same procedure as the other providers. Try to understand the overall concept and you will be good to go.
So, let us now start to get into the database. The first step is to log in to the NameCheap account where we have purchased the hosting services.
Once you log in, select the hosting service that you have purchased and hover over the below icon.
You can see the following popup menu from where you can directly select “Go to cPanel”.
That’s it. You are now accessing the cPanel without even entering the credentials (the username and password).
How to access the cPanel Database?
Once you are in the cPanel, you need to access the database. To do that you need to make use of the search panel. Type “Php MyAdmin” to access the database.
phpMyAdmin is an application that allows you to access the database, tables, etc. in a graphical user interface (GUI).
This is what the phpMyAdmin looks like.
Select the right database that is a part of this website from the left sidebar. Every database will have several tables. Each table will have a different name.
Once you select a database, all the tables that the database contains will be displayed on the right side.
Every table will have a prefix for security purposes. While the installation, this can be selected. Some tables are default and standard. Some others are added when you install new plugins.
Which table in the database stores the WordPress Posts and Pages?
Now, you have to look for the table by the name “yourprefix_posts”. “yourprefix” is the prefix that you have selected during the time of installation.
Once you selected the table, you will be shown the data that the table contains. This is the table where all the posts and pages are stored. You should not get misled by the name of the table.
Even though the name of the table is xx_posts it contains data including the pages, global styles, posts, revisions, etc.
The field that differentiates posts from pages is post_type. From the above image, you can see the posts that are a part of this website.
Now, we got to know where the content of the posts is. We should now understand how the posts and pages are displayed.
Where to find WordPress Pages and Post Templates?
Like how the database is categorized as tables, the theme layouts are categorized as PHP files in WordPress.
To access this, you can either make use of the built-in editor available for WordPress or you can access the pages as files from the cPanel File Manager.
Let us do the first one first.
How to access the Page and Post Templates from WordPress?
Go to Appearance > Theme File Editor.
Now, you can go to the right sidebar and search from these two pages. You will be shown the PHP code of these pages when you click on them, so you can customize them even if you know a little bit of PHP.
Where are WordPress pages in cPanel?
If you want to find the same PHP files from the cPanel, you can start from the login. This is what the cPanel looks like.
Search for File Manager using the search bar.
Where are my WordPress pages in File Manager?
Click on it and you will be taken to the folder where you have installed WordPress, where you can see the below three folders.
Open the wp-content > themes > your-theme, where you can find the two files using which you can customize the page and post layouts.