XML-RPC is a feature in WordPress that allows remote access to your site, enabling functions like remote publishing and interaction with mobile apps. While useful in some scenarios, XML-RPC can also pose security risks. It has been a common target for attacks, such as brute force login attempts and DDoS attacks. Disabling XML-RPC can help secure your WordPress site by reducing these vulnerabilities.
By default, XML-RPC is enabled in WordPress, but it can be easily disabled if you do not need its functionality. This can be done by either adding custom code to your WordPress configuration files or using a plugin designed to disable XML-RPC. Disabling this feature is recommended if you do not require remote access capabilities or if you want to minimize potential security threats.
This guide provides steps to disable XML-RPC manually by editing your .htaccess or functions.php file. Following these steps will help secure your WordPress site by blocking all XML-RPC requests.
Steps to disable XML-RPC in WordPress:
- Log in to your WordPress dashboard.
Access your WordPress site’s backend by navigating to `yourdomain.com/wp-admin` and entering your credentials.
- Edit your .htaccess file to block XML-RPC requests.
You can find the .htaccess file in the root directory of your WordPress installation.
# Block WordPress xmlrpc.php requests <Files xmlrpc.php> order deny,allow deny from all </Files>
- Alternatively, add code to your functions.php file to disable XML-RPC.
Edit the functions.php file located in your theme's directory.
add_filter('xmlrpc_enabled', '__return_false');
- Save the changes to your .htaccess or functions.php file.
Ensure you have backed up these files before making any changes.
- Test your site to confirm that XML-RPC is disabled.
Try accessing `https://yourdomain.com/xmlrpc.php`. You should receive a 403 Forbidden error or a similar message indicating that the request is blocked.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.