Block Theme Development Workflow: Tools and Setup for 2026

Building a block theme in WordPress has never been more streamlined. With @wordpress/create-block scaffolding entire theme structures, wp-env spinning up reproducible local environments in seconds, and theme.json IntelliSense catching schema errors before they reach the browser, the 2026 block theme development workflow eliminates the friction that used to slow teams down. This guide walks through every tool and configuration you need to ship production-grade block themes efficiently.

Whether you are building your first block theme or migrating a classic theme to full site editing, the toolchain you choose determines your velocity. A poorly configured environment leads to constant context-switching between documentation tabs, guessing at theme.json properties, and debugging issues that automated tooling would have caught. The modern block theme workflow fixes all of that.

Why Your Block Theme Workflow Matters More Than Your Code

The WordPress block theme ecosystem has matured significantly. Theme.json now controls global styles, typography, spacing, and layout. Block patterns replace what used to require custom PHP template logic. Template parts handle headers and footers declaratively. But this declarative power comes with complexity, there are hundreds of theme.json properties, dozens of block supports, and an evolving API surface.

A proper development workflow turns that complexity into confidence. Instead of memorizing schema properties, your editor autocompletes them. Instead of manually refreshing the browser after every change, hot reload shows updates instantly. Instead of discovering bugs in production, automated testing catches them during development.

“The best developers are not the ones who write the most code, they are the ones who set up environments where mistakes become impossible.”

, WordPress Core Contributor Philosophy

Essential Tools for Block Theme Development in 2026

The block theme development stack has consolidated around a set of core tools. Each one handles a specific part of the workflow, and together they cover everything from scaffolding to deployment.

1. @wordpress/create-block, Project Scaffolding

The @wordpress/create-block package is the official scaffolding tool for WordPress block development. While originally designed for custom blocks, it now supports full theme scaffolding through templates. Running a single command generates the complete directory structure, build configuration, and starter files you need.

npx @wordpress/create-block@latest my-block-theme --variant theme
cd my-block-theme
npm install

This generates a theme with theme.json, starter templates, template parts, block patterns, and a configured build pipeline using @wordpress/scripts. The generated package.json includes scripts for building, linting, and formatting your theme assets.

For teams that need more opinionated setups, community templates like theme-starter and theme-developer extend the base scaffolding with additional patterns, style variations, and CI configuration files.

2. wp-env, Local Development Environment

The @wordpress/env package (commonly called wp-env) provides a Docker-based local WordPress environment that requires zero configuration. It reads a .wp-env.json file from your project root and spins up a complete WordPress instance with your theme activated.

# Install globally
npm install -g @wordpress/env

# Start the environment
wp-env start

# Access your site
# WordPress: http://localhost:8888
# Admin: http://localhost:8888/wp-admin (admin/password)

The real power of wp-env is reproducibility. Every team member gets an identical environment. No more “works on my machine” issues. The .wp-env.json configuration file locks down the WordPress version, PHP version, active plugins, and theme mapping.

{
  "core": "WordPress/WordPress#6.8",
  "phpVersion": "8.3",
  "plugins": [
    "developer",
    "query-monitor",
    "gutenberg"
  ],
  "themes": [
    "."
  ],
  "mappings": {
    "wp-content/mu-plugins": "./mu-plugins"
  },
  "config": {
    "WP_DEBUG": true,
    "WP_DEBUG_LOG": true,
    "SCRIPT_DEBUG": true
  }
}

This configuration mounts your current directory as the active theme, installs Query Monitor and the Gutenberg plugin for testing latest editor features, enables debugging, and pins WordPress to version 6.8. When you run wp-env start, Docker handles the rest.

3. Theme.json IntelliSense, Schema-Driven Development

The theme.json file is the control center of every block theme. It defines global styles, color palettes, typography scales, spacing presets, layout widths, and block-level customizations. For a deep dive into configuring these settings, see our guide on configuring global styles in theme.json for consistent block theme design. With over 200 properties across nested objects, editing it without tooling assistance is error-prone.

