WordLand Site ID
Prints a theme-agnostic data element containing a stable global site ID (WP.com API → Jetpack → Null).
by WordLand · github.com/scotthansonde/wordland-site-id · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/scotthansonde/wordland-site-id/archive/refs/heads/main.zipWordLand Site ID is a small WordPress plugin that prints a hidden, theme-agnostic data element with a stable global site ID.
The site ID is used by WordLand to connect WordPress sites to WordLand experiences.
It resolves the ID in this order:
- WordPress.com public REST API, cached for 12 hours.
- Jetpack's connected WordPress.com site ID.
nullwhen no global ID is available.
Output
The plugin prints once on public frontend requests:
<div
id="wordland-siteId"
data-siteId="123"
data-site-id="123"
data-siteId-source="wpcom-api"
data-site-id-source="wpcom-api"
data-blogId="1"
data-blog-id="1"
hidden
></div>
Both camelCase and kebab-case data-* attributes are emitted for compatibility with the original one-off integration and conventional HTML data attributes.
Theme Compatibility
Automatic output requires the active theme to call wp_footer() or wp_body_open(). Most WordPress themes do; themes that omit both hooks will not receive the hidden data element automatically.
Local Development
This repository includes a .wp-env.json file for local development with @wordpress/env.
Requires Node.js 20.10.0 or newer.
npm install
npm run env:start
Then open the local WordPress site provided by wp-env and activate WordLand Site ID.
Release Checklist
- Update the plugin header version in
wordland-site-id.php. - Update
package.jsonandpackage-lock.json, for example withnpm version <version> --no-git-tag-version. - Run
npm run lint:php. - Test the plugin in
wp-env. - Tag the release in GitHub.
License
GPL-2.0-or-later