Blank lines or extra content in your site’s XML-RPC file can cause a problem when trying to connect to Jetpack.
Sometimes, when trying to connect Jetpack to your WordPress.com account, you’ll receive the following error:
Error Details: The Jetpack server could not communicate with your site’s XML-RPC URL. Please check to make sure example.com/xmlrpc.php is working properly. It should show ‘XML‑RPC server accepts POST requests only.’ on a line by itself when viewed in a browser and should not have any blank lines or extra output anywhere.
This usually happens whenever there is a problem with the
wp-config.php file, a plugin, or the theme on your site.
Jetpack uses your site’s XML-RPC file to communicate with WordPress.com. You can access that file by adding
xmlrpc.php to the end of your site URL. When you do so, here is what you should see on your browser, on a line by itself, with no extra content:
XML‑RPC server accepts POST requests only.
If you see whitespace above that message, or extra text, that’s most likely because some plugin, theme, or your site’s
wp-config.php file has extra “whitespace” (new lines, spaces, tabs, …) before the first
<?php in the file.
This problem is another symptom of a more common problem: the “Headers already sent” problem.
To solve this issue, you can try to deactivate all plugins on your site, and see if that gets rid of the extra whitespace. Then, activate your plugins one at a time to determine which one is responsible.
If that doesn’t help, you can rule out a theme conflict by temporarily changing your site’s theme to a default theme (such as Twenty Seventeen) and trying again.
If you continue to experience issues, you’ll need to open your site’s
wp-config.php file in a file editor, and make sure no whitespace was added before the first
<?php in the file.
Once you fix this issue, you’ll be able to use Jetpack or other plugins and apps using the XML-RPC file to communicate with your site.
If that doesn’t help, you can follow the troubleshooting steps listed on this page to find out more about the issue on your site.