wp-fail2ban / wp-fail2ban-cli
WP-CLI commands for configuring, managing, and monitoring WP fail2ban and its add-ons.
Package info
github.com/wp-fail2ban/wp-fail2ban-cli
Type:wp-cli-package
pkg:composer/wp-fail2ban/wp-fail2ban-cli
Requires
- php: >=7.4
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-02 17:40:28 UTC
README
Manage WP fail2ban from the command line.
WP fail2ban CLI provides WP-CLI commands for configuring, managing, and monitoring WP fail2ban (WPf2b) and its add-ons.
For administrators managing WordPress sites over SSH or through scripts, the CLI provides access to WPf2b without needing to open the WordPress dashboard.
This is the release repository for WP fail2ban CLI. It is a free WP-CLI package, distributed separately from the WordPress plugin.
Features
- Configuration: inspect effective settings and their sources, and change settings using the same configuration model as the plugin UI.
- QuickStart: inspect, enable, and disable QuickStart cards, including those registered by add-ons.
- Diagnostics: inspect plugin status, view recent log messages, and run WP fail2ban's Site Health checks.
- Event history (Premium): query, filter, and export security events.
- Reports (Premium): analyse event history by country, IP address, username, or password.
JSON output and single-field queries make the CLI suitable for scripted administration and monitoring. Site Health checks return a non-zero exit status when a critical result is found.
WP fail2ban CLI manages the WordPress side of the integration. It is not a replacement for fail2ban-client or the host administrator's firewall tools.
Installation
Install WP-CLI and a compatible release of WP fail2ban (6.3 or later on the current release line).
Install WP fail2ban CLI using WP-CLI's package manager:
wp package install wp-fail2ban/wp-fail2ban-cli
The package is available through Packagist. It is a WP-CLI package, not a WordPress plugin: it does not need to be installed or activated through the WordPress dashboard.
Manage package updates through WP-CLI rather than the WordPress plugin updater.
Usage
From a WordPress installation, use WP-CLI's built-in help to discover the available commands:
wp help fail2ban
Inspect the installation, its effective configuration, and available QuickStart cards:
wp fail2ban status --format=json wp fail2ban config list wp fail2ban config get block_user_enumeration --field=source wp fail2ban quickstart list
View recent messages and run Site Health checks:
wp fail2ban message list wp fail2ban check
With Premium (Bronze or higher), query event history and generate reports:
wp fail2ban event list --per-page=50 --format=json wp fail2ban report ip --period=month --format=json
Event and report output may contain sensitive, attacker-controlled data. Treat exports as untrusted evidence.
The available functionality depends on the installed edition and version of WP fail2ban and its add-ons. See the WP-CLI chapter of the WP fail2ban manual for the complete command reference, configuration behaviour, and operational guidance.
Release integrity
Releases have GPG-signed Git tags. The software bill of materials (SBOM) is included in the distribution at assets/bom.json.
To verify a Git tag in a local clone of the repository:
git verify-tag <tag>
Verify the signing key's fingerprint against a trusted source before relying on a signature. Installing the package through WP-CLI does not itself verify the Git tag's signature.
Documentation and support
- WP fail2ban manual — WP-CLI
- Release notes
- Composer package
- WP fail2ban release repository
- WP-CLI documentation
- Website
- Support
This is the release repository for WP fail2ban CLI, rather than the development repository. For support, please use the channels listed on the support page.
For reporting security vulnerabilities, see the security policy.
Licence
WP fail2ban CLI is licensed under the GNU General Public License, version 3 (GPL-3.0-only).