Every wp dbtk command, its options, and a quick example. Run any command with --help for inline WP-CLI documentation.
Discover, search, inspect, and call WordPress REST API endpoints.
List REST routes from the schema store.
Syntax:
wp dbtk api list [--namespace=<namespace>] [--method=<method>] [--source=<source>] [--format=<format>]
| Option | Description |
|---|---|
--namespace=<namespace> | Filter by REST namespace, e.g. wc/v3 or wp/v2 |
--method=<method> | Filter by HTTP method: GET, POST, PUT, DELETE |
--source=<source> | Filter by plugin slug, e.g. woocommerce or wpdebugtoolkit |
--format=<format> | Output format: table (default) or json |
Shows WPDT endpoints by default. Run wp dbtk api discover first to include all site routes.
Example:
wp dbtk api list --namespace=wc/v3 --method=GET
Scan all registered REST routes and save them to the schema store.
Syntax:
wp dbtk api discover
No options. Scans active plugins, themes, and WordPress core. Results are available immediately to list, search, and show.
Example:
wp dbtk api discover
# Success: Discovered 187 routes across 12 sources.
Call any REST endpoint via internal dispatch. No HTTP round-trip — goes through the WordPress REST server directly.
Syntax:
wp dbtk api call <method> <route> [--params=<json>] [--profile[=<mode>]] [--format=<format>]
| Argument / Option | Description |
|---|---|
<method> | HTTP method: GET, POST, PUT, DELETE |
<route> | REST route path, e.g. /wp/v2/posts or /wc/v3/products/42 |
--params=<json> | JSON object of request parameters |
--profile | Enable full profiling (timing, memory, queries, PHP errors) |
--profile=full | Same as --profile |
--profile=queries | Timing, memory, and query analysis only |
--profile=summary | Timing, memory, and total query count only |
--format=<format> | Output format: json (only option currently) |
Authentication uses the current WP-CLI user. Pass --user=<id> to the wp command to authenticate as a specific user.
Examples:
wp dbtk api call GET /wp/v2/posts --params='{"per_page":5}'
wp dbtk api call POST /wpdebugtoolkit/v1/query-logger/record --params='{"duration":60}'
wp dbtk api call GET /wc/v3/products --profile
wp dbtk api call GET /wc/v3/products --profile=queries
Show full detail for a specific REST route: methods, parameters, auth, and description.
Syntax:
wp dbtk api show <route> [--format=<format>]
| Argument / Option | Description |
|---|---|
<route> | REST route path, e.g. /wc/v3/products |
--format=<format> | Output format: table (default) or json |
Example:
wp dbtk api show /wc/v3/products
wp dbtk api show /wpdebugtoolkit/v1/settings --format=json
Search routes by keyword across route paths, descriptions, and parameter names.
Syntax:
wp dbtk api search <keyword> [--format=<format>]
| Argument / Option | Description |
|---|---|
<keyword> | Search term |
--format=<format> | Output format: table (default) or json |
Example:
wp dbtk api search "product"
wp dbtk api search "debug" --format=json
Annotate an endpoint with a custom description.
Syntax:
wp dbtk api edit <route> --description=<description>
| Argument / Option | Description |
|---|---|
<route> | REST route path to annotate |
--description=<description> | Description text to save (required) |
Example:
wp dbtk api edit /wc/v3/products --description="List WooCommerce products"
Manage WordPress debug settings (WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY).
Enable WordPress debugging.
Syntax:
wp dbtk debug on [--display]
| Option | Description |
|---|---|
--display | Also enable WP_DEBUG_DISPLAY (shows errors on screen) |
Sets WP_DEBUG = true and WP_DEBUG_LOG = true in wp-config.php.
Example:
wp dbtk debug on
wp dbtk debug on --display
Disable WordPress debugging.
Syntax:
wp dbtk debug off
Sets WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY all to false.
Example:
wp dbtk debug off
Show current debug settings.
Syntax:
wp dbtk debug status [--format=<format>]
| Option | Description |
|---|---|
--format=<format> | Output format: table (default) or json |
Shows WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY, SAVEQUERIES, enhanced logging status, and log path.
Example:
wp dbtk debug status
wp dbtk debug status --format=json
Manage the WordPress debug log (debug.log).
Clear the debug.log file.
Syntax:
wp dbtk log clear [--yes]
| Option | Description |
|---|---|
--yes | Skip confirmation prompt |
Example:
wp dbtk log clear
wp dbtk log clear --yes
Show debug log file statistics.
Syntax:
wp dbtk log stats [--format=<format>]
| Option | Description |
|---|---|
--format=<format> | Output format: table (default) or json |
Shows path, existence, file size, and last modified time.
Example:
wp dbtk log stats
Manage database query logging.
Enable query logging. Enables SAVEQUERIES and the enhanced query logger.
Syntax:
wp dbtk query-log on
Example:
wp dbtk query-log on
Disable query logging.
Syntax:
wp dbtk query-log off
Example:
wp dbtk query-log off
Clear query log files.
Syntax:
wp dbtk query-log clear [--all] [--yes]
| Option | Description |
|---|---|
--all | Clear all rotated query log files, not just the current one |
--yes | Skip confirmation prompt |
Example:
wp dbtk query-log clear
wp dbtk query-log clear --all --yes
Show query logging statistics.
Syntax:
wp dbtk query-log stats [--format=<format>]
| Option | Description |
|---|---|
--format=<format> | Output format: table (default) or json |
Shows enabled status, slow query threshold, log path, log size, and total entries.
Example:
wp dbtk query-log stats
wp dbtk query-log stats --format=json
Manage the standalone log viewer.
Install the standalone log viewer into the web root.
Syntax:
wp dbtk viewer setup --password=<password>
| Option | Description |
|---|---|
--password=<password> | Password for viewer authentication (required, minimum 8 characters) |
Requires an active license with the Viewer or Query Monitor module. The viewer is installed at https://yoursite.com/wpdebugtoolkit/ by default.
Example:
wp dbtk viewer setup --password=MySecurePass123
Remove the standalone log viewer.
Syntax:
wp dbtk viewer remove [--yes]
| Option | Description |
|---|---|
--yes | Skip confirmation prompt |
Example:
wp dbtk viewer remove
wp dbtk viewer remove --yes
Show viewer installation status.
Syntax:
wp dbtk viewer status [--format=<format>]
| Option | Description |
|---|---|
--format=<format> | Output format: table (default) or json |
Shows whether the viewer is installed, the URL directory, password protection status, and full URL.
Example:
wp dbtk viewer status
Manage the WP Debug Toolkit Pro license.
Activate a license key.
Syntax:
wp dbtk license activate <key>
| Argument | Description |
|---|---|
<key> | The license key to activate |
Example:
wp dbtk license activate XXXX-XXXX-XXXX-XXXX
# Success: License activated. Tier: Pro. Modules: viewer, query, email.
Deactivate the current license.
Syntax:
wp dbtk license deactivate
Example:
wp dbtk license deactivate
Show current license status.
Syntax:
wp dbtk license status [--format=<format>]
| Option | Description |
|---|---|
--format=<format> | Output format: table (default) or json |
Shows status, tier, plan name, expiry date, and licensed modules.
Example:
wp dbtk license status
wp dbtk license status --format=json