CMS adapters

Integration guides: WordPress, any website, Next.js, Strapi

Start with the no-code options. The code below is for teams that want full control.

No-code options

  • WordPress: open Integrations, enter your site address and approve the connection in WordPress. Articles you publish appear on your site with cover image, categories and SEO description.
  • Any other website (static HTML, Webflow, Wix and similar): turn on “Any other website” in Integrations and paste the snippet into your blog page. No server or storage needed.

All adapters follow the same pattern: verify HMAC on article.ready, pull the full post from Tenant API v1, then upsert into your CMS. Drafts are available immediately. You control when to publish.

For developers: webhook and API

  1. Create API key + webhook URL in GrowthDailySeo Integrations
  2. Expose a POST endpoint and verify X-GrowthDaily-Signature
  3. On article.ready, GET /api/v1/sites/{siteId}/posts/{slug}
  4. Upsert contentHtml, seo, and faqJsonLd. Publish on your schedule

See also: Webhooks · API reference

Webhooks only fire for new drafts. Paginate GET /posts once to import existing content, then poll with updatedAfter. Same steps as the API reference backfill section.

Stack-specific adapters

Copy, adapt env vars and table names, deploy.

Easiest path: connect WordPress from Integrations, no code needed. Use the plugin code below only if you want to control the sync yourself.

Environment variables
# wp-config.php or server env
define('GROWTHDAILY_API_BASE', 'https://app.growthdailyseo.com');
define('GROWTHDAILY_API_KEY', 'fig_live_...');
define('GROWTHDAILY_WEBHOOK_SECRET', 'whsec_...');
define('GROWTHDAILY_SITE_ID', 'your-site-uuid');
// Tenant IndexNow — key file lives on YOUR WordPress domain (not GrowthDailySeo)
define('INDEXNOW_KEY', 'your-random-indexnow-key'); // also set in GrowthDailySeo niche_json.seo.indexnowKey
Webhook endpoint
<?php
// wp-content/mu-plugins/growthdaily-webhook.php
add_action('rest_api_init', function () {
  register_rest_route('growthdaily/v1', '/webhook', [
    'methods' => 'POST',
    'callback' => 'growthdaily_handle_webhook',
    'permission_callback' => '__return_true',
  ]);
});

function growthdaily_handle_webhook(WP_REST_Request $request) {
  $raw = $request->get_body();
  $ts = $request->get_header('x-growthdaily-timestamp') ?: $request->get_header('x-figrush-timestamp') ?: '';
  $sig = $request->get_header('x-growthdaily-signature') ?: $request->get_header('x-figrush-signature') ?: '';
  $expected = hash_hmac('sha256', $ts . '.' . $raw, GROWTHDAILY_WEBHOOK_SECRET);
  if (!hash_equals($expected, $sig)) {
    return new WP_Error('invalid_signature', 'Invalid signature', ['status' => 401]);
  }

  $event = json_decode($raw, true);
  if (($event['event'] ?? '') === 'article.ready') {
    growthdaily_sync_post($event['siteId'], $event['slug']);
    wp_remote_post(GROWTHDAILY_API_BASE . '/api/v1/sites/' . $event['siteId'] . '/posts/' . rawurlencode($event['slug']) . '/publish', [
      'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
      'timeout' => 15,
    ]);
  }
  return ['ok' => true];
}
Sync function (fetch + upsert)
function growthdaily_sync_post(string $site_id, string $slug): void {
  $url = GROWTHDAILY_API_BASE . "/api/v1/sites/{$site_id}/posts/{$slug}";
  $response = wp_remote_get($url, [
    'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
    'timeout' => 30,
  ]);
  if (is_wp_error($response)) return;

  $post = json_decode(wp_remote_retrieve_body($response), true);
  if (empty($post['slug'])) return;

  $existing = get_page_by_path($post['slug'], OBJECT, 'post');
  $post_id = wp_insert_post([
    'ID' => $existing ? $existing->ID : 0,
    'post_title' => $post['title'],
    'post_excerpt' => $post['excerpt'] ?? '',
    'post_content' => $post['contentHtml'],
    'post_status' => ($post['status'] ?? 'draft') === 'published' ? 'publish' : 'draft',
    'post_name' => $post['slug'],
  ]);

  if (!empty($post['seo']['ogTitle'])) {
    update_post_meta($post_id, '_yoast_wpseo_title', $post['seo']['ogTitle']);
  }
  if (!empty($post['seo']['metaDescription'])) {
    update_post_meta($post_id, '_yoast_wpseo_metadesc', $post['seo']['metaDescription']);
  }
  if (!empty($post['faqJsonLd'])) {
    update_post_meta($post_id, '_growthdaily_faq_jsonld', wp_json_encode($post['faqJsonLd']));
  }
  if (!empty($post['schemaBundle'])) {
    update_post_meta($post_id, '_growthdaily_schema_bundle', wp_json_encode($post['schemaBundle']));
  }
}
Render / backfill
// Point webhook URL in GrowthDailySeo Integrations to:
// https://your-site.com/wp-json/growthdaily/v1/webhook