VS Code with the WordPress theme.json schema provides real-time IntelliSense, autocomplete for every property, inline documentation, and validation that flags errors as you type. To enable it, add the $schema property to the top of your theme.json file. The official WordPress theme.json documentation provides the full schema reference.

{
  "$schema": "https://schemas.wp.org/wp/6.8/theme.json",
  "version": 3,
  "settings": {
    "color": {
      "palette": [
        {
          "slug": "primary",
          "color": "#1e40af",
          "name": "Primary"
        },
        {
          "slug": "secondary",
          "color": "#9333ea",
          "name": "Secondary"
        }
      ],
      "defaultPalette": false,
      "custom": true,
      "link": true
    },
    "typography": {
      "fluid": true,
      "fontSizes": [
        {
          "slug": "small",
          "size": "0.875rem",
          "fluid": {
            "min": "0.75rem",
            "max": "0.875rem"
          },
          "name": "Small"
        },
        {
          "slug": "medium",
          "size": "1.125rem",
          "fluid": {
            "min": "1rem",
            "max": "1.125rem"
          },
          "name": "Medium"
        }
      ]
    },
    "spacing": {
      "units": ["px", "rem", "em", "%", "vw"]
    },
    "layout": {
      "contentSize": "720px",
      "wideSize": "1200px"
    }
  }
}

With the schema reference in place, your editor knows every valid property at every nesting level. Hover over a property to see its documentation. Mistype a key and see an immediate red underline. This eliminates an entire category of bugs that would otherwise only surface when loading the theme in WordPress.


Setting Up Hot Reload for Block Theme Development

Hot reload transforms the development experience. Instead of saving a file, switching to the browser, and manually refreshing, changes appear automatically. For block themes, hot reload covers two domains: PHP template changes and CSS/JavaScript asset changes.

Browser-Sync for Template Changes

PHP template files (.html templates in block themes) require a full page reload to reflect changes. BrowserSync watches your template files and triggers an automatic reload when any file changes.

# Install BrowserSync
npm install --save-dev browser-sync

# Add to package.json scripts
"scripts": {
  "watch": "browser-sync start --proxy 'localhost:8888' --files '**/*.html, **/*.json, **/*.php, assets/**/*' --no-notify"
}

Run npm run watch alongside wp-env start, and every template, pattern, or style change triggers an instant browser refresh. BrowserSync also provides synchronized scrolling across multiple devices, which is valuable for testing responsive block theme layouts.

Webpack Hot Module Replacement for Assets

For CSS and JavaScript changes, @wordpress/scripts supports hot module replacement (HMR) through its start command. This injects updated styles without a full page reload, preserving the current editor state.

# Start the webpack dev server with HMR
npm run start

# This watches src/ directory and rebuilds on changes
# CSS changes inject without reload
# JS changes trigger a controlled refresh

The combination of BrowserSync for templates and HMR for assets means you rarely need to manually refresh during development. This tight feedback loop is what separates productive block theme development from the tedious save-refresh-check cycle of traditional WordPress theming.


Testing Your Block Theme: Automated and Manual Approaches

Block themes introduce unique testing requirements. Beyond standard PHP unit tests, you need to verify that theme.json settings produce the expected CSS output, that block patterns render correctly across different contexts, and that template parts compose properly in the site editor.

Theme Check Plugin

The Theme Check plugin validates your theme against WordPress.org requirements. For block themes, it verifies theme.json schema compliance, required template existence, proper file structure, and accessibility standards. Run it against every theme before submission or deployment.

# Install via wp-env
wp-env run cli wp plugin install theme-check --activate

# Run the check
wp-env run cli wp theme-check run my-block-theme

End-to-End Testing with Playwright

For block themes, end-to-end (E2E) tests verify that the site editor renders correctly, that global styles apply as expected, and that template switching works. WordPress core uses Playwright for its own E2E tests, and the same framework works for themes.

