WooCommerce · Guide
How to Access WooCommerce Database (Step by Step)

Short answer
WooCommerce uses your WordPress database, so open phpMyAdmin from your hosting panel, use WP-CLI db commands over SSH, or connect a desktop client with the details in wp-config. Orders sit in HPOS tables like wc_orders, and products in the posts and postmeta tables.
Key takeaways
- WooCommerce shares the WordPress database.
- Database details live in wp-config.
- phpMyAdmin is the easiest way in on most hosts.
- HPOS stores orders in wc_orders tables.
- Run read-only SELECT queries first.
- Back up before any UPDATE or DELETE.
How do you access the WooCommerce database?
WooCommerce stores its data in your WordPress MySQL or MariaDB database, so you access it the same way: through phpMyAdmin in your hosting panel, WP-CLI over SSH, or a desktop database client using the details in wp-config.php.
There is no separate WooCommerce database. Products, orders, customers and settings live in the same database as your posts and users, in a mix of WordPress tables and WooCommerce's own tables.
Most people need database access to check an order, fix a stuck setting, run a report or clean up old data.
Before you touch anything, take a backup. One wrong query can delete orders or break your store, and there is no undo button.
If your store is busy, plan any write queries for a quiet time. Orders keep arriving while you work, and a change made in the middle of checkout traffic is harder to check afterwards.
What do you need before you start?
You need your hosting login or SSH access, your database name, user, password and host from wp-config.php, and a fresh backup of the database.
Checklist:
- Hosting control panel login, such as cPanel or Plesk, or SSH access.
- The database details from
wp-config.php. - Your table prefix, usually
wp_but often different. - A recent database backup you know how to restore.
- Ideally, a staging copy of the store for testing.
Our guide on how to back up a WordPress database explains backup options step by step.
How do you find your database details?
Open wp-config.php in your site's root folder and read the DB_NAME, DB_USER, DB_PASSWORD and DB_HOST values, plus the $table_prefix line.
Use your host's file manager or SFTP to open wp-config.php. Look for lines like these:
define( 'DB_NAME', 'store_db' );
define( 'DB_USER', 'store_user' );
define( 'DB_PASSWORD', '...' );
define( 'DB_HOST', 'localhost' );
$table_prefix = 'wp_';
The WordPress handbook explains each value in its guide to editing wp-config.php.
Never share this file or paste the password into support chats. Anyone with these details can read and change your whole store.
For more ways to find the name, see our guide on how to find your WordPress database name.
How do you open the database in phpMyAdmin?
Log in to your hosting panel, open phpMyAdmin, select your store's database from the left sidebar, and browse or search its tables.
Steps for most cPanel hosts:
- Log in to your hosting control panel.
- Find the Databases section and click phpMyAdmin.
- In the left sidebar, click the database name that matches
DB_NAME. - Click a table to browse its rows.
- Use the Search tab to find specific records.
- Use the SQL tab to run custom queries.
Managed WordPress hosts often have their own database link in the dashboard instead of cPanel. It usually opens phpMyAdmin or a similar tool.
If you see several databases in the sidebar, match the name exactly to DB_NAME. Hosts often keep old or staging databases next to the live one, and they can look almost the same.
When you only need to look, stick to the Browse and Search tabs. They show data without changing anything.
The phpMyAdmin documentation covers browsing, searching and exporting in detail.
How do you access the database with WP-CLI?
If you have SSH access, change to your WordPress folder and use WP-CLI's db commands to run queries, open a MySQL shell or export the database without needing passwords.
WP-CLI reads the details from wp-config.php, so you do not need to type them. Useful commands include:
wp db export backup.sql
wp db tables --all-tables-with-prefix
wp db query "SELECT COUNT(*) FROM wp_wc_orders;"
wp db cli
The wp db command reference lists every subcommand and option.
WP-CLI is faster than phpMyAdmin on large stores. It also avoids browser timeouts when exporting big tables.
Can you connect with a desktop database tool?
Yes. Tools like MySQL Workbench, TablePlus or DBeaver can connect to your store's database if your host allows remote connections or an SSH tunnel.
Many hosts block remote MySQL connections by default. In cPanel, you may need to add your IP address under Remote MySQL.
An SSH tunnel is the safer choice. The tool connects over SSH, then talks to the database as if it were local.
Desktop tools are easier for large result sets and saved queries. Just remember they connect to the live database, so the same care applies.
Where your host allows it, create a separate database user with read-only rights for reporting. Then a mistake in a report query cannot change any data.
Which tables hold WooCommerce data?
WooCommerce data is spread across WordPress core tables, such as posts and postmeta for products, and WooCommerce's own tables for orders, order items, sessions and lookups.
The table below assumes the wp_ prefix. Yours may be different.
| Data | Main tables |
|---|---|
| Products and variations | wp_posts, wp_postmeta, wp_wc_product_meta_lookup |
| Orders (HPOS) | wp_wc_orders, wp_wc_orders_meta, wp_wc_order_addresses, wp_wc_order_operational_data |
| Orders (legacy storage) | wp_posts with type shop_order, wp_postmeta |
| Order line items | wp_woocommerce_order_items, wp_woocommerce_order_itemmeta |
| Customers | wp_users, wp_usermeta, wp_wc_customer_lookup |
| Cart sessions | wp_woocommerce_sessions |
| Tax rates | wp_woocommerce_tax_rates, wp_woocommerce_tax_rate_locations |
| Scheduled jobs | wp_actionscheduler_actions and related tables |
| Settings | wp_options |
Where are WooCommerce orders stored?
Newer stores keep orders in dedicated HPOS tables such as wc_orders, while older stores may still keep orders in the posts and postmeta tables.
High-Performance Order Storage, or HPOS, moved orders out of the posts table into tables built for orders. It became the default for new stores in recent WooCommerce versions.
To check which one your store uses, go to WooCommerce, then Settings, then Advanced, then Features, and look at the order data storage setting.
WooCommerce's developer docs explain the design in the HPOS documentation.
If sync is turned on, orders exist in both places. Edit orders through WooCommerce itself rather than in one table, or the two copies can drift apart.
What are some safe example queries?
Start with read-only SELECT queries, which show data without changing it, and only run UPDATE or DELETE after a backup and a test on staging.
Count orders by status with HPOS:
SELECT status, COUNT(*) FROM wp_wc_orders GROUP BY status;
Find a product by SKU:
SELECT product_id, sku, stock_quantity
FROM wp_wc_product_meta_lookup
WHERE sku = 'ABC-123';
Replace wp_ with your own prefix. For more examples, see our guide on how to query the WordPress database.
Add a LIMIT clause when you explore big tables, such as LIMIT 50. Large stores can have millions of rows in the meta tables, and an open-ended query can slow the whole site while it runs.
Before any change, run the same WHERE clause as a SELECT first. If it returns exactly the rows you expect, you can be more confident the update will hit only those rows.
When should you avoid editing the database directly?
Avoid direct edits for routine changes like order status, stock or prices, because WooCommerce runs hooks, emails and cache updates that a raw SQL change skips.
If you change an order's status in SQL, no customer email is sent, stock is not adjusted and lookup tables may go stale.
Better options for routine work:
- The WooCommerce admin screens.
- Bulk edit and CSV import and export.
- The WooCommerce REST API.
- WP-CLI's
wp wccommands.
Use direct SQL for reading data, reporting and fixing problems that the dashboard cannot reach. For cleanup tasks, our guide on how to optimize the WooCommerce database covers safe approaches.
What if you see a database update notice?
If WooCommerce shows a database update required notice, run the update from the notice or with WP-CLI rather than editing tables by hand.
That notice appears after WooCommerce updates when table changes are needed. Take a backup, then click to run the update.
If it gets stuck, our guide to fix the WooCommerce database update required notice walks through the options.
Frequently asked questions
Does WooCommerce have its own database?
No. WooCommerce uses the same MySQL or MariaDB database as your WordPress site. It adds its own tables, such as order and session tables, and also stores products and settings in standard WordPress tables.
Where are WooCommerce products stored in the database?
Products and variations are stored in the posts table with the product and product_variation post types. Their prices, stock and other details live in postmeta, and a lookup table speeds up searches by SKU, price and stock.
How do I know if my store uses HPOS?
Go to WooCommerce, then Settings, then Advanced, then Features. The order data storage setting shows whether orders use High-Performance Order Storage or the older posts table. New stores use HPOS by default.
Is it safe to edit WooCommerce orders in phpMyAdmin?
It is risky. Direct edits skip emails, stock updates and cache refreshes, and with sync on they can leave two copies of an order out of step. Use the order screen or REST API for routine changes and back up first.
Can I access the WooCommerce database without cPanel?
Yes. Use WP-CLI over SSH, your host's own database tool, or a desktop client through an SSH tunnel. Some managed hosts provide a phpMyAdmin link in their own dashboard instead of cPanel.
Sources
- High-Performance Order Storage WooCommerce Developer Docs
- Editing wp-config.php WordPress Developer Resources
- wp db WP-CLI Command Reference
- phpMyAdmin documentation phpMyAdmin
- High-Performance Order Storage WooCommerce
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


