How to block Brute Force attacks in wordpress wp-login.php

WordPress Admin login bruteforce protection, limit by referer

You can protect your WordPress site by only allowing login requests that come directly from your domain name. Simply replace example\.com with your own domain name. Most brute force attacks rely on sending direct POST requests right to your wp-login.php script. So requiring a POST request to have your domain as the referrer can help weed out bots.

RewriteEngine on
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_REFERER} !^http://(.*)?example\.com [NC]
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteRule ^(.*)$ - [F]
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to disable Error Reporting in Wordpress

You need to edit your: wp-config.php file and modify the following here:...

High CPU Usage on wordpress websites

Due to a security issue in earlier versions of WordPress that allowed posting from xmlrpc.php,...

Bots hitting xmlrpc.php and causing a high load

Due to a security issue in earlier versions of WordPress that allowed posting from xmlrpc.php,...