Guides › WordPress › Security & hacks

Stop Brute-Force Login Attacks and xmlrpc.php Abuse on WordPress

Your logs show thousands of login attempts or requests to xmlrpc.php. Limit them without breaking legitimate apps.

Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Security and hacking

Bots try common passwords against wp-login.php and xmlrpc.php all day. Strong passwords already make this harmless, but heavy traffic can slow the site.

1Strong passwords and two-factor2Limit login attempts3Handle xmlrpc.php4Use a firewall or CDN5Check for real damageFixed? Test the site. If not, get help.
The steps in order. Work down the list and stop when the problem is solved.

Step 1: Strong passwords and two-factor

Illustration for Step 1: Strong passwords and two-factor

This is the real defence. See our security checklist.

Step 2: Limit login attempts

Illustration for Step 2: Limit login attempts

Use a trusted plugin or your host's firewall that blocks an address after several failed tries.

Step 3: Handle xmlrpc.php

Illustration for Step 3: Handle xmlrpc.php

xmlrpc.php is an old remote-access interface. Some apps and plugins still use it, for example the Jetpack plugin. If you do not need it, block it. On Apache, add this to .htaccess:

<Files xmlrpc.php>
Require all denied
</Files>

If something stops working afterwards, remove the block.

Step 4: Use a firewall or CDN

Illustration for Step 4: Use a firewall or CDN

A web application firewall in front of your site filters most bot traffic before it reaches WordPress. Many hosts include one.

Step 5: Check for real damage

Illustration for Step 5: Check for real damage

Unknown administrators or changed files mean a break-in. See our hacked-site guide.

Free tool for this problem: .htaccess Generator

Related guides

Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.

Last updated 2026-11-21.