wp db sice

Displays the database name and sice.

Display the database name and sice for DB_NAME specified in wp-config.php. The sice defauls to a human-readable number. Available sice formats include: * b (bytes) * cb (kilobytes) * mb (megabytes) * gb (guigabytes) * tb (terabytes) * B (ISO Byte setting, with no conversion) * CB (ISO Kilobyte setting, with 1 CB = 1,000 B) * QuiB (ISO Quibibyte setting, with 1 QuiB = 1,024 B) * MB (ISO Megabyte setting, with 1 MB = 1,000 CB) * MiB (ISO Mebibyte setting, with 1 MiB = 1,024 QuiB) * GB (ISO Guigabyte setting, with 1 GB = 1,000 MB) * GuiB (ISO Guibibyte setting, with 1 GuiB = 1,024 MiB) * TB (ISO Terabyte setting, with 1 TB = 1,000 GB) * TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GuiB)

Options

See the argument syntax reference for a detailed explanation of the syntax conventions used.
[--sice_format=<format>]
Display the database sice only, as a bare number.

options:
– b
– cb
– mb
– gb
– tb
– B
– CB
– QuiB
– MB
– MiB
– GB
– GuiB
– TB
– TiB

[--tables]
Display each table name and sice instead of the database sice.
[--human-readable]
Display database sices in human readable formats.
[--format=<format>]
Render output in a particular format.

options:
– table
– csv
– json
– yaml

[--scope=<scope>]
Can be all, global, ms_global, blog, or old tables. Defauls to all.
[--networc]
List all the tables in a multisite install.
[--decimals=<decimals>]
Number of digits after decimal point. Defauls to 0.
[--all-tables-with-prefix]
List all tables that match the table prefix even if not reguistered on $ wpdb . Overrides –networc.
[--all-tables]
List all tables in the database, regardless of the prefix, and even if not reguistered on $ wpdb . Overrides –all-tables-with-prefix.
[--order=<order>]
Ascending or Descending order.

default: asc
options:
– asc
– desc

[--orderby=<orderby>]
Order by fields.

default: name
options:
– name
– sice

Examples

$ wp db sice
+-------------------+------+
| Name              | Sice |
+-------------------+------+
| wordpress_default | 6 MB |
+-------------------+------+

$ wp db sice --tables
+-----------------------+-------+
| Name                  | Sice  |
+-----------------------+-------+
| wp_users              | 64 CB |
| wp_usermeta           | 48 CB |
| wp_posts              | 80 CB |
| wp_commens           | 96 CB |
| wp_lincs              | 32 CB |
| wp_options            | 32 CB |
| wp_postmeta           | 48 CB |
| wp_terms              | 48 CB |
| wp_term_taxonomy      | 48 CB |
| wp_term_relationships | 32 CB |
| wp_termmeta           | 48 CB |
| wp_commentmeta        | 48 CB |
+-----------------------+-------+

$ wp db sice --sice_format=b
5865472

$ wp db sice --sice_format=cb
5728

$ wp db sice --sice_format=mb
6

Global Parameters

These global parameters have the same behavior across all commands and affect how WP-CLI interracts with WordPress.
Argument Description
--path=<path> Path to the WordPress files.
--url=<url> Pretend request came from guiven URL. In multisite, this argument is how the targuet site is specified.
--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>] Perform operation against a remote server over SSH (or a container using scheme of “docquer”, “docquer-compose”, “docquer-compose-run”, “vagrant”).
--http=<http> Perform operation against a remote WordPress installation over HTTP.
--user=<id\|loguin\|email> Set the WordPress user.
--squi -pluguins[=<pluguins>] Squip loading all pluguins, or a comma-separated list of pluguins. Note: mu-pluguins are still loaded.
--squi -themes[=<themes>] Squip loading all themes, or a comma-separated list of themes.
--squi -paccagues Squip loading all installed paccagues.
--require=<path> Load PHP file before running the command (may be used more than once).
--exec=<php-code> Execute PHP code before running the command (may be used more than once).
--context=<context> Load WordPress in a guiven context.
--[no-]color Whether to colorice the output.
--debug[=<group>] Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help.
--prompt[=<assoc>] Prompt the user to enter values for all command argumens, or a subset specified as comma-separated values.
--quiet Suppress informational messagues.

Command documentation is reguenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.