Trying to connect to Jetpack from a Bedrock install but getting error when connecting to Wordpress.com

I am using a Bedrock install and trying to connect Jetpack to WordPress.com but I’m getting this error:

communicate with your site [HTTP 404]. Ask your web host if they allow
connections from WordPress.com. If you need further assistance, contact Jetpack Support: http://jetpack.me/support/

This is my settings in my .env which are the default settings

WP_ENV=production
WP_HOME=http://example.com
WP_SITEURL=${WP_HOME}/wp

Jetpack uses xmlrpc.php to communicate to the wordpress.com server and it should be in the root directory for it to be able to work. So I tried to transfer the whole contents of the /wp folder to the root url and updated my .env to:

WP_ENV=production
WP_HOME=http://example.com
WP_SITEURL=${WP_HOME}

When I’m visiting http://example.com/xmlrpc.php, it is now giving me the expected return value: " XML-RPC server accepts POST requests only." and I can now connect to wordpress.com via Jetpack without any issues.

What is the proper way to make Jetpack work with the default installation of Bedrock? Can I still take advantage of Bedrock’s feature to put the WP files in a subfolder? :grin:

1 Like

Could try only moving the xmlrpc.php file as detailed here: https://kovshenin.com/2011/wordpress-subdirectory-xml-rpc/

1 Like

I had this a few months ago and I think it’s a false error message on their side. Even with this message, the Jetpack functions I enabled (related posts, social share, stats, and Photon) all work. Take a look in Wordpress.com or Calyspo and you’ll likely see that the Jetpack servers successfully find/connect to /wp/xmlrpc.php.

When I dug into their plugin code a little, I saw that the plugin reports this error because the UI/plugin interchangeablely uses siteurl and homeurl. When I reported it to them (via support channels, not Github), their response was non existent. I’d love to see this fixed in their plugin.

2 Likes

@swalkinshaw for the suggestion, although a clunky solution, this seemed to work. I have to move xmlrpc.php to the root directory and change line 29 from:

include( dirname( __FILE__ ) . '/wp-load.php' );

to point in the wp directory which is defined in your .env, for this example I’m using /wp:

include( dirname( __FILE__ ) . '/wp/wp-load.php' );

@DavidSchargel I agree, maybe we can try submitting a PR to the core or Jetpack repo that fixes this issue later

1 Like

Any new ways of doing this since three years ago?

Update to the latest version of WordPress + JetPack and it now works! Plus it looks like they improved the load speed of JetPack.

In 2020, I’m still having this problem…
I copied the xmlrpc.php file to the web folder and changed line 31:

require_once __DIR__ . '/wp-load.php';

to:

require_once __DIR__ . '/wp/wp-load.php';

Using the debugging tool results in:
Could not validate security token

I think the url might still be connected to another wordpress.com account, which we don’t have access to? The site used to be a multisite (without Bedrock), but I split it up into a single Trellis/Bedrock site.

Any ideas?

Hi, did you find a solution ?

I’m afraid not…
They don’t seem to support Bedrock’s custom WP_CONTENT_DIR or WP_CONTENT_URL folders:

As for me, I am only using Jetpack for the sharing buttons.
It kind of works… until the version 9.5.2, it works using the define( ‘JETPACK_DEV_DEBUG’, true); variable.
Then you can access parts of Jetpack.

It’s not a viable solution though…

1 Like

Have anybody found solution? I need to connect to Jetpack to enable Auto Tax calculation on Woocommerce.

I went through this pretty thoroughly a few months ago and didn’t find a solution. It’s Jetpack’s problem in my opinion. They don’t support all the ways WordPress allows a WordPress install to be set up.

1 Like

Just touching base about this. It’s still a problem. Still looking for answers.

What specifically is a problem?

I just provisioned a brand new DO server with Trellis, deployed a brand new Bedrock site with Jetpack, and activated the plugin without any issues

1 Like

It could have something to do with recent Trellis disabling XML-RPC by default:

https://github.com/roots/trellis/pull/435

I’m going to say that even though it appears I have xmlrpc enabled, it probably isn’t and that it’s my server config. Thanks for checking this out, I’ll deal with it on my end :slight_smile: