New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

XML-RPC

How to disable WordPress XML-RPC

xmlrpc.php powers remote publishing and some integrations but is a common brute-force and DDoS amplification target. This tutorial shows how to disable XML-RPC without breaking services that still depend on it.

Time: 10-20 minutes Level: Beginner

What this problem looks like

XML-RPC lets remote clients call WordPress methods over HTTP POST. Most modern sites do not need it. Attackers use it for password guessing and pingback floods.

Blocking at Apache or nginx is more efficient than PHP plugins because requests never reach WordPress. Test Jetpack and mobile apps after blocking.

Step 1: Decide if you need XML-RPC

Jetpack, some mobile apps, and legacy remote clients use xmlrpc.php. If you use none of these, disable it. WooCommerce REST API does not require XML-RPC.

  • Jetpack: may require XML-RPC unless using modern connection methods.
  • WordPress mobile app: historically used XML-RPC.
  • Standard REST API: uses /wp-json/ instead.

Step 2: Block xmlrpc.php in .htaccess

Add to .htaccess in the site root on Apache:

apache
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
On nginx, ask your host to deny location = /xmlrpc.php { deny all; } in the server block.

Step 3: Disable via filter in a small plugin or functions.php

If you cannot edit server config, add this to a custom plugin or child theme:

php
add_filter( 'xmlrpc_enabled', '__return_false' );

Step 4: Remove pingback methods only

If you must keep XML-RPC for one service but want to stop pingback abuse, disable pingback methods with a filter rather than blocking the entire file.

Step 5: Verify the block

POST to https://example.com/xmlrpc.php should return 403 or 404. Use an online XML-RPC checker or curl. Confirm Jetpack still connects if you rely on it.

bash
curl -I https://example.com/xmlrpc.php

When to stop DIY and hire help

If brute-force traffic continues after disabling XML-RPC, attackers may target wp-login.php directly. BugShield hardens WordPress login surfaces at a confirmed fixed price.

FAQs

Does disabling XML-RPC break the REST API?

No. REST API uses /wp-json/. XML-RPC is a separate legacy endpoint.

Will Wordfence block XML-RPC enough?

Server-level blocks stop traffic before PHP runs. Plugin blocks work but use more server resources under attack.

Can I disable only pingbacks?

Yes. Pingbacks are the most abused method. Full disable is simpler if you do not use remote clients.

Is XML-RPC required for WooCommerce?

No. WooCommerce uses REST API and webhooks. Safe to disable for most shops.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix