Chapter3.WP-CLI Integration

Chapter3.WP-CLI Integration

Admin Tools Professional includes WP-CLI integration, allowing you to manage certain Admin Tools features from the command line. This feature is only available in the Professional release of Admin Tools for WordPress.

Important

WP-CLI must be installed on your server to use these commands. For more information about WP-CLI, please visit https://wp-cli.org/.

1.Automatic IP Blocking

The admintools autoban command group lets you manage the automatically blocked IP addresses.

1.1.List blocked IPs

Lists all automatically blocked IP addresses.

wp admintools autoban list [--format=<format>] [--ip=<ip>] [--limit=<limit>]

--format=<format>

The output format. Accepted values: table (default), json, csv, yaml, count.

--ip=<ip>

Filter results by IP address. Performs a partial match, so you can use a subnet prefix to find all blocked IPs in a range, e.g. 192.168.

--limit=<limit>

Limit the number of results returned. By default, all results are returned.

Examples

List all automatically blocked IP addresses in a table:

wp admintools autoban list

Get the results as JSON:

wp admintools autoban list --format=json

Filter by IP address:

wp admintools autoban list --ip=192.168

Limit the number of results:

wp admintools autoban list --limit=5

Sample output

+----------------+--------+---------------------+| ip             | reason | until               |+----------------+--------+---------------------+| 203.0.113.42   | other  | 2026-02-10 15:30:00 || 198.51.100.7   | other  | 2026-02-10 14:00:00 |+----------------+--------+---------------------+

1.2.Remove a blocked IP

Removes one or more IP addresses from the auto-ban list.

wp admintools autoban remove <ip>...

<ip>...

One or more IP addresses to remove from the auto-ban list.

Examples

Remove a single IP address:

wp admintools autoban remove 203.0.113.42

Remove multiple IP addresses at once:

wp admintools autoban remove 203.0.113.42 198.51.100.7

Sample output

Success: 1 IP address(es) removed from the auto-ban list.