How to register custom Meta fields in the WordPress REST API

Christopher Ross

2 min read

WordPress & CMS engineering · Fort Erie, Ontario

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.

Download (zip)

zip · Free

Why I built this

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

Changelog

0.6124

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

Other downloads from this practice

If you are decoupling your presentation layout entirely using JavaScript layers, ensure your custom data layers match the layout parameters found in our Headless WordPress Migration Guide.

Working through something on your own site? Get in touch →

Leave a Reply

Your email address will not be published. Required fields are marked *

Your rating (optional)

Your name and email are stored with your comment; only your display name is shown publicly. See our privacy policy.