Security · Guide
How to Disable XML-RPC in WordPress (And When Not To)
Short answer
Disable XML-RPC with the Disable XML-RPC plugin, the xmlrpc_enabled filter, or a server rule that blocks xmlrpc.php, and pick the method that matches your access level. The plugin is the easiest option, while a server block stops requests before WordPress loads. Keep XML-RPC on if you use Jetpack, the WordPress mobile app, or a remote publishing tool that needs it.
Key takeaways
- XML-RPC has been enabled by default since WordPress 3.5, with no built-in switch to turn it off.
- The xmlrpc_enabled filter only stops methods that need a login, not pingbacks.
- Jetpack needs XML-RPC to connect your site to WordPress.com, so blocking it breaks Jetpack.
- A server block on xmlrpc.php stops attacks before WordPress loads any code.
- A working xmlrpc.php page returns the text XML-RPC server accepts POST requests only.
What is XML-RPC in WordPress?
XML-RPC is a protocol that lets remote apps talk to your WordPress site, so they can publish posts and manage content without opening wp-admin.
It works through the xmlrpc.php file in your WordPress root. Early mobile apps, desktop blogging clients, and remote publishing services used it to connect to sites. WordPress core has had XML-RPC support since version 3.4 (Jetpack and XML-RPC).
The protocol is old but still active. XML-RPC has been enabled by default since WordPress 3.5, and the option to disable it was removed (Disable XML-RPC).
Most sites no longer need it. The WordPress REST API has superseded XML-RPC, and it does a better job of opening WordPress to other apps (Kinsta).
Why is XML-RPC a security risk?
XML-RPC is a risk because one request can test many passwords, and pingbacks can turn your site into a tool for attacks on others.
Attackers use xmlrpc.php for password guessing, since the file accepts login attempts from remote clients. The file also handles pingbacks, which attackers abuse to scan other sites or flood them with requests. Sucuri explains that XML-RPC lets remote applications send commands to your site using XML and HTTP (Sucuri).
Blocking the file is a common host response. Some hosting providers block xmlrpc.php when they detect an attack, which produces a 403 error and stops the attack (Kinsta).
Should you disable XML-RPC?
Disable XML-RPC if nothing on your site uses it, since an unused open door only helps attackers.
Most blogs and business sites can disable it safely. If you publish only through wp-admin and the block editor, nothing on your site calls xmlrpc.php. Disabling it then removes an attack route with no downside.
Keep it on if a tool you rely on needs it. Jetpack, some remote publishing tools, and older mobile apps connect through XML-RPC. Check the list in the “when to keep it” section below before you block it.
Disabling XML-RPC is one layer of hardening, not a full fix. Read our guide to the most common WordPress vulnerabilities to see what else to lock down.
How do you disable XML-RPC with a plugin?
Install the Disable XML-RPC plugin, activate it, and XML-RPC is off with no settings to change.
- Go to “Plugins > Add New”, search for “Disable XML-RPC”, then install and activate it.
- There is no settings screen: the plugin is off when activated and on when deactivated.
- Check that it worked using the test in the “how to check” section below.
| Method | Where it blocks | Skill needed | Best for |
|---|---|---|---|
| Disable XML-RPC plugin | Inside WordPress | Beginner | Quick disable on any host |
| Code filter | Inside WordPress | Developer | Sites that avoid extra plugins |
| .htaccess block | Server, before WordPress | Intermediate | Apache hosts under attack |
| Nginx block | Server, before WordPress | Intermediate | Nginx hosts under attack |
| Security plugin or WAF | Edge or inside WordPress | Beginner | Sites that already use one |
The plugin uses the built-in WordPress filter xmlrpc_enabled to disable the XML-RPC API on a site running WordPress 3.5 or above (Disable XML-RPC). It holds a 4.1 out of 5 rating from 34 reviews, and its page was updated on 27 May 2026 (Disable XML-RPC).
A security plugin can do the same job. Wordfence, Solid Security, and similar plugins include XML-RPC controls, so use the one you already run instead of adding a single-purpose plugin.
How do you disable XML-RPC with a code filter?
Add one line to a small custom plugin to return false from the xmlrpc_enabled filter.
add_filter( 'xmlrpc_enabled', '__return_false' );
Put the line in a custom plugin, not in your theme's functions.php file. A theme change would wipe it out, while a small plugin survives theme updates. Kinsta and Sucuri both give the same advice (Kinsta).
Know what the filter does not do. The filter only controls methods that need a login, such as publishing, and it does not stop pingbacks or other methods that need no login (xmlrpc_enabled).
For full control over all XML-RPC methods, WordPress points developers to the xmlrpc_methods and xmlrpc_element_limit hooks (xmlrpc_enabled). Most site owners do not need that level of control.
How do you block xmlrpc.php in .htaccess or Nginx?
Block xmlrpc.php at the server level to stop requests before WordPress runs any code.
A server block is the strongest method. Blocking at the server level stops requests before WordPress runs any code, so attacks cost you almost no resources (Sucuri).
For Apache, add a Files rule for xmlrpc.php with the “Require all denied” directive, and place it before the standard WordPress rewrite rules. That blocks every request to the file at the server level.
On Nginx, add a location block to your server block, then test the config and reload Nginx. Sucuri gives this block for Nginx (Sucuri):
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
Back up your server config first. Sucuri warns that even a small mistake in these files can take your site down (Sucuri).
Ask your host if you cannot edit server files. Some hosts block xmlrpc.php for you, and Kinsta already blocks it on its platform (Kinsta).
For edge blocking, see our Cloudflare WAF rules for WordPress.
When should you keep XML-RPC turned on?
Keep XML-RPC on if you use Jetpack, the WordPress mobile app, or a remote tool that publishes through it.
Jetpack uses XML-RPC to connect your site to WordPress.com. Most of its features rely on that connection, including stats and brute-force protection, and blocking the file breaks the connection (Jetpack and XML-RPC).
Jetpack's use of XML-RPC is safer than a plain login. It uses a token-based system, similar to OAuth, instead of sending a username and password (Jetpack and XML-RPC).
Check your tools before you decide. If you use the WordPress mobile app to publish, or a desktop client, test it after you disable XML-RPC. If it stops working, turn XML-RPC back on and protect it with rate limiting instead.
If Jetpack stops connecting, follow our Jetpack connection error fix before you undo the change.
How do you check that XML-RPC is off?
Open yoursite.com/xmlrpc.php in a browser, or send a test request with curl, and look for the disabled message.
- Visit https://yoursite.com/xmlrpc.php in a browser. A working file returns the text “XML-RPC server accepts POST requests only.” (Fix Jetpack Issues).
- Send a test request with curl. If the reply contains “XML-RPC services are disabled on this site”, the plugin is working.
- Try the XML-RPC validation service at xmlrpc.blog. You want the validator to fail and tell you XML-RPC is disabled.
The curl check comes from the plugin's own FAQ. If the response contains “XML-RPC services are disabled on this site”, the plugin is working properly (Disable XML-RPC).
A 403 error also means the file is blocked. If your host blocks xmlrpc.php at the server level, a browser visit returns 403 instead of the disabled message. Either result means attackers cannot use the file.
What should you do after you disable XML-RPC?
Test the tools you rely on, then watch the logs for a week to confirm nothing broke.
Start with Jetpack, if you use it. Open your Jetpack dashboard and check that the connection still works and that stats are updating. If Jetpack shows a connection error, XML-RPC may be the cause, so check the file before you change anything else.
Next, test any remote publishing tool you use. Open the WordPress mobile app and try to view your posts, and test any desktop client that connects to your site. If a tool fails, it may need XML-RPC, and you should turn it back on for that tool.
Watch your login logs for a few days. Failed login attempts should drop once xmlrpc.php is blocked, since that attack route is closed. If attacks continue at the same rate, they are coming through wp-login.php instead, and you need login limits there.
Finally, check Site Health under Tools > Site Health. WordPress flags connection problems there, so a clean report means the change did not break anything the site needs.
What mistakes should you avoid?
Do not assume the filter blocks everything, and do not block XML-RPC without checking which tools need it.
- Using the xmlrpc_enabled filter and thinking pingbacks are blocked too, when they are not.
- Adding the filter to functions.php, where a theme update can remove it.
- Blocking xmlrpc.php while Jetpack is active, which breaks the WordPress.com connection.
- Editing .htaccess or Nginx config without a backup, which can take the site down.
- Disabling XML-RPC and never checking that the block actually works.
Test after every change. A two-minute check with curl or the validator confirms the block, while a guess leaves the door open.
If the log shows login attacks after you block XML-RPC, check whether the site was already hit. Read how to tell if your WordPress site is hacked and act on what you find.
Frequently asked questions
Will disabling XML-RPC break my WordPress site?
No, for most sites. The block editor, wp-admin, and the REST API do not use XML-RPC, so normal publishing keeps working. It breaks Jetpack, the WordPress mobile app, and some remote publishing tools, so check those first. If something stops working, deactivate the plugin to turn XML-RPC back on.
What is the difference between XML-RPC and the REST API?
XML-RPC is an older protocol that uses XML over HTTP, while the REST API uses JSON and is the modern way for apps to talk to WordPress. The REST API has superseded XML-RPC for most uses. New tools should use the REST API, and XML-RPC remains mainly for Jetpack and older clients.
Can I disable only pingbacks and keep XML-RPC on?
Yes. The xmlrpc_enabled filter does not stop pingbacks, so you need a different control for them. Some security plugins let you disable pingbacks alone, and a WAF rule can block pingback requests while leaving other XML-RPC methods open. Use that option if a tool you need still uses XML-RPC.
Does disabling XML-RPC stop all brute-force attacks?
No. Attackers can still guess passwords at wp-login.php, so you also need login limits and strong passwords. Disabling XML-RPC closes one attack route, not all of them. Pair it with a firewall, rate limiting, and two-factor login for admin accounts.
Why does my host block xmlrpc.php?
Hosts block xmlrpc.php when they see brute-force or pingback attacks hitting it, since one file can absorb a large share of bad traffic. A block produces a 403 error and stops the attack before WordPress loads. If a tool you use needs XML-RPC, ask your host to allow only that tool's requests.
Sources
- Disable XML-RPC WordPress.org
- xmlrpc_enabled – Hook WordPress Developer Resources
- Jetpack and XML-RPC Jetpack
- Fix Jetpack Issues Jetpack
- A Complete Guide on xmlrpc.php in WordPress Kinsta
- What is xmlrpc.php? A Guide to XML-RPC Sucuri
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
