Developer guide

Auto post from WordPress to Blogger

Send each new WordPress post to Blogger when it is published. Add a summary and link back instead of full duplicates.

Steps

  1. Add the snippet to your theme's functions.php or a small plugin
  2. Set your Jhajha API key
  3. Publish a WordPress post — it is sent to Blogger

Example (php)

add_action('publish_post', function ($id) {
  $p = get_post($id);
  wp_remote_post("https://blogjh.lovable.app/api/public/v1/posts", [
    'headers' => ['Authorization' => 'Bearer bpk_live_YOUR_KEY', 'Content-Type' => 'application/json'],
    'body' => json_encode(['title' => $p->post_title,
      'html' => wp_trim_words($p->post_content, 80) . ' <a href="' . get_permalink($id) . '">Read more</a>',
      'is_draft' => false]),
  ]);
});

FAQ

Will this cause duplicate content?

Posting a summary with a link back is safer than copying the full article.

More guides