Query API
WordPress Playground exposes a simple API that you can use to configure the Playground in the browser.
It works by passing configuration options as query parameters to the Playground URL. For example, to install the pendant theme, you would use the following URL:
https://playground.wordpress.net/?theme=pendant
You can go ahead and try it out. The Playground will automatically install the theme and log you in as an admin. You may even embed this URL in your website using an <iframe> tag:
<iframe src="https://playground.wordpress.net/?theme=pendant"></iframe>
Available options
| Option | Default Value | Description |
|---|---|---|
php | 8.5 | Loads the specified PHP version. Accepts 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, latest, or next. Use next to preview the next PHP version from the php-src development branch; it is currently supported by the web runtime only. |
php-extension | Loads a custom PHP.wasm extension manifest before PHP starts. Accepts absolute, root-relative, or page-relative HTTP(S) URLs. Can be used multiple times. | |
wp | latest | Loads the specified WordPress version. Accepts the last three major WordPress versions. As of June 1, 2024, that's 6.3, 6.4, or 6.5. You can also use the generic values latest, nightly, or beta. |
blueprint-url | The URL of the Blueprint that will be used to configure this Playground instance. | |
networking | yes | Enables or disables the networking support for Playground. Accepts yes or no. |
plugin | Installs the specified plugin. Use the plugin name from the WordPress Plugins Directory URL. For example, if the URL is https://wordpress.org/plugins/wp-lazy-loading/, the plugin name would be wp-lazy-loading. You can pre-install multiple plugins by saying plugin=coblocks&plugin=wp-lazy-loading&…. Installing a plugin automatically logs the user in as an admin. More than one plugin could be installed, just repeating the plugin attribute on the URL. | |
theme | Installs the specified theme. Use the theme name from the WordPress Themes Directory URL. For example, if the URL is https://wordpress.org/themes/disco/, the theme name would be disco. Installing a theme automatically logs the user in as an admin. Multiples themes could be installed just repeating the theme attribute on the URL. | |
url | /wp-admin/ | Load the specified initial WordPress page in this Playground instance. |
mode | browser-full-screen | Determines how the WordPress instance is displayed. Either wrapped in a browser UI or full width as a seamless experience. Accepts browser-full-screen, or seamless. |
lazy | Defer loading the Playground assets until someone clicks on the "Run" button. Does not accept any values. If lazy is added as a URL parameter, loading will be deferred. | |
login | yes | Log the user in as an admin. Accepts yes or no. |
multisite | no | Enables the WordPress multisite mode. Accepts yes or no. |
import-site | Imports site files and database from a ZIP file specified by a URL. | |
import-wxr | Imports site content from a WXR file specified by a URL. It uses the WordPress Importer plugin, so the default admin user must be logged in. | |
site-slug | Selects which site to load from browser storage. If the specified site does not exist, Playground creates a new browser-saved site with the specified slug unless temporary storage is requested. | |
storage | Controls the storage lifecycle. Use storage=temp to create a genuinely temporary Playground that is discarded when the page is refreshed or closed. Without it, Playground may autosave the new Playground when browser storage and saving are available. | |
language | en_US | Sets the locale for the WordPress instance. This must be used in combination with networking=yes otherwise WordPress won't be able to download translations. |
core-pr | Installs a specific https://github.com/WordPress/wordpress-develop core PR. Accepts the PR number. For example, core-pr=6883. | |
gutenberg-pr | Installs a specific https://github.com/WordPress/gutenberg PR. Accepts the PR number. For example, gutenberg-pr=65337. | |
gutenberg-branch | Installs a specific branch from https://github.com/WordPress/gutenberg. Accepts the branch name. For example, gutenberg-branch=trunk. | |
page-title | Customizes the browser tab title. Useful for identifying different Playground instances when working with multiple tabs. The parameter is preserved when navigating between sites. | |
can-save | Controls whether the Playground shell offers automatic browser saving. Use can-save=no to start a temporary Playground and hide the Dock save status/persistence prompt. | |
mcp-port | 7999 | Sets the WebSocket port used by the MCP bridge to communicate with the MCP server. For example, mcp-port=8080. |
overlay | Opens a Playground tool on page load. Supports new for the Dock's New pane. For example, ?overlay=new. blueprints is kept as a compatibility alias that opens the same New pane, so ?overlay=blueprints still works. The parameter is removed from the URL when the pane is closed. | |
filebrowser | Opens the Dock’s Files pane. Accepts an optional file path relative to the WordPress document root, and an optional :<line> suffix to place the editor cursor on a 1-based line. Ignored inside embedded iframes and when mode=seamless. | |
dock | Sets the initial Dock state. Accepts minimized, collapsed, expanded, full-width, or full-width-collapsed. Overrides the saved width preference for this visit. Ignored in seamless mode. Minimized and collapsed states are ignored on small screens. Opening a pane restores the Dock as needed. |
Use language=browser to choose a WordPress translation from the browser's preferred languages
(navigator.languages). Regional preferences fall back to an available translation of the same
language. If no translation matches, WordPress uses US English (en_US). For example:
Open Playground in your browser's language.
For example, the following code embeds a Playground with a preinstalled Gutenberg plugin and opens the post editor:
<iframe src="https://playground.wordpress.net/?plugin=gutenberg&url=/wp-admin/post-new.php&mode=seamless"> </iframe>
To open the Dock’s Files pane, use:
https://playground.wordpress.net/?filebrowser
To open the Dock’s Files pane with a specific file, use a path relative to the WordPress document root:
https://playground.wordpress.net/?filebrowser=wp-content/plugins/my-plugin/index.php
To place the cursor on a specific 1-based line number, append :<line> to the path:
https://playground.wordpress.net/?filebrowser=wp-content/plugins/my-plugin/index.php:20