Skip to content

Rudel

Request-selected WordPress overlay environments for sandboxes.

Terminal
composer require rudel/rudel

Latest releasev0.10.3GPL-2.0-or-laterWordPress 6.4+, PHP 8.2+

In practice

Create a sandbox from the host site, then point WP-CLI or an HTTP request at it.

Create a sandbox and route into it

wp rudel create clones the host tables under a new prefix, copies the theme into the sandbox directory and prints the sandbox ID.

Pass that ID in RUDEL_ENVIRONMENT for WP-CLI, or in the X-Rudel-Environment header or rudel_environment cookie for HTTP. The PHP API creates the same sandbox with lifecycle metadata.

Terminal
wp rudel create --name=alpha --theme=twentytwentyfour
RUDEL_ENVIRONMENT=alpha-1234 wp option get siteurl
curl -H 'X-Rudel-Environment: alpha-1234' http://localhost:8000/

Sandboxes

Disposable overlay environments for development, testing, and AI agents.

Request Selection

Route a request into a sandbox with an X-Rudel-Environment header, a rudel_environment cookie or RUDEL_ENVIRONMENT in WP-CLI. Selection is by sandbox id alone, without authentication.

Overlay Runtime

Activation adds a bootstrap line to wp-config.php. Each sandbox then gets cloned tables under its own prefix and a copy of the active theme; WordPress core, plugin files and uploads stay shared.

Git Worktrees

Built-in PHP-native Git clone, push, and worktree flows with no host git binary required.

Snapshots

Named recovery points that copy the tables and managed theme files of a sandbox. Create and restore them from WP-CLI or PHP.

Request Isolation

Per-request table prefixes, theme roots, temp directory, object cache key salt and email blocking.

WP-CLI & PHP API

wp rudel commands and Rudel\Rudel static methods create, list, update, snapshot, restore and destroy sandboxes.

Agent Ready

Gives coding agents a disposable WordPress copy, with WP-CLI scoped by RUDEL_ENVIRONMENT and outbound email blocked.

Why Rudel

One install, many sandboxes

Rudel runs inside a normal WordPress installation, without multisite and without a second WordPress install. The host site keeps serving its own data to every request that does not name a sandbox.

Copies the tables and one theme

A sandbox gets a copy of the host tables, users included, under its own prefix and a copy of the active theme, plus its parent for a child theme. WordPress core, plugin files and uploads stay on the host.

Sandboxes that expire

Give a sandbox an owner, labels, a purpose and a TTL in days. An hourly WP-Cron job removes expired sandboxes and skips the ones marked protected.

Safe to preview

Sandbox requests block outbound email and log each blocked message. Unless wp-config.php sets its own, the object cache key salt is derived from the sandbox ID, so persistent caches keep host and sandbox keys apart.

Compared with

Rudel works inside the site you already run. These tools cover neighbouring needs.

Rudel compared with other tools
WordPress MultisiteGood atRuns a network of virtual sites on one set of core files, with shared plugins and themes, and separate database tables and upload directories for each site.Difference with RudelRudel does not need multisite. A sandbox is a copy of the existing site's tables and active theme, selected per request by a header, a cookie or a WP-CLI environment variable.
wp-envGood atSets up a local WordPress site with Docker for building and testing plugins and themes, without additional configuration.Difference with RudelRudel needs no second WordPress install. It creates sandboxes from the content of the site you already run, and their tables live in the same MySQL database as the host. It does not give a sandbox its own PHP runtime or database server.
WordPress PlaygroundGood atRuns WordPress client-side in WebAssembly, with no backend, isolated to the browser and with no persistent side effects outside it.Difference with RudelRudel runs on the server next to a real site and its MySQL database. A sandbox starts from that site's current content and is reachable from WP-CLI and from any HTTP client.

Questions and answers

Short answers from the Rudel documentation.

What stays shared with the host?

WordPress core, plugin files and uploaded media. Each sandbox gets its own copy of the database tables, users included, under a generated prefix and its own copy of the active theme.

How do I enter a sandbox?

Send the X-Rudel-Environment header or the rudel_environment cookie with an HTTP request, or set RUDEL_ENVIRONMENT for WP-CLI. Rudel accepts the ID from any client, so selection is not an access control.

Does a sandbox send email?

No. Requests inside a sandbox stop outbound mail through the pre_wp_mail filter and log the recipient and subject of each blocked message.

Where does Rudel keep its own state?

In two tables in the host database, wp_rudel_environments and wp_rudel_worktrees with the default prefix. There is no runtime JSON config and no SQLite store.

What changes when I activate the plugin?

Activation creates the runtime tables, adds a bootstrap line to wp-config.php and schedules the cleanup event, so WordPress needs write access to wp-config.php at that moment. Deactivation removes the line again.

Can I roll a sandbox back?

Yes. wp rudel snapshot saves the sandbox tables and its theme files under a name, and wp rudel restore with --snapshot brings them back.

Install the plugin, create a sandbox from your own site and send your first request into it with the getting started guide.