WordPress database administration

A full database manager, right inside wp-admin

Database Manager lets you browse tables, inspect structure, run raw SQL, design relationships and export backups, all without phpMyAdmin or shell access.

  • Browse, structure and query every table in the database.
  • A visual Designer for viewing and editing foreign key relationships.
  • One-click export for a single table or a full database backup.
  • Write queries stay off by default, until you explicitly enable them.
Database AdministrationDatabase Manager
New TableDesignerBackup
wp_posts2,481 r · 4.2 MB
wp_postmeta9,203 r · 6.8 MB
wp_options612 r · 1.1 MB
wp_postsBrowseStructureSQL
Export SQLTruncateDrop
IDpost_titlepost_status
481Getting Startedpublish
482Pricing Overviewdraft
Write queries are disabled until enabled in settings.
Table structure loadedRead-only until write queries are enabled.
Protected
Quick answer

What does Database Manager do?

When the database_manager module is active, TOWP_Database_Manager adds a dedicated admin screen that lists every table in the site's database with its row count and size, and lets an administrator browse rows, inspect column structure and indexes, run raw SQL, create or rename tables and columns, and design foreign key relationships visually. Read-only queries, SELECT, SHOW, DESCRIBE and EXPLAIN, run immediately; anything that modifies data or schema stays blocked unless a separate "Allow write queries" setting is turned on, and every raw SQL execution, successful or not, gets recorded in TheOneWP's audit log.

The "I need phpMyAdmin, but there isn't one" problem

Some questions only the database itself can answer

Direct database access is exactly what some questions need, and exactly what makes a wrong query genuinely dangerous.

Not every host offers phpMyAdmin or shell access

Answering exactly what a plugin wrote, why a query is slow, or what's left behind after something was deleted sometimes means direct database access that a hosting plan simply doesn't include.

A wrong query is genuinely dangerous

Direct database access is powerful precisely because nothing stops a destructive query from running immediately, which makes an accidental DROP or an UPDATE without a WHERE clause a real risk.

A dedicated WordPress solution

Full access, with a deliberate safety gate

The module puts real database administration inside wp-admin, but keeps anything destructive behind a setting that has to be turned on first.

Browse, structure and query every table

See every table's rows and structure, and run SELECT queries immediately, without any extra setup.

Write queries are off until you turn them on

INSERT, UPDATE, DELETE, ALTER and every other modifying statement stay blocked until "Allow write queries" is explicitly enabled in settings.

Export a table, or the whole database

Generate a SQL dump of a single table, or a full backup of every table, directly from the same screen.

Verified feature set

Real database administration, with real guardrails

Every capability below is present in the supplied PHP class, its AJAX handlers and settings registration.

Browsing

Searchable, sortable, paginated rows

Browse any table's data with search across every column, column sorting, and 25 rows per page.

25 rows/pageSearch all columns
Raw SQL

A real query console

Run any SQL statement, with automatic detection of read-only versus write queries, including inside CTEs.

SELECT/SHOW/DESCRIBE/EXPLAINCTE-aware
Schema tools

Create, alter and rename

Create tables, add or drop columns, modify column definitions, rename tables and reset AUTO_INCREMENT values, all from the interface.

ALTER TABLECREATE TABLE
Designer

A visual relationship builder

See and edit foreign key relationships between tables visually, with the layout saved for next time.

Foreign keysSaved layout
Export & backup

Single-table or full database dumps

Export any one table as SQL, or back up every table in the database at once, both from the same screen.

SQL exportFull backup
Practical use cases

Where direct database access helps most

The module supports the moments no ordinary WordPress screen can answer.

Hosts without phpMyAdmin or shell access

Get full database administration on hosting plans that don't offer either, without installing a separate tool.

Debugging a plugin's stored data

Look directly at what a plugin actually wrote to the database, when its own admin screens don't show enough detail.

Quick exports before a risky change

Pull a single table's data, or a full backup, right before running a migration or a bulk update.

Operational benefits

Power that stays accountable

The module combines real database access with logging and a deliberate gate against accidental damage.

No separate tool requiredFull database access lives inside the same admin a site is already managed from.
A safety net for destructive statementsThe write-query gate means a raw SQL mistake can't modify anything unless that protection has been deliberately turned off.
Every raw query is on recordThe audit log captures every SQL statement run through the tool, successful or not, for later review.
Relationships you can actually seeThe visual Designer makes foreign key relationships between tables something to look at, not something to reconstruct from memory.
Performance behaviour

Bounded results, parameterized queries

The verified implementation guards against runaway results and unsafe query construction.

Bounded result sets

SELECT queries without an explicit LIMIT are automatically capped at 100,000 rows, preventing a runaway query from exhausting PHP's memory.

Prepared queries wherever values are involved

Search, pagination and row operations all use $wpdb->prepare(), keeping every value-based query parameterized.

Live stats pulled once per page load

Table sizes and row counts come from a single information_schema query rather than scanning each table individually.

Security implementation

A gate for writes, a record of everything

The code restricts access tightly and separates the ability to read from the ability to write.

01

Administrator-only, nonce-verified access

Every AJAX action requires both the manage_options capability and a verified towp_db_nonce before doing anything.