// e2e/theme-styles.spec.js
import { test, expect } from '@wordpress/e2e-test-utils-playwright';

test('global styles apply custom colors', async ({ page, admin }) => {
  await admin.visitSiteEditor({ path: '/wp_global_styles' });
  
  // Verify primary color is applied
  const primaryColor = await page.evaluate(() => {
    return getComputedStyle(document.documentElement)
      .getPropertyValue('--wp--preset--color--primary');
  });
  
  expect(primaryColor.trim()).toBe('#1e40af');
});

test('front page template renders correctly', async ({ page }) => {
  await page.goto('/');
  
  // Verify header template part is present
  await expect(page.locator('header.wp-block-template-part')).toBeVisible();
  
  // Verify content area uses correct layout width
  const contentWidth = await page.evaluate(() => {
    const content = document.querySelector('.wp-block-post-content');
    return getComputedStyle(content).maxWidth;
  });
  
  expect(contentWidth).toBe('720px');
});

Visual Regression Testing

Block themes are highly visual. A single theme.json change can cascade through dozens of pages. Visual regression testing captures screenshots of key pages and compares them against baselines, flagging any unintended visual changes.

Tools like Percy, Chromatic, or the built-in Playwright screenshot comparison handle this. Add visual regression tests to your CI pipeline and you will catch layout shifts, color changes, and typography regressions before they reach production.

Testing LayerToolWhat It Catches
Schema ValidationTheme.json IntelliSenseInvalid properties, typos, wrong types
Standards ComplianceTheme Check PluginMissing templates, accessibility issues
Functional TestingPlaywright E2EBroken templates, style application failures
Visual RegressionPercy / Playwright ScreenshotsUnintended layout or style changes
PerformanceLighthouse CIRender-blocking assets, layout shifts

Block Pattern Development Workflow

Block patterns are reusable arrangements of blocks that users can insert into posts and pages. If you want hands-on practice, our tutorial on creating custom block patterns in WordPress block themes walks through the full process. In block themes, patterns serve as the primary design building blocks, they replace what custom page templates and shortcodes used to handle in classic themes.

Creating Patterns from the Editor

The fastest way to create patterns is directly in the WordPress editor. Design the layout visually, then export it as a pattern file. This approach leverages the editor’s block manipulation tools rather than writing HTML markup manually.

  1. Open the site editor and create a new page or template
  2. Build your layout using core blocks (columns, groups, images, headings)
  3. Select all the blocks that form the pattern
  4. Click the three-dot menu and select “Copy blocks”
  5. Create a new PHP file in your theme’s patterns/ directory
  6. Paste the block markup and add the required pattern header comment
<?php
/**
 * Title: Hero Section with CTA
 * Slug: my-theme/hero-cta
 * Categories: featured, banner
 * Keywords: hero, call to action, banner
 * Block Types: core/template-part/header
 * Post Types: page
 * Viewport Width: 1400
 */
?>

<!-- wp:cover {"dimRatio":60,"overlayColor":"primary","isUserOverlayColor":true,"minHeight":600} -->
<div class="wp-block-cover" style="min-height:600px">
  <span class="wp-block-cover__background has-primary-background-color has-background-dim-60 has-background-dim"></span>
  <div class="wp-block-cover__inner-container">
    <!-- wp:heading {"textAlign":"center","level":1,"fontSize":"x-large"} -->
    <h1 class="has-text-align-center has-x-large-font-size">Build Something Amazing</h1>
    <!-- /wp:heading -->
    
    <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
    <div class="wp-block-buttons">
      <!-- wp:button -->
      <div class="wp-block-button"><a class="wp-block-button__link wp-element-button">Get Started</a></div>
      <!-- /wp:button -->
    </div>
    <!-- /wp:buttons -->
  </div>
</div>
<!-- /wp:cover -->

Pattern Categories and Organization

