Fail2ban jail for WordPress login brute-force protection

securitywordpressfail2banubuntuhosting

Expands basic Fail2ban setup with WordPress-specific filters.

⚠️ Start conservative and monitor false positives.

Example jail

[wordpress-login]
enabled = true
port = http,https
filter = wordpress-login
logpath = /var/log/apache2/access.log
maxretry = 8
findtime = 600
bantime = 3600

Minimal filter example

[Definition]
failregex = <HOST> .* "POST /wp-login\.php.*" (200|302)

Note: Combined vs common log formats differ. Adjust regex as needed.