How one can Construct an Interactive WordPress Theme Demo with Playground Blueprints

How one can Construct an Interactive WordPress Theme Demo with Playground Blueprints

WordPress Playground shall we any person release a reside WordPress website in an instant — no website hosting or set up required. It’s a handy guide a rough, hands-on technique to discover how a theme seems to be and behaves.

You’ll open a contemporary WordPress example with a unmarried hyperlink and get started experimenting immediately.

If a theme is to be had within the WordPress repository, you’ll preview it in Playground by means of including the theme’s slug to the URL, for instance:
?theme=kiosko.

Example of a WordPress theme demo.

That mentioned, every Playground website begins with a blank WordPress set up, so issues load without a present pages or demo content material.

A clean WordPress installation.

If you wish to have your theme to seem precisely as you’ve designed it — with pattern content material, navigation, and settings — you’ll use Playground Blueprints.

On this information, I’ll display you how you can get began with Playground Blueprints and create an entire, interactive demo website to your theme.

For this workout, you’ll use a GitHub repository to retailer belongings, equivalent to .xml and blueprint.json information, to construct your demo. For Playground to have get right of entry to, it must be a public repository.

What are Playground Blueprints?

WordPress Playground Blueprints assist you to create preconfigured demo websites in JSON structure.

Every Blueprint describes how the Playground example will have to be constructed — what theme to put in, what content material to import, which settings to permit, and extra.

You’ll browse the whole documentation right here: WordPress Playground → Blueprints

With Blueprints, you’ll percentage a unmarried hyperlink that launches a completely configured demo of your theme — entire with pages, patterns, and media — so guests can discover it immediately of their browser.

Let’s discover the method step-by-step.

1. Create your demo site content material

First, construct a demo model of your theme in the neighborhood — entire with pages, posts, navigation, and settings — to turn the way it seems to be in an actual website. 

You’ll later export this content material and use it within Playground.

If you happen to’ve labored with the Web page Editor ahead of, this section will really feel acquainted. You know what mixture of pages, posts, navigation, pictures, and WordPress settings makes your theme shine.

For this publish, I ready a demo website the usage of the Twenty Twenty-5 default theme, making use of one among its taste permutations and enhancing some templates.

The instance mimics a trip weblog demo with a homepage, weblog web page, about web page, and instance templates and patterns:

A travel blog demo homepage.

I’ve additionally incorporated a 404 web page template:

Example theme demo 404 error page.

In addition to an ‘About Us’ web page:

Example About Us page.

And extra.

2. Maintain pictures and patterns

Whilst you create your content material, you could use Patterns that include your theme. 

Incessantly, pictures used are a part of the theme and saved within the theme’s belongings folder.

You would have to add the ones to the Media Library and pull them from there into your pages or posts — or substitute their URL references within the content material with relative hyperlinks pointing to:

/wp-content/issues/{yourtheme}/belongings/{filename}

…and take away the https://{area.ext} a part of the URL.

It’s absolute best to make use of WordPress gear to mechanically upload them to the Media Library to avoid wasting or from the picture block toolbar.

Uploading a file to the WordPress Media Library.

This provides you with a self-contained content material document you’ll reuse with different issues or Playground circumstances.

3. Export your content material

While you’ve constructed the demo content material in your native website, export it the usage of the WordPress Export function:

Cross to Equipment Export, and make a selection All Content material (or make particular possible choices).

WordPress Export screen.

You’ll be told extra in regards to the Export function within the documentation.

Sooner than uploading the .xml document into Playground, be certain that your pictures and different belongings are in a position. 

You’ll additionally want to replace the picture references for your content material document.

4. Get ready your export for Playground

Sooner than uploading your exported .xml document, be certain that Playground can get right of entry to your media information and that every one symbol hyperlinks level to the proper places.

To do that:

  • Add your demo pictures and belongings to a public GitHub repository (for instance, to a /media folder).
  • Replace the picture references for your .xml document so that they level to these GitHub URLs.

Add your demo pictures and belongings

Playground makes use of the WordPress Importer plugin, which mechanically resizes pictures and updates URLs for the brand new website. 

Alternatively, the importer tries to fetch pictures from their authentic URLs — and maximum internet servers block those requests as a result of Go-Starting place Useful resource Sharing (CORS) insurance policies.

To mend that, host your demo belongings on GitHub.

GitHub’s uncooked.githubusercontent.com area bypasses those restrictions, making it splendid for serving demo media.

