Skip to content

Add wp db status command for quick database health overview #306

Open

Description

@mehrazmorshed

I would like to suggesta new WP-CLI command: wp db status

The command would provide a concise, read-only overview of the current WordPress database health and configuration in a single output, reducing the need to run multiple separate commands.

For support, debugging, and hosting diagnostics, it would be beneficial to have a single, non-destructive command that aggregates key database information into one quick report.

Currently, checking database status requires running several commands such as: wp db size, wp db tables, wp db prefix, wp db check, etc.

My Proposed Command:

wp db status

Output Example:

Database Name:     wp_mehrazmorshed
Tables:            54
Total Size:        312 MB
Prefix:            wp_
Engine:            InnoDB
Charset:           utf8mb4
Collation:         utf8mb4_unicode_ci
Check Status:      OK

Activity

  1. Soean commented on Jan 29, 2026

    @Soean

    There is a new package called site-health-command. (Included in the next WP CLI 2.13 release)

    You can run wp site-health info wp-database --private

    Result:

    field private label value debug
    extension Database Extension mysqli
    server_version Server version 8.0.35
    client_version Client version mysqlnd 8.5.1
    database_user 1 Database username root
    database_host 1 Database host localhost
    database_name 1 Database name local
    database_prefix 1 Table prefix wp_
    database_charset 1 Database charset utf8mb4
    database_collate 1 Database collation utf8mb4_unicode_520_ci
    max_allowed_packet Max allowed packet size 16777216
    max_connections Max connections number 151
  2. mehrazmorshed commented on Jan 29, 2026

    @mehrazmorshed
    Author

    Couldn't run in current setup.
    I hope it will release soon.

    Image
  3. ernilambar commented on Jan 29, 2026

    @ernilambar
    Member

    It will be included in next "3.0.0" version.

  4. swissspidy commented on Jan 29, 2026

    @swissspidy
    Member

    Yeah you can already try it out in the nightly release.

    One difference is that the site-health command involves loading WordPress, whereas the db commands usually also work when WordPress is not even installed yet.

  5. ernilambar commented on Jan 30, 2026

    @ernilambar
    Member

    Although database info is available from "site-health" command I am positive is adding specific db command which gives info without loading whole WordPress. It would be helpful in scripting.

  6. transferred this issue fromwp-cli/ideason Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions