Langsung ke isi

FirKaizen DS

  • Home
  • VPS & Hosting
  • Control Panels
  • WordPress
  • Backups & Migration

How to Disable XML-RPC and Protect wp-login Against Brute Force

Oktober 27, 2026 oleh Firdaus Safari Putra

WordPress gets hammered by login guessing every day, and two doors take most of the hits: wp-login.php and the XML-RPC interface. Bots try thousands of username and password pairs against both, often in a single request that tests many passwords at once. The good news is that both doors can be locked down in an afternoon. This guide shows how to stop wp-login brute force attacks with XML-RPC controls, login limits, and server-level blocking on your VPS.

Start with the server layer. Our fail2ban setup guide for SSH brute-force attacks shows how automatic IP bans work, and the same idea applies to WordPress logins below.

Why Attackers Love XML-RPC

XML-RPC is an old WordPress interface that lets outside apps publish posts and manage a site remotely. The xmlrpc.php file accepts a system.multicall request that can test hundreds of password guesses in one HTTP call, which makes brute-force attacks far more efficient than guessing through the normal login form.

Most sites no longer need XML-RPC. The Jetpack plugin and the WordPress mobile apps once relied on it, but the modern REST API has taken over that job for most uses. If you do not run Jetpack or an old app that depends on XML-RPC, disabling it costs you nothing and removes a heavily abused entry point.

Even sites that keep XML-RPC for a specific tool should restrict it. Blocking the file at the server level for all but trusted IP addresses keeps the tool working for you while bots get nothing.

How to Disable XML-RPC on Your VPS

The cleanest way to disable XML-RPC is at the web server, before WordPress ever loads. In Nginx, add a location block that returns 403 for xmlrpc.php. In Apache, a matching rule in .htaccess does the same. Server-level blocking is better than a plugin because the request never reaches PHP, so it costs almost no resources.

If you use a plugin for this, pick one that disables XML-RPC entirely rather than one that only hides the login form. Test after the change by requesting yoursite.com/xmlrpc.php in a browser: you should get a forbidden response, not a WordPress page. Then confirm that nothing you rely on breaks, such as a publishing app or a Jetpack connection, before you call the job done.

For a middle ground, some security plugins let you disable only the multicall method while leaving basic XML-RPC working. That keeps compatible tools running while killing the bulk-password-guessing trick. It is a fair compromise if you need the interface for one specific integration.

Stop wp-login Brute Force Attacks at the Login Form

With XML-RPC closed, attackers fall back to the normal login form, so that form needs its own defenses. Limiting login attempts locks an account or an IP address after a few failures, which turns a thousand-guess attack into a handful of tries. Most security plugins include this feature, and it takes minutes to enable.

Two-factor authentication is the stronger layer. Even if a password leaks or gets guessed, the attacker still needs the time-based code from your authenticator app. Enable it for every admin account, and store the recovery codes off the server. Our guide to disabling password login for SSH follows the same principle at the server level: remove the password-only path wherever you can.

Change the default admin username if it still exists. Bots guess “admin” first, so a less obvious username forces them to guess both halves of the login pair. Together, attempt limits and two-factor login give you wp-login protection that holds up against bulk guessing.

Block Repeat Attackers With Fail2ban and a Firewall

Application-level limits help, but server-level blocking stops repeat attackers earlier. Fail2ban can watch the WordPress access log or a security plugin’s log and ban IP addresses that rack up failed logins. The ban happens at the firewall, so later requests never reach WordPress at all.

Your server firewall plays the same role for ports and services. Our UFW firewall setup guide for Ubuntu 24.04 covers closing everything except the ports you use, which shrinks the surface bots can probe. A WordPress login defense is much stronger when the server behind it is already quiet.

One caution with fail2ban: set the ban thresholds carefully. Too aggressive, and a legitimate user who mistypes a password a few times gets locked out. Start with a modest limit, watch the logs for a week, and tighten only if the volume of attacks justifies it.

Extra Hardening for the Login Page

Changing the login URL is a debated trick, and it is worth understanding honestly. It does not make a site secure on its own, since attackers can still find the new URL, but it does cut the noise from bots that only try the default wp-login.php path. Treat it as a noise filter, not a security control, and never rely on it alone.

Password rules matter more. Require long passwords for admin and editor accounts, and never reuse a password from another service. A password manager makes long, unique passwords painless, and it removes the temptation to pick something short and memorable.

Consider restricting wp-admin access by IP address if you log in from a fixed location. An Nginx allow rule for your IP, with everything else denied, turns the login page into a door that only opens for you. If your IP changes often, skip this step rather than locking yourself out on a regular basis.

Check That Your Defenses Actually Work

Defenses you never test are guesses. After setting up XML-RPC blocking, login limits, and fail2ban, verify each one:

  • Request xmlrpc.php and confirm you get a forbidden response.
  • Deliberately fail logins from a test IP and confirm the lockout triggers.
  • Check the fail2ban status and confirm banned IPs appear in the firewall.
  • Confirm two-factor login works for every admin account, including yours.
  • Review the access log a day later and confirm bot login attempts dropped.

If any check fails, fix it before moving on. A login limit that never triggers, often because of a caching layer serving the login page, gives false comfort while bots keep guessing.

When the Attack Is Already Underway

If you find thousands of failed logins already in progress, act in this order. First, confirm no account has been breached by checking admin users and recent posts for anything you did not create. Second, turn on or tighten login limits and fail2ban bans. Third, change admin passwords and force a logout of all sessions if your security plugin supports it.

Changing the SSH port can also reduce noise, as explained in our guide to changing the default SSH port safely. It does not stop WordPress login attacks, but a quieter server log makes the WordPress attack pattern easier to spot and respond to.

Brute force protection is not a one-time setup. Bots change tactics, plugins change behavior, and a server update can reset a rule. Re-check the login defenses every few months, and treat a sudden spike in failed logins as a prompt to review the whole login chain again.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.

Kategori WordPress Tag Brute Force, Login, Security, VPS, WordPress
Wordfence vs Sucuri vs MalCare: WordPress Security Plugin Comparison for 2026
How to Secure wp-config.php and Set Correct File Permissions on WordPress

Recent Posts

  • How to Set Up a Mail Server on a VPS for Transactional Email
  • How to Set Up Uptime Monitoring for a VPS with a Free Tool
  • How to Tune Nginx Worker Processes for a Busy WordPress Site
  • How to Fix WordPress Upload Limits on a VPS (php.ini and Nginx)
  • How to Install and Configure Fail2Ban on Ubuntu Server
  • About FirKaizen
  • Contact
  • Privacy Policy
  • Terms of Service
  • Disclaimer
© 2026 PT FirKaizen Digital Solutions — Firdaus Safari Putra