// Theme template — output Article + Breadcrumb + FAQ JSON-LD
function growthdaily_render_schema_bundle(int $post_id): void {
  $raw = get_post_meta($post_id, '_growthdaily_schema_bundle', true);
  if (!$raw) return;
  $bundle = json_decode($raw, true);
  if (!is_array($bundle)) return;
  foreach (['article', 'breadcrumb', 'faq'] as $key) {
    if (empty($bundle[$key])) continue;
    echo '<script type="application/ld+json">' . wp_json_encode($bundle[$key]) . '</script>';
  }
}
add_action('wp_head', function () {
  if (is_singular('post')) growthdaily_render_schema_bundle(get_the_ID());
});

// Optional: nightly backfill for missed webhooks
add_action('growthdaily_daily_sync', function () {
  $url = GROWTHDAILY_API_BASE . '/api/v1/sites/' . GROWTHDAILY_SITE_ID . '/posts?pageSize=50';
  $response = wp_remote_get($url, [
    'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
  ]);
  $items = json_decode(wp_remote_retrieve_body($response), true)['items'] ?? [];
  foreach ($items as $item) {
    growthdaily_sync_post(GROWTHDAILY_SITE_ID, $item['slug']);
  }
});
  if (!wp_next_scheduled('growthdaily_daily_sync')) {
  wp_schedule_event(time(), 'daily', 'growthdaily_daily_sync');
}
Generated pages and llms.txt
// Fetch a generated page spec (path without leading slash)
function growthdaily_fetch_page($path) {
  $encoded = rawurlencode(ltrim($path, '/'));
  $url = GROWTHDAILY_API_BASE . '/api/v1/sites/' . GROWTHDAILY_SITE_ID . '/pages/' . $encoded;
  $response = wp_remote_get($url, [
    'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
  ]);
  return json_decode(wp_remote_retrieve_body($response), true);
}

// Proxy llms.txt onto your domain
function growthdaily_llms_txt(): string {
  $url = GROWTHDAILY_API_BASE . '/api/v1/sites/' . GROWTHDAILY_SITE_ID . '/llms.txt';
  $response = wp_remote_get($url, [
    'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
    'timeout' => 20,
  ]);
  return is_wp_error($response) ? '' : wp_remote_retrieve_body($response);
}
Sitemap feed
// Dynamic sitemap feed
function growthdaily_fetch_sitemap(): string {
  $url = GROWTHDAILY_API_BASE . '/api/v1/sites/' . GROWTHDAILY_SITE_ID . '/sitemap.xml';
  $response = wp_remote_get($url, [
    'headers' => ['Authorization' => 'Bearer ' . GROWTHDAILY_API_KEY],
    'timeout' => 30,
  ]);
  return is_wp_error($response) ? '' : wp_remote_retrieve_body($response);
}

// Rewrite rule or template_redirect to serve XML at /sitemap-growthdaily.xml
IndexNow ping
// Upload {INDEXNOW_KEY}.txt to WordPress web root (ABSPATH) — content = key string
// e.g. https://www.your-domain.com/a1b2c3.txt contains "a1b2c3"
function growthdaily_indexnow_ping(string $url): void {
  if (!defined('INDEXNOW_KEY')) return;
  wp_remote_post('https://api.indexnow.org/indexnow', [
    'headers' => ['Content-Type' => 'application/json'],
    'body' => wp_json_encode([
      'host' => wp_parse_url(home_url(), PHP_URL_HOST),
      'key' => INDEXNOW_KEY,
      'keyLocation' => home_url('/' . INDEXNOW_KEY . '.txt'),
      'urlList' => [$url],
    ]),
  ]);
}