Block Pattern Generator

Convert raw HTML or blocks into PHP code to register a Block Pattern.

Block Pattern Configuration

Lowercase, hyphens only

Pattern HTML Content *

Paste your block HTML or Gutenberg block comments

Generated PHP Code

Usage: Add this code to your theme's functions.php file to register the block pattern.

Features

  • Convert HTML to WordPress block pattern
  • Generate register_block_pattern() code
  • Support for categories and keywords
  • Handles Gutenberg block comments
  • Ready to register in functions.php

How to Use

  1. Enter a unique pattern name (lowercase, hyphens)
  2. Provide a title and description
  3. Add categories and keywords for discoverability
  4. Paste your HTML or Gutenberg block markup
  5. Click "Generate Pattern Code"
  6. Copy and paste into your theme's functions.php