Every WordPress site ships with a file called xmlrpc.php. It is an old remote publishing interface that is still switched on by default in 2026, and it is one of the most attacked URLs on any WordPress site. Turning it off is a sensible hardening step, but only once you know nothing you rely on still uses it. This guide shows how to check whether XML-RPC is enabled, how to find out what is using it, and how to block it safely.
What XML-RPC is and why attackers like it
XML-RPC lets outside applications talk to WordPress by sending XML over HTTP POST requests. Before the REST API arrived it was how desktop blogging tools, the WordPress mobile apps and services like Jetpack published posts and managed a site remotely. It also handles pingbacks and trackbacks.
The problems are well known:
- Brute force amplification: the
system.multicallmethod lets an attacker try hundreds of username and password combinations in a single request, which slips past many login limiters that only watchwp-login.php. - Pingback abuse: the pingback feature can be used to make your site send requests to other sites as part of a denial-of-service attack, or to put load on your own server.
- Wasted resources: even failed requests run PHP and hit the database, so a busy bot can slow a small site down.
Most modern tools now use the REST API with application passwords instead, so on many sites XML-RPC does nothing useful at all.
Step 1: check whether XML-RPC is enabled
The quickest test is to open https://yoursite.com/xmlrpc.php in a browser. If you see the message “XML-RPC server accepts POST requests only.”, the file is reachable. A 403 or 404 means something (your host, a security plugin or Cloudflare) is already blocking it.
A browser visit only proves the file answers. To check that the API itself is working, send a real request from a terminal:
curl -s -X POST https://yoursite.com/xmlrpc.php \
-H "Content-Type: text/xml" \
-d '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>'
If you get back a long list of method names such as wp.getPosts and pingback.ping, XML-RPC is fully enabled. Windows 10 and 11 include curl, so this works from Command Prompt too if you put the command on one line.
Step 2: find out what is using it
Check your server access logs
Your logs show every request to xmlrpc.php and who sent it. Download them from your hosting control panel, or on a server you manage run:
grep "xmlrpc.php" /var/log/apache2/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head
Change the path to /var/log/nginx/access.log on Nginx. This lists the IP addresses making the most requests. Look up the top few: lots of different IPs from hosting companies and residential ranges is almost always bots. Requests from Automattic’s ranges are Jetpack, and your own office or home IP may be a desktop publishing tool.
Use a logging plugin
Query Monitor is useful for seeing what runs during a request, and an activity log plugin can record which users authenticate through XML-RPC. If no real user logins ever come through it over a week or two, you can be fairly sure nothing legitimate depends on it.
Search your plugins for XML-RPC code
If you have SSH or file manager access, search the plugins folder for the functions and classes that use XML-RPC:
grep -rlE "xmlrpc|wp_xmlrpc_server|IXR_Client" wp-content/plugins/
Any plugin that turns up is worth checking. Many only mention XML-RPC to disable it, so read the context before you worry.
Know the usual suspects
- Jetpack: still uses XML-RPC to talk to WordPress.com for its connection and several features. If you block the file, allow Jetpack’s published IP ranges or some features will stop working.
- Old desktop or mobile publishing apps: current WordPress and Jetpack mobile apps can connect to self-hosted sites with application passwords over the REST API, but older apps and some third-party tools still use XML-RPC.
- Remote management services and some backup tools on older versions.
- Pingbacks: if you still want them, they need XML-RPC. Most sites are better off without them.
Step 3: block or disable XML-RPC
Test any of these on a staging copy first if you can, and keep a note of what you changed.
Option A: block it at the web server (most effective)
Blocking before PHP runs saves the most resources. On Apache 2.4, add this to the .htaccess file in your WordPress root, above the WordPress section:
<Files xmlrpc.php>
Require all denied
</Files>
Older guides use Order Deny,Allow and Deny from all. That is Apache 2.2 syntax and only works on 2.4 if the compatibility module is loaded, so use the line above. On Nginx, add this inside your server block and reload Nginx:
location = /xmlrpc.php {
deny all;
}
Option B: block it at Cloudflare
If your site is behind Cloudflare, a WAF custom rule that blocks requests where the URI path equals /xmlrpc.php stops the traffic before it reaches your host at all. You can add an exception for Jetpack’s IP ranges in the same rule. Our guides to stopping WordPress spam with Cloudflare and whitelisting IP addresses in Cloudflare walk through the rule builder.
Option C: use a plugin
A plugin such as Disable XML-RPC-API, or the XML-RPC setting in most security plugins, is the easiest choice if you cannot edit server files. Be aware that the common code snippet add_filter( 'xmlrpc_enabled', '__return_false' ); only turns off methods that need a login. Pingbacks and system.multicall requests still reach PHP, so it is weaker than a server or Cloudflare block.
Step 4: test your site afterwards
- Run the curl test again. You should now get a 403 error instead of a list of methods.
- Check Jetpack’s connection status under Jetpack > Dashboard if you use it.
- Try publishing from any app or service you use.
- Watch your logs for a few days for errors.
If something breaks, remove the block, confirm it works again, then add an allow rule for that service’s IP addresses rather than leaving XML-RPC open to everyone.
FAQ
Will disabling XML-RPC break the WordPress block editor?
No. The block editor uses the REST API, not XML-RPC. Do not block /wp-json/ by mistake, as that will break it.
Is XML-RPC removed in newer versions of WordPress?
No. It is still included and enabled by default for backwards compatibility.
Does blocking XML-RPC stop all brute force attacks?
It closes one route. You should still use strong passwords, two-factor authentication and login rate limiting on wp-login.php.
How do I undo it?
Remove the .htaccess or Nginx block, delete the Cloudflare rule, or deactivate the plugin. XML-RPC works again straight away.
Glossary
XML-RPC: a remote procedure call protocol that encodes requests in XML and sends them over HTTP.
REST API: the newer WordPress interface at /wp-json/, used by the block editor and most modern apps.
Application password: a separate password you create under your WordPress user profile for an app to use with the REST API, which you can revoke at any time.
.htaccess: a configuration file read by Apache web servers that can control access to files and folders.
Gear We Recommend
A few general tech accessories worth having alongside this.
Browse our General Tech Accessories picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.