Question
How to disable xmlrpc.php via .htaccess
Answer
Often, malicious traffic is created by rapidly accessing an xmlrpc.php file, creating a high server load, or causing the server to reach its limits. Configuring an .htaccess file to disable XMLRPC access in a cPanel account can provide better security.
- Log in to the affected cPanel account.
- Go to Home / Files / File Manager.
- Access the
public_htmldirectory or your website's document root. - Create a new file named
.htaccessor edit the existing file. Paste the following code into the file:
Note: that to allow XML-RPC from a particular IP, you would replace 203.0.113.2 with that IP address.
CONFIG_TEXT: # Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
Require ip 203.0.113.2
Require all denied
</Files>- Save and close the file.
Comments
0 comments
Article is closed for comments.