The WordPress Database Demystified

Since it was released over a decade ago, WordPress has become the most popular CMS choice for beginners and experts alike. Although the installation of WordPress, and the addition of data does not require any knowledge of the underlying structure, you might find yourself in a situation where some knowledge of the database is required.

The WordPress Database

Although the favorite choice of users when it comes to working with databases is often phpMyAdmin, we will focus on raw SQL queries, keeping in mind that everyone may not be comfortable with phpMyAdmin (you have an option in phpMyAdmin to run raw SQL queries too!).

Exploring the Database

As you probably know, WordPress uses MySQL. To log into MySQL, run the following in your terminal:

mysql -u [username] -p -D [database_name]

Once you have logged into the WordPress database in MySQL, you can check the tables that WordPress has created by running the following: