The @wordpress/create-block
tool has received significant updates that have transformed it into a more powerful and integrated development tool.
Current version: 4.71.0 (released August 10, 2025).
Key New Features & Updates
1. Enhanced wp-env Integration.
What it does:
The --wp-env
flag automatically configures your generated plugin with a local WordPress development environment using Docker.
How to use:
npx @wordpress/create-block@latest my-block --wp-env
What it generates:
.wp-env.json
configuration file- npm scripts for environment management
- Automatic WordPress setup with Docker
Example generated .wp-env.json:
{
"core": "WordPress/WordPress#6.8",
"plugins": [ "." ],
"themes": [ "WordPress/twentytwentyfive" ]
}
Code language: JSON / JSON with Comments (json)
Usage commands after generation:
cd my-block npm run wp-env start # Start WordPress environment npm run wp-env stop # Stop environment npm run wp-env destroy # Remove environment
2. Advanced Template System.
External NPM Package Templates:
# Use external template
npx @wordpress/create-block@latest my-block --template @wordpress/create-block-interactive-template
# Use local directory template
npx @wordpress/create-block@latest my-block --template ./path/to/my-template
Code language: CSS (css)
Block Variants:
# Create dynamic block
npx @wordpress/create-block@latest my-block --variant dynamic
# Create static block (default)
npx @wordpress/create-block@latest my-block --variant static
Code language: PHP (php)
3. “No Plugin” Mode.
For theme developers or existing projects
What it does:
Scaffolds only block files without plugin wrapper structure.
How to use:
npx @wordpress/create-block@latest my-block --no-plugin
Generated structure:
my-block/
├── build/
├── src/
│ ├── block.json
│ ├── edit.js
│ ├── save.js
│ └── style.scss
└── package.json
4. Custom Namespace Support.
What it does:
Allows custom namespace instead of using the slug as namespace.
Example:
npx @wordpress/create-block@latest my-block --namespace=my-company
Result:
- Block name:
my-company/my-block
instead ofmy-block/my-block
- Cleaner organization for companies/agencies
5. Text Domain Customization.
Usage:
npx @wordpress/create-block@latest my-block --textdomain=my-custom-domain
Benefits:
- Better internationalization control
- Consistent with existing projects
- Plugin/theme compatibility
6. Target Directory Control.
Usage:
npx @wordpress/create-block@latest my-block --target-dir=./custom-location
Use cases:
- Integrate into existing monorepo
- Organize multiple blocks
- Custom project structure
7. wp-scripts Integration Control.
Enable (default):
npx @wordpress/create-block@latest my-block --wp-scripts
Disable:
npx @wordpress/create-block@latest my-block --no-wp-scripts
When to disable:
- Custom build process
- Existing webpack setup
- Performance optimization
WordPress API Integrations
1. Block Bindings API.
What it does:
Connects block attributes to dynamic data sources without custom blocks.
Example with create-block generated block:
// In functions.php or plugin
add_action( 'init', function () {
register_meta( 'post', 'book_title', array(
'show_in_rest' => true,
'single' => true,
'type' => 'string',
'label' => __('Book Title', 'textdomain'),
) );
} );
Code language: PHP (php)
Block markup (in editor):
<!-- wp:paragraph {
"metadata": {
"bindings": {
"content": {
"source": "core/post-meta",
"args": { "key": "book_title" }
}
}
}
} -->
<p></p>
<!-- /wp:paragraph -->
Code language: HTML, XML (xml)
Enhanced in WordPress 6.7 (November 12, 2024):
- Default UI in block settings
- New Attributes panel
- Label support for custom fields
2. Block Registration Performance APIs.
wp_register_block_metadata_collection()
Introduced: WordPress 6.7 (November 12, 2024)
What it does:
Improves performance when registering multiple blocks by using a manifest file.
How create-block integrates:
# Generate manifest automatically npx @wordpress/create-block@latest my-blocks --wp-scripts npm run build -- --blocks-manifest
Generated manifest structure:
<?php
// build/blocks-manifest.php
return array(
'my-plugin/block-one' => array(
'file' => 'file:./block-one/block.json'
),
'my-plugin/block-two' => array(
'file' => 'file:./block-two/block.json'
)
);
Code language: HTML, XML (xml)
Plugin registration:
// In main plugin file
wp_register_block_metadata_collection(
__DIR__ . '/build',
__DIR__ . '/build/blocks-manifest.php'
);
Code language: PHP (php)
wp_register_block_types_from_metadata_collection()
Introduced: WordPress 6.8 (April 15, 2025)
Simplified registration:
// Instead of individual registrations
wp_register_block_types_from_metadata_collection(
__DIR__ . '/build',
__DIR__ . '/build/blocks-manifest.php'
);
Code language: PHP (php)
3. Interactivity API.
Introduced: WordPress 6.5 (April 2, 2024)
Integration with create-block:
npx @wordpress/create-block@latest interactive-block --template @wordpress/create-block-interactive-template
Generated interactive block structure:
// src/view.js
import { store, getContext } from '@wordpress/interactivity';
store( 'create-block/interactive-block', {
actions: {
toggle: () => {
const context = getContext();
context.isOpen = !context.isOpen;
},
},
} );
Code language: JavaScript (javascript)
Version Timeline & WordPress Compatibility
WordPress Version | Release Date | Key Features Added |
---|---|---|
6.5 “Regina” | April 2, 2024 | Block Bindings API, Interactivity API |
6.6 “Dorsey” | July 16, 2024 | Pattern Overrides, Block Bindings UI improvements |
6.7 “Rollins” | November 12, 2024 | Block Bindings default UI, Performance APIs, Zoom Out mode |
6.8 “Cecil” | April 15, 2025 | Enhanced block registration APIs, style book improvements |
WordPress 6.8 Major Changes (April 15, 2025):
- Single major release per year policy implemented
- Enhanced
wp_register_block_types_from_metadata_collection()
function - Style Book now works with Classic themes
- Speculative loading for faster navigation
- bcrypt password hashing for security
- Over 100 accessibility improvements
Practical Use Cases & Examples
Case 1: Real Estate Listings
# Create real estate block with custom fields integration npx @wordpress/create-block@latest property-listing --wp-env --namespace=realty-pro
// Register property meta fields
register_meta( 'post', 'property_price', array(
'show_in_rest' => true,
'type' => 'string',
'label' => __('Property Price', 'realty-pro'),
) );
register_meta( 'post', 'property_size', array(
'show_in_rest' => true,
'type' => 'string',
'label' => __('Property Size', 'realty-pro'),
) );
Code language: PHP (php)
Case 2: Product Catalog for E-commerce
# Multi-block product system npx @wordpress/create-block@latest product-blocks --wp-env --wp-scripts
# Build with manifest for performance npm run build -- --blocks-manifest
Case 3: Theme Integration
# For theme developers npx @wordpress/create-block@latest theme-blocks --no-plugin --target-dir=./blocks
Development Environment Requirements
Minimum Requirements (as of August 2025):
- Node.js: 20.10.0 or higher
- npm: 10.2.3 or higher
- WordPress: 6.5+ (for Block Bindings API)
- WordPress: 6.8+ (for latest performance APIs)
Recommended Setup:
# Check versions node --version # Should be >= 20.10.0 npm --version # Should be >= 10.2.3 # Global installation (optional) npm install -g @wordpress/create-block@latest # With wp-env for local development npm install -g @wordpress/env
Performance Optimizations
1. Manifest Generation (@wordpress/scripts 30.3.0+)
Released: October 17, 2024
# In package.json scripts
{
"scripts": {
"build": "wp-scripts build --blocks-manifest",
"start": "wp-scripts start --blocks-manifest"
}
}
Code language: PHP (php)
2. Efficient Block Registration (WordPress 6.8+)
// Old way (WordPress < 6.7)
register_block_type_from_metadata( __DIR__ . '/build/block-one' );
register_block_type_from_metadata( __DIR__ . '/build/block-two' );
register_block_type_from_metadata( __DIR__ . '/build/block-three' );
// New way (WordPress 6.8+)
wp_register_block_types_from_metadata_collection(
__DIR__ . '/build',
__DIR__ . '/build/blocks-manifest.php'
);
Code language: PHP (php)
Migration Guide
From Legacy create-block:
- Update Node.js to 20.10.0+
- Update npm to 10.2.3+
- Use latest version:
@latest
flag - Add wp-env:
--wp-env
for local development - Enable manifest:
--blocks-manifest
for performance
From Custom Block Development:
- Leverage Block Bindings instead of custom blocks for data display
- Use templates for common patterns
- Implement manifest generation for multiple blocks
- Integrate with wp-env for consistent development environment
Best Practices (August 2025)
1. Project Structure.
# Recommended command for new projects
npx @wordpress/create-block@latest my-project \
--wp-env \
--wp-scripts \
--namespace=my-company \
--textdomain=my-company-blocks
Code language: CSS (css)
2. Development Workflow.
# Start development
npm run wp-env start
npm run start
# Build for production with manifest
npm run build -- --blocks-manifest
# Test in different environments
npm run wp-env start -- --update
Code language: PHP (php)
3. Performance Considerations for 2025
- Use manifest generation for 3+ blocks (required for WordPress 6.8+)
- Implement Block Bindings for dynamic content instead of custom blocks
- Leverage wp-env for consistent testing across WordPress versions
- Follow WordPress coding standards and new annual release cycle
- Test compatibility with WordPress 6.8+ features
4. Future-Proofing
- Use stable APIs (Block Bindings, Performance APIs)
- Implement backward compatibility for WordPress 6.5+
- Consider speculative loading and new security features
Current Status Summary (August 2025)
The @wordpress/create-block
tool has evolved significantly with version 4.71.0 (released August 10, 2025) providing:
- Complete wp-env integration for streamlined local development
- Advanced templating system supporting external packages and local templates
- Performance optimizations through manifest generation
- Deep WordPress 6.8 integration with new APIs
- Future-ready architecture for the annual release cycle
This comprehensive update makes @wordpress/create-block
the definitive tool for modern WordPress block development, especially as WordPress transitions to its new annual release schedule starting in 2025.
Follow Ryan Welcher to be up to date.
Leave a Reply