Blueprint data format


目录

A Blueprint JSON file can have many different properties that will be used to define your Playground instance. The most important properties are detailed below.

Here’s an example that uses many of them:

{
    "landingPage": "/wp-admin/",
    "preferredVersions": {
        "php": "8.3",
        "wp": "6.5"
    },
    "features": {
        "networking": true
    },
    "steps": [
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        }
    ]
}

Try it out!

JSON schema

JSON files can be tedious to write and easy to get wrong. To help with that, Playground provides a JSON schema file that you can use to get auto-completion and validation in your editor. Just set the $schema property to the following:

{
    "$schema": "https://playground.wordpress.net/blueprint-schema.json",
}

Landing page

The landingPage property tells Playground which URL to navigate to after the Blueprint has been run. This is a great tool, especially when creating theme or plugin demos. Often, you will want to start Playground in the Site Editor or have a specific post open in the Post Editor. Make sure you use a relative path.

{
    "landingPage": "/wp-admin/site-editor.php",
}

Preferred versions

The preferredVersions property declares your preferred PHP and WordPress versions. It can contain the following properties:

{
    "preferredVersions": {
        "php": "8.3",
        "wp": "6.7"
    },
}

Features

You can use the features property to turn on or off certain features of the Playground instance. It can contain the following properties:

{
    "features": {
        "networking": false
    },
}

Extra libraries

You can preload extra libraries into the Playground instance. The following libraries are supported:

{
    "extraLibraries": [ "wp-cli" ],
}

Steps

Arguably the most powerful property, steps allows you to configure the Playground instance with preinstalled themes, plugins, demo content, and more. The following example logs the user in with a dedicated username and password. It then installs and activates the Gutenberg plugin. Learn more about steps.

{
    "steps": [
        {
            "step": "login",
            "username": "admin",
            "password": "password"
        },
        {
            "step": "installPlugin",
            "pluginData": {
                "resource": "wordpress.org/plugins",
                "slug": "gutenberg"
            }
        },
    ]
}

Common property placement mistakes

Blueprint validation errors often come from putting a valid property in the
wrong object.

Activate a plugin or theme

activate belongs inside options, not inside pluginData, themeData, or
directly on the step.

{
    "step": "installPlugin",
    "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "gutenberg"
    },
    "options": {
        "activate": true
    }
}

Install plugins with the shorthand

The plugins shorthand is a top-level Blueprint property. Do not put it inside
preferredVersions.

{
    "preferredVersions": {
        "php": "8.3",
        "wp": "latest"
    },
    "plugins": ["gutenberg"]
}

Use one plugin install shape

For an installPlugin step, use pluginData. Do not mix pluginData with
older examples or custom objects such as pluginZipFile.

{
    "step": "installPlugin",
    "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "woocommerce"
    },
    "options": {
        "activate": true
    }
}

The wordpress.org/plugins resource needs a separate slug. Do not write the
slug into the resource value, such as "wordpress.org/plugins/woocommerce".

Keep preferredVersions limited to versions

preferredVersions only accepts php and wp. Use features for networking,
plugins or installPlugin for plugins, and steps for ordered setup tasks.

Use explicit steps when order matters

Shorthands such as plugins, login, siteOptions, and constants are
expanded before the steps array. If one action must happen before another,
write both actions as explicit steps in the order you need.


版本号 #2
由 壳壳虫 创建于 2026-08-29 23:36:35 UTC
由 壳壳虫 更新于 2026-08-29 23:36:35 UTC