Wordpress-discourse plugin not conecting to discourse

AI-generated summary

The user chi_noti_info is experiencing connection issues with the WordPress-Discourse plugin, receiving a “You are not connected to Discourse” error and a cURL error 7 indicating a connection refusal to discourse.mysite.com on ports 443 and 80. Despite having a correct API key, the issue arose after changing subdomains for both WordPress and Discourse. jtbayly suggests reinstalling the plugin. chi_noti_info resolves the issue by updating the /etc/hosts file to correctly associate the discourse domain with its actual IP address. The user then asks jtbayly whether webhooks are necessary for Discourse comments to appear on WordPress, to which jtbayly replies that webhooks enable immediate post syncing, and no other polling mechanism is known.

I am getting the: You are not connected to Discourse. message from the connections tab in the wordpress plugin panel. Getting this error when posting new entry to wordpress :

cURL error 7: Failed to connect to discourse.mysite.com port 443: Connection refused

Same error when connecting to non ssl, port 80.

The api key is correcttly copied.

It worked when i initially installed but then had to change subdomains of the wordpress and discourse and now it is not working. What am I missing?

I suggest completely removing (disable and then delete) the wp-discourse plugin. Reinstall, re-enter connection info and see if it works.

Ok fixed it. Since I have 2 ips in my droplet i needed to edit /etc/hosts to associate the domain of my discourse to the real ip associated to the discourse, instead of 127.0.0.1.

What I still don’t understand though is whether It is necessary to enable webhooks in order to make discourse comments appear on wordpress or not.

Webhooks allow Discourse to push new posts to Wordpress immediately. I don’t think there is any other polling mechanism, but maybe I’ve forgotten.