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]
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

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,...

High CPU Usage on wordpress websites

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

How to disable Error Reporting in Wordpress

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

How to post in WordPress using classic editor ?

Posts are entries that display in reverse order on your home page and/or blog page. Posts usually...

How to Increase PHP Memory Limit in WordPress

First you need to edit the wp-config.php file on your WordPress site. It is located in your...