Most WordPress users never think about the database - until something goes wrong and they are staring at a white screen. The database is where all your content, settings, users and comments live. Understanding the basics helps you back up properly, fix problems, and keep your site fast.

Table of Contents

What the Database Stores

Every post, page, comment, user, setting and media record is saved in database tables. When a visitor loads your site, WordPress queries the database, assembles the page and serves it. A slow or bloated database means a slow site - which is why database performance matters.

Core Database Tables

  • wp_posts - your content, pages and revisions.
  • wp_options - site settings and configuration.
  • wp_users and wp_usermeta - user accounts.
  • wp_comments - all comments.
  • wp_postmeta - extra metadata for posts.
  • wp_term_* - categories, tags and taxonomies.

How to Access It

Log in to cPanel and open phpMyAdmin. You will see a list of databases - find the one named in your wp-config.php. Here you can browse tables, export backups and run SQL commands. Be careful: there is no undo button in a database.

How to Optimise It

  1. Back up first - always.
  2. Clean post revisions and spam with a plugin or SQL.
  3. Run OPTIMIZE TABLE on large tables.
  4. Enable object caching on WordPress-optimized hosting.
  5. Remove inactive plugins that create tables.

Frequently Asked Questions

Can I delete old post revisions from the database?

Yes. Revisions bloat your database over time. Use a cleanup plugin or set a lower revision limit, but always back up first.

What happens if I delete the wrong database table?

Parts of your site will break - or the whole site will. That is why backups and phpMyAdmin caution are essential. Learn more in our data safety guide.

The database is the engine room of your WordPress site. Respect it, back it up, and keep it optimised, and your site will run smoothly for years.