Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Open Your WordPress Database

Your posts, pages and settings live in a database. Learn how to open it with phpMyAdmin or from the dashboard.

WordPress2 min read11 steps10 screenshots

What is in the database

Every WordPress site has a MySQL or MariaDB database. It stores your posts and pages, comments, users, settings, categories and the data of your plugins and themes. The data sits in tables such as wp_posts, wp_comments, wp_users and wp_options.

Warning: A wrong change in the database can break your site or delete data. Take a backup before you edit anything.
WordPress data stored in a database

Open it with phpMyAdmin in cPanel

  1. Log in to cPanel. Your welcome email has the address and login details.
    The cPanel login page
  2. Scroll to the Databases section and click phpMyAdmin.
    phpMyAdmin in the cPanel Databases section
  3. phpMyAdmin opens. The tables of your databases are listed on the left.
    WordPress tables in phpMyAdmin

Find the right database

An account can have several databases. To find the one your site uses:

  1. Go back to the main cPanel page and open File Manager.
    File Manager in cPanel
  2. Open the public_html folder.
    The public_html folder
  3. Right-click the file wp-config.php and choose Edit. Look for the line DB_NAME. The value is the name of your database.
    The database name inside wp-config.php
  4. Return to phpMyAdmin and select that database.

Open it from the WordPress dashboard

Use this way only if you have no access to cPanel. It needs a plugin.

  1. In the dashboard, go to Plugins, then Add New Plugin.
  2. Search for wp phpmyadmin, then click Install Now and Activate.
    Installing the WP phpMyAdmin plugin
  3. Click the button Enter local phpMyAdmin or Enter hosting's phpMyAdmin.
    The button that opens phpMyAdmin
  4. Browse the tables, edit rows or run SQL queries.
    The database opened from the dashboard

Example: delete spam comments

This query removes all comments marked as spam:

DELETE FROM wp_comments WHERE comment_approved = 'spam';

Quick recap

  • The database holds almost everything on your site.
  • phpMyAdmin in cPanel is the best way in.
  • Read wp-config.php to find the right database name.
  • Back up first, then edit.