Organize patterns into meaningful categories that match your theme’s use cases. Register custom pattern categories in your theme’s functions.php or a pattern registration file.

// Register custom pattern categories
register_block_pattern_category('my-theme-heroes', [
    'label' => __('Hero Sections', 'my-theme'),
]);

register_block_pattern_category('my-theme-testimonials', [
    'label' => __('Testimonials', 'my-theme'),
]);

register_block_pattern_category('my-theme-pricing', [
    'label' => __('Pricing Tables', 'my-theme'),
]);

Deployment Pipeline for Block Themes

A production-grade deployment pipeline for block themes handles building, testing, packaging, and releasing. Whether you deploy to WordPress.org, a private repository, or directly to client servers, automation eliminates manual errors and ensures consistency.

GitHub Actions CI/CD Pipeline

A GitHub Actions workflow that runs on every push and pull request provides continuous integration. The pipeline lints code, validates theme.json, runs E2E tests, and optionally deploys to a staging server.

# .github/workflows/theme-ci.yml
name: Block Theme CI

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run lint:css
      - run: npm run lint:js
      - run: npx ajv validate -s node_modules/@wordpress/theme-json-schema/schemas/theme.json -d theme.json

  test:
    needs: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run build
      - run: npx wp-env start
      - run: npx playwright install chromium
      - run: npm run test:e2e

  deploy-staging:
    needs: test
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci && npm run build
      - name: Deploy to staging
        run: |
          rsync -avz --delete \
            --exclude='.git' \
            --exclude='node_modules' \
            --exclude='.wp-env.json' \
            --exclude='e2e/' \
            ./ ${{ secrets.STAGING_SSH }}:/var/www/html/wp-content/themes/my-block-theme/

Theme Packaging for Distribution

When distributing block themes (either via WordPress.org or privately), the package should only include production files. Development dependencies, test files, and configuration files should be excluded.

# Build production assets
npm run build

# Create distribution zip
zip -r my-block-theme.zip . \
  -x "node_modules/*" \
  -x ".wp-env.json" \
  -x "e2e/*" \
  -x ".github/*" \
  -x "src/*" \
  -x "*.config.js" \
  -x "package*.json" \
  -x ".eslintrc" \
  -x ".stylelintrc"

Advanced Workflow Optimizations

Style Variations Development

Style variations let users switch the entire visual appearance of a block theme without changing templates. Each variation is a separate JSON file in the styles/ directory that overrides specific theme.json settings.

// styles/dark-mode.json
{
  "version": 3,
  "title": "Dark Mode",
  "settings": {
    "color": {
      "palette": [
        { "slug": "base", "color": "#1a1a2e", "name": "Base" },
        { "slug": "contrast", "color": "#eaeaea", "name": "Contrast" },
        { "slug": "primary", "color": "#60a5fa", "name": "Primary" }
      ]
    }
  },
  "styles": {
    "color": {
      "background": "var(--wp--preset--color--base)",
      "text": "var(--wp--preset--color--contrast)"
    }
  }
}

The development workflow for style variations involves creating the JSON file, testing it in the site editor’s style switcher, and verifying that all blocks render properly with the new color scheme. Automated visual regression tests become especially valuable here, a single variation file can affect every page on the site.

Custom Block Styles and Variations

Beyond theme-level style variations, block themes can register custom styles for individual blocks. These appear as style options in the block toolbar, letting users pick between visual treatments without editing CSS.

// In theme.json
{
  "styles": {
    "blocks": {
      "core/button": {
        "variations": {
          "outline": {
            "border": {
              "width": "2px",
              "style": "solid",
              "color": "var(--wp--preset--color--primary)"
            },
            "color": {
              "background": "transparent",
              "text": "var(--wp--preset--color--primary)"
            }
          },
          "rounded": {
            "border": {
              "radius": "50px"
            }
          }
        }
      }
    }
  }
}

Performance Monitoring in Development