02

Write queries require a separate, explicit setting

Any statement beyond SELECT, SHOW, DESCRIBE or EXPLAIN stays blocked unless "Allow write queries" has been turned on deliberately.

03

Table and column names are validated against the live schema

A submitted table name gets checked against the database's actual table list before use, preventing a crafted name from reaching a query.

04

Every raw SQL execution is logged

Successful and failed queries alike get written to the audit log with the statement type and text, creating a record of what ran and when.

Verified compatibility

Built around native MySQL and WordPress APIs

The supplied code integrates through APIs present in WordPress core and MySQL itself. No compatibility claim beyond the verified implementation is assumed.

Schema access

information_schema

Table statistics and structure come from MySQL's own information_schema, the same source phpMyAdmin and similar tools use.

information_schemaSHOW FULL COLUMNS
Query execution

$wpdb

All database access runs through WordPress's own $wpdb object, the same database layer every other part of WordPress uses.

$wpdbNative WordPress DB layer
Logging

TheOneWP Audit Log

Raw SQL execution integrates with the plugin's own audit log system, recording the operation, type and outcome.

TOWP_Audit_LogSuccess & error
Solution comparison

TheOneWP versus common alternatives

Compare the verified Database Manager implementation with phpMyAdmin or direct shell access.

CapabilityTheOneWP Database ManagerOther common solutions
Table browsing and structure Built into wp-admin, no extra tool neededUsually requires phpMyAdmin or shell access
Raw SQL console Read/write detection with a dedicated write-query gatephpMyAdmin runs any query immediately, with no equivalent gate
Visual relationship designer Foreign keys viewable and editable visuallyRarely available outside a dedicated database tool
Query logging Every raw SQL execution recorded in an audit logphpMyAdmin's query log, if enabled at all, lives outside WordPress
Administration One screen inside the same admin as everything elseA separate login, tool, or hosting feature entirely
Recommended workflow

Work with the database safely in four steps

Keep write access closed until a specific task genuinely needs it.

01

Enable Database Manager

Activate the module from the TheOneWP Utility settings tab.

02

Browse and inspect tables

Open the table list, browse rows or view structure for any table, all without needing write access enabled.

03

Enable write queries only when needed

Turn on "Allow write queries" specifically when a task actually requires modifying data or schema, then consider turning it back off.

04

Export before anything risky

Pull a table export or a full backup before running a migration, bulk edit, or any other change that's hard to undo.

Best practices

Use real power deliberately

Direct database access rewards a bit of discipline around when write access actually needs to be open.

01

Leave write queries off by default

Keep the write-query gate closed until a specific task genuinely needs it, then re-close it afterward.

02

Back up before running a write query

Export the affected table, or the full database, before running anything beyond a SELECT.

03

Review the audit log after a session of raw SQL

Confirm what actually ran matches what was intended, especially after a session involving several manual queries.

04

Use the Designer to understand relationships before altering a table

Check what foreign keys reference a table before renaming it or dropping a column it depends on.

Common mistakes

Avoid assumptions that put data at risk

The module's power comes with responsibilities that are easy to overlook in a hurry.

Enabling write queries and forgetting to turn them off

Leaving the write-query gate open longer than necessary removes the safety margin it's meant to provide.

Running a query without a WHERE clause

The write-query gate prevents accidental writes when it's off, but an UPDATE or DELETE without a WHERE clause still affects every row once writes are enabled.

Assuming an export is a full backup

A single-table export only covers that table; the separate "Backup" action is what covers the whole database at once.

Frequently asked questions

Database Manager FAQ

These answers come directly from the verified class, its AJAX handlers and settings registration.

What does Database Manager do?

It adds a full database administration screen inside wp-admin: browsing tables, viewing structure, running SQL, designing relationships and exporting backups.

Can I run any SQL statement I want?

Read-only statements, SELECT, SHOW, DESCRIBE and EXPLAIN, run immediately. Anything that modifies data or schema is blocked unless "Allow write queries" is enabled first.

Is every query I run recorded anywhere?

Yes. Every raw SQL execution, successful or failed, gets logged to TheOneWP's audit log with its type and text.

What happens if I try a write query without enabling that setting?

The request is blocked with an explanatory message, and the attempt still gets logged as an error in the audit log.

Is there a limit on how many rows a query can return?

Yes. A SELECT without an explicit LIMIT is automatically capped at 100,000 rows to avoid exhausting PHP's memory.

Can I see how tables relate to each other?

Yes, through the Designer, a visual view of foreign key relationships that can also be used to add or remove them.

Can I export just one table instead of the whole database?

Yes. A single-table export and a full database backup are two separate actions, both available from the same screen.

Who can access Database Manager?

Only users with the manage_options capability, and every action also requires a verified nonce.

Does this replace the need for a separate backup plugin?

The Backup action produces a SQL export of the database, which can serve as a manual backup, though it's a different feature from a dedicated scheduled-backup module.

Can I create a new table from scratch?

Yes, along with adding and dropping columns, modifying column definitions, and renaming existing tables.

Stop waiting on hosting support for database access.Manage it directly from wp-admin.

Use Database Manager to browse, query and export your WordPress database, with write queries safely off until you turn them on.