How to Disable XML-RPC in WordPress with .htaccess?

Step::1 To access your WordPress files, login to your cPanel.

Step::2 Under that, you can access ‘File Manager’.

Step::3 Next, in File Manager, your website’s folders should be under the folder named ‘public_html’. Here, you’ll see three main folders – wp-admin, wp-content, and wp-includes.

Step::4 You should see a file named ‘htaccess’ here. If you don’t, you can use the search bar on the top-right of the screen to look for it.

Step::5 Open the .htaccess file by right-clicking and choosing ‘Edit’.

Step::6 To restrict access of XML-RPC, paste the following code to this file:
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx
</Files>

Step::7 In the 5th line ‘allow from xxx.xxx.xxx.xxx’, replace the x’s with your IP address, if you would like to retain XML-RPC from a particular IP. Otherwise, you can simply delete this line.

Step::8 Click on Save Changes tab and close the file. The code disables XML-RPC.

Now that you’ve disabled the XML-RPC function in WordPress, you’ve made your Website one level more secure.

Visit our Blog for more details. You can also watch the video here.
  • How to Disable XML-RPC in WordPress, How do I disable XML RPC in WordPress, How to Disable XML-RPC in WordPress with .htaccess
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Fix WordPress error “There has been a critical error on your website”

Step::1 First of all login to your cPanel and go to File ManagerStep::2 Go inside public_html and...

How to Stay Logged in for a longer period in your WordPress?

Step::1 First of all you must know the theme which is currently activated in your website. So...

How to bulk delete spam comments in your WordPress website?

Step::1 Login to your cPanel and click on File Manager sectionStep::2 Go to public_html and then...

How to Change WordPress logo in wp-admin page?

Step::1 Login to your cPanel and go to File Manager sectionStep::2 Now go to Public_html Step::3...

How to Change WordPress Admin Username?

Step::1 Login to your WordPress dashboardStep::2 Now at the same time login to your WordPress...