After I set GOTMLS to block XML-RPC, Jetpack lost connection between my site and WordPress. I found the answer on somebody’s blog (I wish I could remember whose!)
You need to put this in your .htaccess
file:
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
Allow from wordpress.com
Allow from 192.0.64.0/18
Satisfy All
</Files>
After this, you can let the plugin block XML-RPC requests, WordPress will still be able to do its thing.
Check your Jetpack connection here: https://jetpack.com/support/debug/
Thanks for posting this helpful code. As a shortcut you could just apply the patch, which would insert the whole Files tag, then you would just need to add the Allow lines for any domains and IPs you want to allow.