Web Development & WordPress

Receive WordPress post comments to whatsapp:n8n automation

So I tried to create a small automation where I get WordPress post comments directly in my WhatsApp messages whenever anyone comments on any of my WordPress blog posts.

receive wordpress post comments to whatsapp message n8n automation

I used a Webhook and an HTTP Request node. As I understood it, the Webhook is a listener/receiver that receives data. When a comment is made on my WordPress site, the comment is sent to the Webhook using this code:

wp_remote_post('https://n8n.everythingregarding.com/webhook/wp-comment', ...)

The Webhook receives it in JSON format like this:

json

{
"author": "John",
"content": "Nice post!",
"post": "Hello World"
}

The HTTP Request node is essentially an API caller — it gets data from the Webhook and forwards it to another server. In my case, it instructs Meta to send a WhatsApp message using:

So in summary, the Webhook is the data receiver and the HTTP Request is the data forwarder.

Issue I faced: The access token expired after some time, which caused the automation to stop working.

However, I’m happy that it worked — messages were coming through successfully until the access token expired!


Leave a comment