XML-RPC is a remote procedure call protocol used by WordPress to enable communication between different systems. It allows users to post content, manage comments, and perform various other tasks remotely. However, it also makes your WordPress site vulnerable to various security threats, including brute force attacks and DDoS attacks. Therefore, disabling XML-RPC can be a good security measure for your WordPress site. In this article, we will discuss how to disable XML-RPC in WordPress.
There are several ways to disable XML-RPC in WordPress. Here are the two most popular ones:
Disable XML-RPC using a Plugin
The easiest way to disable XML-RPC in WordPress is by using a plugin. There are several plugins available in the WordPress repository that can help you disable XML-RPC. One such plugin is Disable XML-RPC. Here are the steps to disable XML-RPC using this plugin:
Step 1: Install and activate the Disable XML-RPC plugin from the WordPress repository.

Step 2: Go to Settings > Disable XML-RPC in your WordPress dashboard.
Step 3: Click on the Disable XML-RPC button to disable XML-RPC on your WordPress site.
Disable XML-RPC by Editing Functions.php File
If you’re comfortable editing the functions.php file of your WordPress site, you can disable XML-RPC by adding the following code snippet to your functions.php file:
add_filter( ‘xmlrpc_enabled’, ‘__return_false’ );
This code snippet disables XML-RPC on your WordPress site. You can add this code snippet to your functions.php file by following these steps:
Step 1: Log in to your WordPress site via FTP or cPanel.
Step 2: Navigate to wp-content/themes/your-theme-name/functions.php file.
Step 3: Edit the functions.php file and add the above code snippet at the end of the file.
Step 4: Save the file and upload it to your server.
Conclusion
Disabling XML-RPC in WordPress is a good security measure to protect your WordPress site from various security threats. You can disable XML-RPC using a plugin or by editing the functions.php file of your WordPress site. However, if you’re not comfortable editing the functions.php file, it’s always better to use a plugin to disable XML-RPC.
Things To Consider When Disabling XML-RPC In WordPress
Here are some things to consider when disabling XML-RPC in WordPress:
Compatibility: Some plugins and services may rely on XML-RPC for functionality. Before disabling XML-RPC, make sure that none of the plugins or services you use require it. Otherwise, disabling XML-RPC may cause those plugins or services to stop working.
Alternative solutions: If you rely on XML-RPC for remote publishing or other functionality, consider using alternative solutions such as the WordPress REST API. The REST API is more secure and offers more functionality than XML-RPC.
Security: Disabling XML-RPC can improve the security of your WordPress site by eliminating the possibility of brute force attacks and DDoS attacks. However, it’s important to remember that there are other security measures you should take to protect your site, such as using strong passwords, keeping your WordPress site and plugins up to date, and using security plugins.
Performance: Disabling XML-RPC can also improve the performance of your WordPress site by reducing the number of requests made to your server. However, the impact on performance is usually minimal, and most users won’t notice a difference.
By considering these factors, you can make an informed decision about whether to disable XML-RPC in WordPress and choose the best method for your site.