easythemestore

How to Disable XML-RPC in WordPress

How to Disable XML-RPC in WordPress (Security & Performance Guide)

XML-RPC is an outdated protocol in WordPress that enables remote connections for apps and trackbacks. However, it’s a major security risk—hackers exploit it for brute force attacks, DDoS amplification, and unauthorized access.

Here’s how to disable XML-RPC in WordPress using multiple methods (plugins, code, and server-level blocking).


Why Disable XML-RPC?

🚨 Security Risks:
✔ Targeted in brute force attacks (even with strong passwords)
✔ Used for DDoS attacks (pingback abuse)
✔ Exploited for unauthorized access (via system.multicall)

⚡ Performance Benefits:
✔ Reduces unnecessary HTTP requests
✔ Lowers server load from malicious traffic


Method 1: Disable XML-RPC via Plugin (Easiest)

Option A: Disable XML-RPC (Dedicated Plugin)

  1. Install Disable XML-RPC
  2. Activate – No configuration needed

Option B: Use Security Plugins (All-in-One Solution)

  • Wordfence → Firewall rules block XML-RPC abuse
  • iThemes Security → Toggle “Disable XML-RPC” in settings

✅ Best for: Beginners who want a one-click solution. Our YouTube channel; https://www.youtube.com/@easythemestore


Method 2: Disable via Code (No Plugin Needed)

Option A: Add to functions.php

// Disable XML-RPC completely
add_filter('xmlrpc_enabled', '__return_false');

Option B: Block via .htaccess (Apache)

Add this to your .htaccess file:

# Block XML-RPC
<Files xmlrpc.php>
    Order Deny,Allow
    Deny from all
</Files>

Option C: Block via nginx.conf (Nginx)

Add this to your server block:

location = /xmlrpc.php {
    deny all;
    return 403;
}

✅ Best for: Developers & performance-focused users


Method 3: Restrict Instead of Disable (For Legacy Apps)

If you need XML-RPC for Jetpack or mobile apps, restrict access:

Option A: Allow Only Jetpack

// Allow only Jetpack IPs
add_filter('xmlrpc_enabled', function($enabled) {
    return (strpos($_SERVER['REMOTE_ADDR'], '192.0.64.') === 0) ? true : false;
});

Option B: Whitelist Specific IPs

# .htaccess whitelist
<Files xmlrpc.php>
    Order Allow,Deny
    Allow from 123.123.123.123
    Deny from all
</Files>

✅ Best for: Sites using Jetpack, WordPress Mobile App, or WooCommerce APIs


How to Test if XML-RPC is Disabled?

  1. Visit: yoursite.com/xmlrpc.php

    • Should show 403 Forbidden

  2. Use cURL:

    curl -X POST -d "<?xml version='1.0'?><methodCall><methodName>system.listMethods</methodName></methodCall>" https://yoursite.com/xmlrpc.php
    • Should return “403 Forbidden”


7 SEO Key Phrases for XML-RPC Security

  1. Disable XML-RPC WordPress

  2. Block XML-RPC attacks

  3. WordPress security hardening

  4. Stop brute force attacks

  5. Prevent DDoS WordPress

  6. Disable pingbacks WordPress

  7. Secure XML-RPC


Final Recommendation

  • For most users: Disable XML-RPC completely (Method 1 or 2)
  • For Jetpack users: Restrict access (Method 3)
  • For maximum security: Combine with a firewall (Cloudflare, Wordfence)

🚀 Pro Tip: After disabling, monitor /var/log/nginx/access.log for blocked XML-RPC attempts.

Need help? Drop your questions below! 👇