How to Disable XML-RPC in WordPress (Safely)

How to Disable XML-RPC in WordPress (Safely)

If you check your server logs and see thousands of requests to xmlrpc.php, you’re not alone. XML-RPC is an old remote-access feature that still ships with every WordPress site, and bots use it to guess passwords and flood servers. If nothing on your site depends on it, you should disable XML-RPC in WordPress. It takes a few minutes and closes one of the most abused doors on the platform.

In this guide, you’ll learn what XML-RPC is, how to check whether you need it, three ways to disable it and why you should be much more careful with the REST API.

What Is XML-RPC in WordPress?

XML-RPC is a protocol that lets outside applications talk to your WordPress site, for example to publish a post from a desktop app. It lives at yourdomain.com/xmlrpc.php. Before WordPress had its modern REST API, XML-RPC was how mobile apps and remote tools connected.

Today, most of those jobs have moved to the REST API, but XML-RPC remains enabled by default for backward compatibility.

Why XML-RPC Is a Security Risk

  • Brute-force amplification: the system.multicall method lets an attacker test many passwords in a single request, which can slip past simple login attempt counters.
  • Pingback abuse: attackers can use pingbacks to make your server send requests to other sites, turning it into part of a denial-of-service attack.
  • Server load: every request runs PHP. A flood of XML-RPC traffic can slow a site down for real visitors, especially on shared hosting.

Do You Need XML-RPC?

Check this list before disabling anything:

Tool or feature Needs XML-RPC?
Block editor, Customizer, normal admin use No
Contact forms, WooCommerce checkout No
WordPress mobile app (older versions) Sometimes
Some desktop blogging apps Often
Some remote management or backup services Sometimes, check their docs
Pingbacks and trackbacks Yes

If you don’t use any of the tools in the bottom rows, you can safely disable XML-RPC.

How to Disable XML-RPC in WordPress

Method 1: Use a Plugin

XML-RPC & REST Disabler from Simpli Plugin is a free plugin that blocks the legacy XML-RPC endpoint early in the WordPress loading process and gives you control over public REST API access, so bots can’t use these gateways for brute-force attacks or user enumeration.

  1. Download the plugin ZIP from its product page.
  2. Go to Plugins → Add New Plugin → Upload Plugin.
  3. Upload the file, click Install Now, then Activate Plugin.
  4. Enable XML-RPC blocking in the plugin settings.

Method 2: Use a Code Snippet

WordPress includes a filter that turns off XML-RPC methods that require authentication:

add_filter( 'xmlrpc_enabled', '__return_false' );

Add it through a small custom plugin or a child theme. Note that this filter mainly affects authenticated methods. The file still responds to requests, so it reduces risk but doesn’t stop the traffic.

Method 3: Block the File at the Server

Blocking xmlrpc.php before WordPress loads is the most efficient option, because PHP never runs. On Apache, add this to your .htaccess file:

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

On Nginx, add this inside your server block and reload Nginx:

location = /xmlrpc.php {
    deny all;
}

Back up the configuration file first. A typo in .htaccess can take the whole site offline.

Need help hardening several sites, or seeing heavy bot traffic you can’t trace? Simpli Plugin’s team builds custom WordPress security and performance tooling.

Talk to Our Developers →

Should You Disable the REST API Too?

Usually not completely. The REST API powers the block editor, many plugins, WooCommerce features and every headless WordPress site. Turning it off entirely will break things.

A safer approach is to restrict what the public can see:

  • Block user enumeration by restricting the /wp/v2/users endpoint to logged-in users, so bots can’t list your usernames.
  • Restrict unused endpoints rather than the whole API.
  • Test thoroughly after any change: open the block editor, place a test order and check any app that connects to your site.

How to Check That XML-RPC Is Disabled

  1. Visit yourdomain.com/xmlrpc.php in your browser.
  2. If XML-RPC is active, you’ll see “XML-RPC server accepts POST requests only.”
  3. If it’s blocked at the server, you’ll see a 403 Forbidden error.
  4. Watch your access logs for a few days. Requests to xmlrpc.php should now be refused immediately.

Common Problems and How to Fix Them

The Mobile App or a Remote Tool Stopped Working

That tool depended on XML-RPC. Check whether it supports the REST API or application passwords instead, or allow XML-RPC only for that service’s IP addresses at the server.

The Site Shows a 500 Error After Editing .htaccess

Restore your backup of .htaccess. Older Apache versions use different syntax, so ask your host which format to use.

The Block Editor Shows “Updating Failed”

The REST API has been blocked too broadly. Re-enable it for logged-in users and restrict only the endpoints you need to hide.

Frequently Asked Questions

Is it safe to disable XML-RPC in WordPress?

Yes, for most sites. The block editor, WooCommerce and standard plugins don’t need it. Check the table above for the exceptions.

Will disabling XML-RPC affect SEO?

No. Search engines don’t use XML-RPC. You’ll only lose pingbacks, which most sites ignore anyway.

What’s the difference between XML-RPC and the REST API?

Both let outside apps talk to WordPress. XML-RPC is the older protocol; the REST API is the modern one that WordPress itself relies on.

Does a security plugin already do this?

Many security suites include an XML-RPC option. If yours does, use it and avoid running two tools that block the same thing.

Close an Old Door Bots Love

XML-RPC is one of the most abused endpoints on WordPress, and most sites don’t need it. Confirm nothing depends on it, block it with a plugin or at the server, and restrict the REST API carefully rather than switching it off.

Download XML-RPC & REST Disabler for free, and browse the full Simpli Plugin library. If you need a custom hardening setup, our developers can build it.

Request a Custom Plugin →