gatsbyjs/gatsby · error

Received preview data from a different remote URL than the o

Error message

Received preview data from a different remote URL than the one specified in plugin options. Preview will not work. Please send preview requests from the WP instance configured in gatsby-config.js.

 Remote URL: ${webhookBody.remoteUrl}
 Plugin options URL: ${url}

What it means

In sourcePreviews, the hostname of the preview payload's remoteUrl is compared against the plugin options url (and WP settings). When they differ, the preview is rejected: a status callback reports RECEIVED_PREVIEW_DATA_FROM_WRONG_URL and this warning is logged. It prevents sourcing data from an unintended WordPress instance, which would silently mix content from another environment.

Source

Thrown at packages/gatsby-source-wordpress/src/steps/preview/index.ts:339

    const { hostname: remoteHostname } = urlUtil.parse(webhookBody.remoteUrl)

    if (settingsHostname !== remoteHostname) {
      const sendPreviewStatus = createPreviewStatusCallback({
        previewData: webhookBody,
        reporter,
      })

      await sendPreviewStatus({
        status: `RECEIVED_PREVIEW_DATA_FROM_WRONG_URL`,
        context: `check that the preview data came from the right URL.`,
        passedNode: {
          modified: webhookBody.modified,
          databaseId: webhookBody.parentDatabaseId,
        },
        graphqlEndpoint: webhookBody.remoteUrl,
      })

      reporter.warn(
        formatLogMessage(
          `Received preview data from a different remote URL than the one specified in plugin options. Preview will not work. Please send preview requests from the WP instance configured in gatsby-config.js.\n\n ${chalk.bold(
            `Remote URL:`
          )} ${webhookBody.remoteUrl}\n ${chalk.bold(
            `Plugin options URL:`
          )} ${url}\n\n`
        )
      )

      return
    }
  }

  const inPreviewDebugMode =
    inPreviewDebugModeOption || process.env.WP_GATSBY_PREVIEW_DEBUG

  if (inPreviewDebugMode) {
    reporter.info(`Sourcing previews for the following webhook:`)

View on GitHub (pinned to e85d62f177)

Solutions

  1. Send preview requests from the WordPress instance whose URL matches pluginOptions.url in gatsby-config.js.
  2. Fix the remoteUrl configured in WPGatsby on the WordPress side.
  3. Check for staging/production mismatch — the preview was likely triggered on a different environment.
  4. Verify hostnames including scheme and subdomain (e.g. www vs non-www) match.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-source-wordpress/src/steps/preview/index.ts:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/9c4fdc9fb03c8b75. Report an issue: GitHub.