How to Protect WordPress from XML-RPC DDoS Attacks

Wordpress Nov 18, 2019 5 min read

Share Article

How to Protect WordPress from XML-RPC DDoS Attacks

What is RPC?

RPC (Remote Procedure Call) is a small extension to start connections call step between different applications or different machines.

What is XML-RPC?

Essentially it allows you, through the XML-RPC protocol to post, edit and publish pages from a desktop application like BlogDesk, MarsEdit and ScribeFire. In other words, its used for remotely publish your content from your desktop. Most users doesn’t need WordPress XML-RPC application, and it’s one of the most popular backdoor causes for attacking.

Whats is DDos attack ?

DDoS (Distributed Denial of Service) is an attempt to make an online website unavailable by crushing it with huge massive traffic from multiple sources.

What is the Best Ways to Protect WordPress from xmlrpc Brute Force Attacks?

There are many ways to block and disable access to xmlrpc as well as pingback and trackbacks, like .httacces and themes function modification or even plugin but i will try to explain it simply by the following 5 steps to prevent any confusing.
  • Disable Pingback Function
  • Remove xmlrpc.php Linkback
  • Disable XML-RPC WordPress Plugin
  • Modify Themes Function
  • Block Access to xmlrpc by .httaccess

#1: How to Disable Pingback in your WordPress Setting?

First and simple step is disable pingbacks in your wordpress which is enabled by default, just open your site dashboard then go to Settings->Discussion and remove this option “Allow link notifications from other blogs (pingbacks and trackbacks)” then save your changes.Disable pingback trackbacks

#2: How to Remove xmlrpc.php linkback from your header?

Open your site dashboard then go to Appearance->Editor->Header.php then Find and remove this line.
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
Remove xmlrpc link from header

#3: What is the Best Plugin to Disable XML-RPC API Service?

Disable XML-RPC plugin it just simply disables XML-RPC API in WordPress, which is enabled by default. All you have to do, is just activate it after installation from Plugins->Add New and type “disable xml rpc pingback” in search box (developed By Philip Erb).Disable XML-RPC plugin

#4: Modify Themes function to block access for XML-RPC

If you don’t like to install additional plugin in your site, just add one of the following code at the end of your themes function file functions.php, keep in mind both codes do the same of the Disable XML-RPC plugin.
add_filter('xmlrpc_enabled', '__return_false');
OR
add_filter( 'xmlrpc_methods', function( $methods ) {
    unset( $methods['pingback.ping'] );
    return $methods;
} );
filter code functions

#5: How to Block Access to xmlrpc by .httaccess Modify?

if you would like to block access to xmlrpc.php file, just add following code at the end of .httaccess file
<IfModule mod_alias.c>
    RedirectMatch 403 /xmlrpc.php
</IfModule>
Alternate way for .httaccess file (its my favorite one)
<Files xmlrpc.php>
    Order Deny,Allow
    Deny from all
</Files>
if you would like to block access for everyone but allowed for your ip, use the following code and replace “11/22/33/44” with your own PC IP.
<Files xmlrpc.php>
    Order Deny,Allow
    Deny from all
    Allow from 11/22/33/44
</Files>

XMLRPC Best Practices

  • Be smart and fight malicious attacks and don’t surrender.
  • You have to learn daily for how to close all backdoors in your site.
  • You have to be sure 100% of fix after each step completed by testing the results manually.
  • Be ware of .httacces modification file because you may block other useful pages by mistake.

Common questions about How to Protect WordPress from XML-RPC DDoS Attacks

What is XML-RPC in WordPress and why is it vulnerable to DDoS attacks?

XML-RPC is a legacy protocol in WordPress that enables remote communication with external applications. It’s vulnerable to DDoS attacks because its pingback feature can be exploited to flood a site with thousands of requests from multiple sources simultaneously, overwhelming the server.

How can I check if XML-RPC is enabled on my WordPress site?

Visit yourdomain.com/xmlrpc.php in a browser. If you see “XML-RPC server accepts POST requests only,” it’s enabled. A 404 error means it’s disabled. Alternatively, use online validation tools or check your security plugin settings.

What’s the easiest way to disable XML-RPC in WordPress?

The simplest method is using a security plugin like Disable XML-RPC, Solid Security, or Shield Security PRO. These provide one-click solutions without requiring technical knowledge.

Can I disable XML-RPC manually without a plugin?

Yes, add this code to your .htaccess file: <Files "xmlrpc.php"> Require all denied </Files> or add add_filter('xmlrpc_enabled', '__return_false'); to your theme’s functions.php file.

Will disabling XML-RPC affect my WordPress mobile app or Jetpack?

Yes, both rely on XML-RPC. Modern versions use REST API, but if you experience issues, you may need to whitelist specific IPs or enable partial functionality through security plugins.

How does XML-RPC enable brute force attacks on WordPress?

Attackers use XML-RPC’s system.multicall method to send hundreds of login attempts in a single request, bypassing standard login limits and security measures like captchas.

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

REST API uses modern OAuth tokens and JSON, while XML-RPC uses basic authentication with XML. REST has better security, rate limiting, and doesn’t expose login credentials with each request.

Can a Web Application Firewall (WAF) protect against XML-RPC attacks?

Yes, premium WAFs like Sucuri or Cloudflare can detect and block XML-RPC abuse patterns. However, completely disabling XML-RPC provides stronger protection.

What are the signs my WordPress site is under XML-RPC DDoS attack?

Look for: sudden traffic spikes from unusual IPs, slow performance, server resource exhaustion, and multiple failed login attempts in logs – especially via xmlrpc.php.

Should I delete xmlrpc.php file completely from my WordPress site?

No, deletion isn’t recommended as WordPress will recreate it during updates. Instead, disable it properly via .htaccess, plugins, or code snippets for permanent protection.

Written by: TopSeoTut Engineering

A dedicated team of senior software engineers and technical SEO experts. Every article is peer-reviewed and field-tested to ensure maximum accuracy and actionable insights for modern enterprise architectures.

10+ Years Experience Technically Verified
WhatsApp