Order allow,deny
Deny from 198.51.100.0
Allow from all
Block a range:
Deny from 198.51.100.0/24
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "AhrefsBot|SemrushBot|MJ12bot|DotBot" [NC]
RewriteRule .* - [F,L]
</IfModule>
<Files wp-login.php>
Order deny,allow
Deny from all
Allow from 203.0.113.10
</Files>
If you use Cloudflare:
IP Source Address equals [bad IP] → Action: Block.Cloudflare blocks at the edge, before requests reach your server.
Check your access logs via SSH:
tail -f ~/logs/yourdomain.com/access.log | grep "POST /wp-login"
Install Wordfence (WordPress) or Fail2Ban (contact support) to automatically block repeated failed logins.