Block themes can inadvertently impact performance through excessive CSS custom properties, large pattern files, or render-blocking font declarations. Integrate Lighthouse CI into your development workflow to catch performance regressions early.

# Install Lighthouse CI
npm install -g @lhci/cli

# Run Lighthouse against your local wp-env instance
lhci autorun --config=lighthouserc.json

# lighthouserc.json
{
  "ci": {
    "collect": {
      "url": ["http://localhost:8888/", "http://localhost:8888/sample-page/"],
      "numberOfRuns": 3
    },
    "assert": {
      "assertions": {
        "categories:performance": ["error", { "minScore": 0.9 }],
        "categories:accessibility": ["error", { "minScore": 0.95 }],
        "cumulative-layout-shift": ["error", { "maxNumericValue": 0.1 }]
      }
    }
  }
}

Complete Project Structure Reference

A well-organized block theme follows a predictable directory structure. Here is the recommended layout that supports all the tools and workflows covered in this guide.

my-block-theme/
├── .github/
│   └── workflows/
│       └── theme-ci.yml          # CI/CD pipeline
├── .wp-env.json                   # Local dev environment config
├── assets/
│   ├── fonts/                     # Custom web fonts
│   └── images/                    # Theme images
├── e2e/
│   ├── theme-styles.spec.js       # E2E tests
│   └── playwright.config.js       # Playwright config
├── parts/
│   ├── header.html                # Header template part
│   ├── footer.html                # Footer template part
│   └── sidebar.html               # Sidebar template part
├── patterns/
│   ├── hero-cta.php               # Hero pattern
│   ├── testimonial-grid.php       # Testimonials pattern
│   └── pricing-table.php          # Pricing pattern
├── src/
│   ├── css/
│   │   ├── style.css              # Main stylesheet source
│   │   └── editor.css             # Editor-specific styles
│   └── js/
│       └── view.js                # Front-end scripts
├── styles/
│   ├── dark-mode.json             # Dark style variation
│   └── high-contrast.json         # Accessibility variation
├── templates/
│   ├── index.html                 # Default template
│   ├── single.html                # Single post template
│   ├── page.html                  # Page template
│   ├── archive.html               # Archive template
│   ├── 404.html                   # 404 template
│   └── home.html                  # Blog home template
├── functions.php                   # Theme setup and registration
├── package.json                    # npm dependencies and scripts
├── readme.txt                      # WordPress.org readme
├── screenshot.png                  # Theme screenshot (1200x900)
├── style.css                       # Theme header (metadata only)
└── theme.json                      # Global settings and styles

Tool Comparison: Choosing the Right Stack

Not every project needs every tool. Here is a comparison to help you decide what fits your situation.

ToolBest ForLearning CurveSetup Time
wp-envTeams needing reproducible environmentsLow5 minutes
Local by FlywheelSolo developers wanting a GUIVery Low2 minutes
DDEV / LandoComplex multi-service setupsMedium15 minutes
@wordpress/scriptsBuild pipeline for assetsLowIncluded in scaffolding
PlaywrightE2E testing of editor and front-endMedium10 minutes
BrowserSyncAuto-reload during developmentLow2 minutes
Lighthouse CIPerformance regression trackingLow5 minutes

Common Pitfalls and How to Avoid Them

Even with the right tools, block theme development has common traps that catch developers off guard. Here are the most frequent issues and their solutions.

  • Forgetting the theme.json schema reference, Without the $schema property, you lose IntelliSense. Always add it as the first property in theme.json.
  • Not testing with Gutenberg plugin, The block editor in WordPress core lags behind the Gutenberg plugin by several releases. Test with both to ensure forward compatibility.
  • Hardcoding colors in patterns, Use theme.json preset variables (var(--wp--preset--color--primary)) instead of hex values. This ensures patterns respect style variations.
  • Ignoring the createBlockTheme plugin, This plugin exports your editor customizations back to theme files, bridging the gap between visual editing and code-based development.
  • Skipping fluid typography, Fixed font sizes create poor responsive experiences. Use theme.json fluid typography with min/max clamp values for every font size preset.
  • Not versioning theme.json changes, Theme.json changes can have wide-reaching effects. Commit frequently and use descriptive commit messages that explain the design intent behind each change.

