Wp Playground

Use for WordPress Playground workflows: fast disposable WP instances in the browser or locally via @wp-playground/cli (server, run-blueprint,

What Is This?

Overview

WordPress Playground is a tool that runs a full WordPress instance entirely in the browser or locally through a command-line interface, without requiring a traditional server stack. It uses WebAssembly to execute PHP and SQLite as the database backend, making it possible to launch a working WordPress environment in seconds. The result is a fast, disposable instance that can be configured, tested, and discarded without affecting any production system.

The tool is available in two primary forms. The browser-based version runs at playground.wordpress.net and requires no installation. The local version uses the @wp-playground/cli package, which provides commands for starting a server, running blueprints, and building snapshots. Both approaches support the same core feature set, including version switching, plugin and theme mounting, and Xdebug integration for debugging.

Blueprints are a central concept in WordPress Playground. A blueprint is a JSON configuration file that describes the desired state of a WordPress instance, including which plugins to install, which PHP version to use, and which steps to run on startup. This makes it straightforward to share reproducible environments with teammates or embed them in documentation.

Who Should Use This

  • Plugin and theme developers who need isolated environments for testing code changes without touching a live site
  • WordPress contributors who want to reproduce reported bugs in a clean, version-specific environment
  • Technical writers and educators who need to demonstrate WordPress features without setting up infrastructure
  • QA engineers who run automated or manual tests against specific WordPress and PHP version combinations
  • Agency developers who prototype client sites or evaluate third-party plugins before committing to a full installation
  • DevOps engineers who integrate WordPress environment setup into CI pipelines using the CLI

Why Use WordPress Playground?

Problems It Solves

  • Setting up a local WordPress environment traditionally requires installing a web server, PHP, MySQL, and WordPress itself, which takes significant time and introduces configuration complexity
  • Testing a plugin against multiple PHP or WordPress versions requires maintaining several separate environments or using heavyweight virtualization tools
  • Sharing a reproducible WordPress environment with a colleague usually involves exporting databases and file archives, which is error-prone and slow
  • Debugging PHP code in WordPress often requires configuring Xdebug manually, which is a multi-step process on traditional stacks

Core Highlights

  • Runs WordPress entirely in WebAssembly with no server-side PHP or MySQL required
  • Supports WordPress 6.9 and above with PHP versions starting at 7.2.24
  • CLI tool installs via npm and requires Node.js 20.18 or higher
  • Blueprint JSON files define environment state declaratively and are fully shareable
  • Auto-mounts local plugin and theme directories into the running instance
  • Supports switching WordPress and PHP versions without reinstalling anything
  • Xdebug is available for step-through debugging in supported editors
  • Instances are disposable by default, making cleanup effortless

How to Use WordPress Playground?

Basic Usage

Install the CLI globally using npm:

npm install -g @wp-playground/cli

Start a local WordPress server with default settings:

wp-playground server

Run a blueprint file to configure the instance on startup:

wp-playground run-blueprint --blueprint=my-blueprint.json

Build a reusable snapshot from a configured environment:

wp-playground build-snapshot --blueprint=my-blueprint.json --output=snapshot.zip

Specific Scenarios

Mounting a local plugin for development: Pass the --mount flag to map a local directory into the WordPress plugins folder. This allows live editing without copying files manually.

wp-playground server --mount=./my-plugin:/wordpress/wp-content/plugins/my-plugin

Switching PHP and WordPress versions: Specify versions directly in the blueprint JSON file.

{
  "phpVersion": "8.2",
  "wordPressVersion": "6.5"
}

Real-World Examples

A plugin author uses a blueprint to install their plugin, activate it, and run a specific admin page on launch, then shares the blueprint URL so reviewers can inspect the behavior without any local setup. A QA engineer runs the same blueprint against PHP 7.4, 8.1, and 8.2 in sequence to confirm compatibility across versions. A support team member reproduces a user-reported bug by spinning up the exact WordPress and PHP version combination the user described.

When to Use WordPress Playground?

Use Cases

  • Rapid prototyping of plugin or theme features before committing to a full development environment
  • Reproducing and verifying bug reports in isolated, version-specific instances
  • Demonstrating WordPress functionality in documentation or tutorials
  • Running compatibility tests across multiple PHP and WordPress version combinations
  • Evaluating third-party plugins without installing them on a real site
  • Onboarding new developers with a zero-configuration environment defined by a blueprint
  • Building pre-configured snapshots for distribution or automated testing