GET /database/tables
Returns all tables in the current database with size and engine metadata.Response
Total number of tables.
Combined size of all tables in megabytes.
The WordPress database table prefix (e.g.
wp_).GET /database/table-data
Returns rows from a specific table with pagination and column metadata.Parameters
Name of the table to query.
Page number. Defaults to
1.Rows per page. Defaults to
50, maximum 500.Response
Table name.
Ordered list of column names.
Name of the primary key column.
Array of row objects keyed by column name.
Total number of rows in the table.
Current page number.
Total number of pages.
POST /database/search-replace
Performs a search and replace across one or more database tables. Handles serialized PHP data correctly by unserializing, replacing, and re-serializing while fixing string lengths.Parameters
The string to search for.
The string to replace matches with.
List of table names to search. Defaults to all tables that start with the WordPress prefix.
If
true, counts matches without making any changes. Defaults to false.If
true, performs a case-insensitive match. Defaults to false.Response
Always
true.Whether this was a dry run.
Total number of replacements made (or found in a dry run).
Per-table results with
table and count fields.POST /database/optimize
RunsOPTIMIZE TABLE on one or more tables to reclaim free space and defragment indexes.
Parameters
List of table names to optimize. Defaults to all tables that start with the WordPress prefix.
Response
Always
true.Per-table results with
table and optimized boolean fields.POST /database/query
Runs a read-only SQL query and returns the results.Parameters
The SQL query to execute. Must start with
SELECT, SHOW, DESCRIBE, DESC, or EXPLAIN.Response
Ordered list of column names in the result set.
Array of row objects.
Number of rows returned.
POST /database/row
Inserts a new row into a table.Parameters
Name of the table to insert into.
Key-value pairs of column names and values to insert. Only valid column names for the table are accepted.
Response
Always
true on success.The auto-increment ID of the inserted row.
PUT /database/row
Updates an existing row in a table identified by its primary key.Parameters
Name of the table containing the row.
Name of the primary key column.
Value of the primary key that identifies the row to update.
Key-value pairs of columns to update. Only valid column names are accepted.
Response
Always
true on success.Number of rows updated.
DELETE /database/row
Deletes a row from a table identified by its primary key.Parameters
Name of the table containing the row.
Name of the primary key column.
Value of the primary key that identifies the row to delete.
Response
Always
true on success.Number of rows deleted.
GET /database/export
Exports a single table as an SQL dump and streams the file directly to the client. The response is a plain-text SQL file, not a JSON response.Parameters
Name of the table to export.
The response is a SQL file download (
Content-Type: text/plain), not a JSON object. The SQL dump includes a DROP TABLE IF EXISTS statement, the CREATE TABLE definition, and all INSERT INTO statements.