Using Apache Web Server For blocking xmlrpc, adding this code into .htaccess file

<Files xmlrpc.php>
order allow,deny
deny from all

But while adding this The domain being Unreachable. What should do...

1 Answer 1


Check the 'order' order. I do it this way:

# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
# allow from xx.xx.xx.xx   #add allowed IP addresses

And, to ensure it's blocked, I add this to the functions.php file.

add_filter('xmlrpc_enabled', '__return_false');

Actually, I put the above command and others into a private plugin, so I don't have to worry about Child Themes, or theme changes.

(Side note: I had a WP site compromised via an xmlrpc attack.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.