📦 Resource

Site Kit Portal Pin · Preserve Google Site Kit OAuth Across Environment Clones

Keep Google Site Kit connected through staging-to-production clone workflows with production-only snapshots and safe auto-restore.

Version: 1.0.0

Site Kit Portal Pin keeps Google Site Kit connected when a host clone workflow overwrites production credentials. It snapshots production’s healthy OAuth state and restores it when clone-related auth drift is detected.

Why I Built This

I’ve been working with WordPress for 19 years. A recurring managed-hosting pain point is that staging-to-production clone workflows can break Site Kit after deploys. I built this plugin to keep analytics continuity stable without forcing manual re-authentication after every clone.

Who This Is For

  • WordPress teams using staging-to-production clone workflows.
  • Sites running Google Site Kit where reconnecting after every clone is recurring operational drag.
  • Agencies and in-house teams that need reliable analytics continuity after deploys.

Common Problem This Solves

You run a staging-to-production clone in your hosting portal. A few minutes later, Google Site Kit shows disconnected and dashboards go blank. The clone copied staging’s empty or mismatched credentials over production’s healthy state. This plugin prevents that cycle.

What It Does

  • Takes a daily snapshot of Site Kit auth state on production.
  • Stores the snapshot outside wp-content by default.
  • Detects broken auth and auto-restores from snapshot.
  • Includes manual snapshot/restore controls in Settings > Site Kit Pin.
  • Provides WP-CLI commands for snapshot, restore, and status.

Important Behaviour

  • Safe by design: the plugin only runs on the configured production URL.
  • On non-production environments, it remains passive.
  • Auto-restore skips stale snapshots (older than 30 days by default).

Installation

  1. Upload the plugin folder to wp-content/plugins.
  2. Activate Site Kit Portal Pin.
  3. Go to Settings > Site Kit Pin.
  4. Set your production site URL.
  5. On production, click Take Snapshot Now once to seed the first backup.

WP-CLI Commands

wp sitekit-pin snapshot
wp sitekit-pin restore
wp sitekit-pin status

Security Note

The snapshot file contains OAuth tokens. Keep it outside publicly accessible paths. If your host places the file inside the web root, block direct access to the exact snapshot file path.

Compatibility

  • WordPress 6.0+
  • PHP 7.4+
  • Tested up to WordPress 6.8

Changelog

0.6124

  • Initial public release.
  • Daily snapshots and auto-restore guardrails for Site Kit auth continuity.
  • Settings page and WP-CLI support.