Getting Started: Your First 30 Minutes

If you want to set up a complete block theme development workflow from scratch, here is the fastest path. These steps assume you have Node.js 20+ and Docker installed.

  1. Scaffold the theme, Run npx @wordpress/create-block@latest my-theme --variant theme and enter the new directory.
  2. Configure wp-env, Create .wp-env.json with your WordPress version, plugins, and debugging config.
  3. Add theme.json schema, Add "$schema": "https://schemas.wp.org/wp/6.8/theme.json" to the top of your theme.json file.
  4. Start the environment, Run wp-env start and verify your theme loads at localhost:8888.
  5. Set up hot reload, Install BrowserSync and configure the watch script in package.json.
  6. Create your first pattern, Design a hero section in the editor, export it to patterns/hero.php.
  7. Add a style variation, Create styles/dark-mode.json with an alternate color palette and test the style switcher.
  8. Run Theme Check, Install the Theme Check plugin via wp-env and verify your theme passes all checks.

In 30 minutes, you will have a fully functional development environment with schema validation, hot reload, and a starter theme that passes WordPress.org standards. From there, build out your templates, patterns, and custom styles with confidence that your tooling catches errors before your users do.

Frequently Asked Questions

Do I need Docker to develop block themes?

Not strictly. Tools like Local by Flywheel and MAMP provide WordPress environments without Docker. However, wp-env requires Docker and offers the best reproducibility for teams. If you work solo and prefer a GUI-based local environment, Docker is optional, but the rest of the toolchain (scaffolding, IntelliSense, hot reload, testing) works regardless of your local server choice.

Can I use this workflow for converting a classic theme to a block theme?

Yes. Start by scaffolding a new block theme project and migrate your classic theme’s styles into theme.json. Our block themes vs classic themes migration guide covers the full process in detail. Convert PHP templates to HTML block templates one at a time, starting with index.html. The Create Block Theme plugin can help by letting you recreate layouts in the site editor and exporting them as block markup. Keep both themes active during migration using a child theme approach.

How do I handle custom PHP functionality in a block theme?

Block themes still support functions.php for registering block styles, pattern categories, custom block variations, and any PHP hooks you need. The key difference is that template rendering is now handled by HTML files with block markup rather than PHP template files. For complex dynamic functionality, create custom blocks or use the render_block filter to modify block output.

What is the minimum WordPress version for block theme development?

WordPress 5.9 introduced full block theme support with the site editor. However, for the best development experience with all current features (style variations, fluid typography, layout controls, template part areas), target WordPress 6.4 or later. In 2026, most active WordPress sites run 6.6+, making 6.4 a safe minimum requirement.

Should I install the Gutenberg plugin alongside my block theme?

During development, yes. The Gutenberg plugin receives block editor updates months before they land in WordPress core. Testing with Gutenberg active ensures your theme works with upcoming features and catches compatibility issues early. In production, Gutenberg is optional, your theme should work with both the core editor and the Gutenberg plugin.


Take Your Block Theme Development Further

The tools and workflow covered in this guide give you a production-ready foundation for building block themes in 2026. Schema-driven development eliminates guesswork. Reproducible environments eliminate setup friction. Hot reload eliminates the refresh cycle. Automated testing eliminates regression surprises. And a CI/CD pipeline eliminates deployment anxiety.

If you are planning a block theme project and want expert guidance on architecture, performance optimization, or custom block development, our team specializes in building block themes that scale. We have helped agencies and product teams ship block themes that handle millions of page views while maintaining the flexibility that site editors demand. Reach out to discuss your block theme development needs and get a workflow tailored to your project requirements.

Scroll to Top