How to Disable XML-RPC in WordPress: Complete Security Guide (2025)

XML-RPC is a remote communication protocol that allows third-party applications to interact with your WordPress site. It was introduced in WordPress 1.5 (2005) and enabled by default since version 3.5 (2012).

The xmlrpc.php file in your WordPress root directory handles these remote communications.

[Screenshot: WordPress root directory showing xmlrpc.php file]

  • WordPress mobile apps (iOS/Android)
  • Pingbacks and trackbacks
  • Third-party publishing tools
  • Automation services (IFTTT, Zapier)

XML-RPC only exists for backward compatibility with older plugins and services.

  • Login attempt limits
  • CAPTCHA protection
  • Two-factor authentication
  • Security plugin restrictions

[Screenshot: XML-RPC brute force attack in security logs]

Hackers exploit the pingback feature to launch Distributed Denial of Service attacks:

  • Send thousands of pingback requests
  • Overwhelm server resources
  • Crash your website
  • Use your site to attack others

[Screenshot: Server resources during XML-RPC DDoS attack]

XML-RPC circumvents standard security protections:

  • Firewall rules
  • Login page security
  • Rate limiting
  • IP blocking

XML-RPC can expose your real server IP, even behind Cloudflare or other WAFs, allowing direct attacks.

  • 24% of WordPress attacks involve XML-RPC
  • Sites with XML-RPC enabled are 3x more vulnerable
  • DDoS attacks can generate 50,000+ requests/hour
  1. Visit: WordPress Security Scanner
  2. Enter: https://yourdomain.com/
  3. Click “Analyze”
  • Success message = Enabled (High)
  • Error message = Disabled (you’re safe)

Visit: https://yourdomain.com/xmlrpc.php

[Screenshot: FTP connection to WordPress site]

[Screenshot: .htaccess file location]

# Block WordPress XML-RPC requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>

[Screenshot: .htaccess with code added]

# Block XML-RPC except specific IPs
<Files xmlrpc.php>
order deny,allow
deny from all
allow from 103.45.67.89
allow from 98.76.54.32
</Files>

Add to your Nginx config:

location = /xmlrpc.php {
    deny all;
}

[Screenshot: Nginx configuration]

[Screenshot: Installing WPCode plugin]

[Screenshot: WPCode library with XML-RPC snippet]

[Screenshot: Activating WPCode snippet]

Done! WPCode adds this code automatically:

add_filter( 'xmlrpc_enabled', '__return_false' );

For complete protection, add this custom snippet:

// Disable XML-RPC completely
add_filter( 'xmlrpc_enabled', '__return_false' );
// Remove XML-RPC headers
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
// Disable pingback methods
add_filter( 'xmlrpc_methods', function( $methods ) {
   unset( $methods['pingback.ping'] );
   unset( $methods['pingback.extensions.getPingbacks'] );
   return $methods;
});
// Remove X-Pingback header
add_filter( 'wp_headers', function( $headers ) {
   unset( $headers['X-Pingback'] );
   return $headers;
});

[Screenshot: Custom WPCode snippet]

[Screenshot: Disable XML-RPC-API plugin]

To whitelist specific IPs:

[Screenshot: Plugin settings page]

  1. Enter your URL
  2. Should show: “Error / 403 Forbidden”

[Screenshot: Validator showing disabled status]

Visit: https://yourdomain.com/xmlrpc.php

Should show: “403 Forbidden”

[Screenshot: 403 error in browser]

Check in Wordfence or Sucuri:

[Screenshot: Security plugin verification]

Should NOT show: X-Pingback header

[Screenshot: HTTP headers check]

If still enabled:

  1. Clear all caches
  2. Try different method
  3. Check plugin conflicts
  4. Contact hosting support

XML-RPC is outdated and dangerous. With the REST API available, there’s no reason to keep it enabled.

  1. Install security plugin (Wordfence/Sucuri)
  2. Enable two-factor authentication
  3. Use strong passwords
  4. Keep WordPress updated
  5. Install SSL certificate
  6. Set up backups
  7. Use firewall (Cloudflare)

Table of Contents

Leave a Reply

Your email address will not be published. Required fields are marked *