← Back to All Snippets

How to Safely Disable XML-RPC in WordPress

⚡ Target: functions.php 🔒 Tested: WP 6.6+ / PHP 8.2+ 💻 Lang: PHP
PHP (functions.php)
add_filter( "xmlrpc_enabled", "__return_false" );

XML-RPC in WordPress is frequently targeted by brute-force attacks and DDoS amplification vulnerabilities. If you are not using the WordPress mobile app or Jetpack, disabling XML-RPC significantly improves site security and reduces server load.

← Back to All Snippets Explore Dev Tools →