XML-RPC is an old protocol that allows for remote connections (e.g., posting from a mobile app). However, nowadays it is the #1 backdoor that hackers use to perform Brute Force attacks (guessing passwords) and overload servers (DDoS).
If you do not use the WordPress app on your phone or the Jetpack plugin, you should disable it immediately.
Here are 2 ways to disable it on Hostinger:
Method 1: Using .htaccess (Strongest & Recommended)
This method blocks requests right at the server door, saving resources for your website.
- Go to Hostinger hPanel → File Manager.
- Navigate to the
public_htmlfolder. - Open the
.htaccessfile to edit. - Paste the following code at the bottom of the file:
Apache
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
Order Allow,Deny
Deny from all
</Files>
- Result: Anyone trying to access the
xmlrpc.phpfile will get blocked (403 Forbidden error).
Method 2: Using a Plugin (Easiest)
If you are uncomfortable editing code, use a dedicated plugin. It is very lightweight and does exactly one thing.
- Go to WordPress Dashboard → Plugins → Add New.
- Search for: Disable XML-RPC.
- Install and Activate the plugin named “Disable XML-RPC” (by Philip Erb or similar).
- That’s it! The plugin automatically disables the feature.
Note: If you are already using Wordfence, you can go to Login Security → Settings → Check the box Disable XML-RPC authentication.
⚠️ Important Warning
Do NOT disable XML-RPC if:
- You use the WordPress Mobile App (iOS/Android) to write posts.
- You are using the Jetpack plugin.
- You use centralized website management tools (like ManageWP).
If you fall into these categories, do not disable it completely. Instead, rely on blocking strange countries (using the GeoIP method I explained earlier).
Summary of Security Stack
At this point, your website should be very secure with the following layers:
- ✅ Blocked countries.
- ✅ Blocked unwanted countries (GeoIP) for the admin login page.
- ✅ Hidden the login URL (
/wp-adminchanged to a secret name). - ✅ Closed the XML-RPC backdoor.
Next Step: The final and most important layer of defense is Two-Factor Authentication (2FA). Even if a hacker knows your password and finds your login URL, they cannot enter without the code from your phone.