Add all of your pictures to a /media folder for your GitHub repository and stay their authentic filenames to hurry up the import procedure.

Replace the picture references for your .xml document

Subsequent, substitute the picture references for your .xml document with the brand new GitHub URLs, below the tag.

Use this development:

https://uncooked.githubusercontent.com/{group}/{reponame}/{department}/media/{filename}

For instance:

And right here’s what every section method:

  • Group: your GitHub group (for instance, wptrainingteam)
  • Repository: your repo identify (for instance, tt5-demo-blueprint)
  • Department: primary
  • Folder: media
  • Filename: the unique document identify

Seek your .xml document for (conserving the > tags intact) and substitute every reference with the proper GitHub URL.

Tip: Within the Twenty Twenty-5 demo website instance, there have been 17 replacements in overall.

Your built-in building setting (IDE) most likely lets you in finding the specific string for your .xml document, regardless of how giant it’s. You may see different symbol references within the document whilst you use the similar symbol in numerous sizes.

I added a small Bash script to the repo; you want to alter and use it at your personal chance.

The WordPress Importer will resize the brand new pictures from the attachment URLs and substitute the references elsewhere. You handiest want to trade every symbol reference as soon as.

5. Create your Blueprint

Now that your demo content material is in a position, it’s time to configure your Playground website the usage of a Blueprint.

A Blueprint defines how Playground units up your demo — which theme to put in, which content material to import, and which choices to use.

Perceive the Blueprint construction

The Blueprint document has two primary portions:

  • Settings – positioned within the root of the file.
  • Steps – movements indexed in an array that Playground runs so as.

You’ll be told extra within the Blueprint documentation.

Right here’s an summary of a starter JSON document:

{
"$schema": "https://playground.wordpress.internet/blueprint-schema.json",
"login": true,
... extra settings,

"steps": [
	{
        	"step":"installTheme" {
            }
    },
	{
            "step":"importWXR" {
            }
    }
	more steps... 
	]
}


The primary line ($schema) is non-compulsory.

Including it is helping your IDE validate syntax, counsel homes, and catch imaginable mistakes.

Upload elementary settings

The primary atmosphere is “login”: true.

If you happen to don’t want particular credentials, this shorthand mechanically provides guests admin get right of entry to at the demo website.

If you happen to desire extra keep watch over, evaluation the Blueprint step documentation and the Blueprint Gallery for various situations.

Blank the default WordPress content material

Every new WordPress set up contains pattern content material — a publish, a remark, and a web page — which will intrude together with your demo.

You’ll upload a step to the Blueprint to take away the content material by means of executing a WP-CLI command:

      {
        "step": "wp-cli",
        "command": "wp website empty --yes"
      },

Import your demo content material

To import the content material in particular, leverage the importWxr step — the usage of the uncooked.githubusercontent.com area to indicate on your *.xml document.

  {
     "step": "importWxr",
     "document": {
       "useful resource": "url",
       "url": "https://uncooked.githubusercontent.com/wptrainingteam/tt5-demo-blueprint/primary/playgroundcontent.xml"
         }
  }

Set up and turn on the theme

Subsequent, set up and turn on the theme you wish to have to demo.

It may possibly come from the WordPress repository, a ZIP document, or a listing of theme information.

This case makes use of the default Twenty Twenty-5 theme:

    {
        "step": "installTheme",
        "themeData": {
            "useful resource": "wordpress.org/issues",
            "slug": "twentytwentyfive"
    },
    "choices": {
        "turn on": true
    }
    },

Set Web page choices

You may additionally need to set a couple of Web page choices. You’ll use a step or the shorthand to setSiteOptions:

  • For the hyperlinks to class pages and navigation menus to paintings, you’ll want to permit beautiful permalinks.
  • You’ll additionally set values for the weblog identify and outline to make it extra attractive.
  • To completely arrange your demo, you’ll most likely additionally need to configure your entrance web page and weblog web page.

The snippet under displays how you can enforce those settings:

"setSiteOptions": {
       "blogname": "Twenty-Twenty-5",
       "blogdescription": "The WordPress default theme",
       "show_on_front": "web page",
       "page_on_front": 80,
       "page_for_posts": 26,
       "permalink_structure": "/%postname%/"

   }

The numbers for page_on_front and page_for_posts fit the publish IDs for your imported content material.

This works since the website used to be emptied ahead of import.

Non-compulsory: Upload plugins

You’ll additionally come with plugins — for instance, block collections or WooCommerce.

Right here’s the shorthand for putting in the “Block Visibility,” “Public Put up Preview,” and “Gutenberg” plugins and activating them. 

So as to add extra plugins, simply upload them to the array:

{
"plugins": [ "block-visibility","public-post-preview", "gutenberg" ]
}

Mix the whole thing

Now that you just’ve added every step, it’s time to mix them into one entire Blueprint document.

This ultimate JSON defines your whole demo website setup — from cleansing the default content material to putting in your theme, uploading posts, and atmosphere website choices:

{
  "$schema": "https://playground.wordpress.internet/blueprint-schema.json",
  "login": true,
  "steps": [
    {
        "step": "wp-cli",
        "command": "wp site empty --yes"
    },
    {
      "step": "updateUserMeta",
      "meta": {
          "admin_color": "modern"
      },
      "userId": 1
    },
    {
        "step": "installTheme",
        "themeData": {
            "resource": "wordpress.org/themes",
            "slug": "twentytwentyfive"
        },
        "options": {
            "activate": true
        }
    },

    {
      "step": "importWxr",
                    "file": {
                            "resource": "url",
                            "url": "https://raw.githubusercontent.com/wptrainingteam/tt5-demo-blueprint/main/playground-content.xml"
}
    },
    {
      "step": "setSiteOptions",
      "options": {
        "blogname": "Theme Demo ",
        "blogdescription": "A preview of a theme",
        "show_on_front": "page",
                "page_on_front": 80,
                "page_for_posts": 26,
        "permalink_structure": "/%postname%/"
      }
    }
  ],
   "plugins": [ "block-visibility","public-post-preview", "gutenberg" ],
}

6. Take a look at your Blueprint

Sooner than sharing your demo, check the Blueprint in Playground to verify that each step runs appropriately and your theme seems as meant.

Open your Playground URL to release the demo website and test that:

  • The theme installs and turns on correctly.
  • All pages, posts, and menus from the .xml import show.
  • Photographs load from the GitHub /media folder.
  • Permalinks and front-page settings paintings as anticipated.

If one thing seems to be off, evaluation your blueprint.json for typos or lacking commas.

Blueprints are declarative, so even a small syntax factor can interrupt setup. Repair any problems in the neighborhood, add the corrected document to GitHub, and refresh the Playground hyperlink to check once more.

7. Proportion your Blueprint

In spite of everything, add your blueprint.json document to GitHub and percentage the Playground URL with the Blueprint question parameter.

You’ll use a URL shortener equivalent to Bitly to trace utilization.

For instance:

https://playground.wordpress.internet/?blueprint-url=https://uncooked.githubusercontent.com/wptrainingteam/tt5-demo-blueprint/primary/blueprint.json

The entire theme demo is to be had on GitHub and contains:

  • The content material to import
  • Photographs and belongings within the /media folder
  • The blueprint.json document
  • The Bash script to lend a hand with the attachment URL replacements

Tip: The Blueprints documentation gives some ways to configure your Playground example to your or your purchasers’ wishes.

Be told extra about Blueprints and Playground

Now that you just’ve realized how you can use Playground to show off your merchandise, discover those guides at the WordPress Developer Weblog:

You’ll additionally observe this information in WordPress Studio, which now helps Blueprints.

WPBeginner Highlight 27: WordPress 7.1, WPVibe AI All over, and a New Option to Report Your Display
WPBeginner Highlight 27: WordPress 7.1, WPVibe AI All over, and a New Option to Report Your Display by in Blog

August used to be a large month for WordPress. WordPress 7 ...

01 Sep, 2026 7  Person Liked it

WordPress.com Changelog: A New Web hosting Dashboard, a ChatGPT Plugin, and WordPress 7.1
WordPress.com Changelog: A New Web hosting Dashboard, a ChatGPT Plugin, and WordPress 7.1 by in Blog

August 14 – 27, 2026 Welcome again to the WordPr ...

30 Aug, 2026 7  Person Liked it

Your WordPress.com Website Now Works from Within ChatGPT
Your WordPress.com Website Now Works from Within ChatGPT by in Blog

You'll now set up your WordPress.com web page from Ch ...

27 Aug, 2026 6  Person Liked it

Offer Ends Tonight 12 PM

Lifetime Membership with Unlimited Access