Skip to main content
This guide explains the structure of the Gutenberg repository to help you navigate the codebase effectively.

Root Files

Configuration Files

Build Configuration

Environment Configuration

Dependency Management

Documentation Files

Plugin Files

Key Directories

/packages/

Source code of WordPress packages. Each package can be:
  • Production packages: Shipped as WordPress scripts (e.g., wp-components, wp-editor)
  • Development tools: Available on npm (e.g., @wordpress/scripts, @wordpress/env)
Package Structure:

/lib/

PHP source code of the Gutenberg plugin.
Note: New PHP features targeting specific WordPress versions go in lib/compat/wordpress-X.Y/.

/phpunit/

Unit tests for PHP code:

/test/

JavaScript and end-to-end tests:

/docs/

Project documentation:

/bin/

Scripts and tools:

/platform-docs/

Documentation for non-WordPress developers using Gutenberg:

/storybook/

Configuration for Gutenberg Storybook.

/.github/

GitHub-specific configuration:

/tools/

Build and development tools:

Key Directories Reference

Quick reference for common development tasks:

Package Organization

Production Packages

Loaded as WordPress scripts (wp-* handles):
  • @wordpress/block-editor - Generic block editor (WordPress-agnostic)
  • @wordpress/editor - WordPress post-type-aware editor
  • @wordpress/edit-post - Full post editor screen
  • @wordpress/edit-site - Full site editor screen
  • @wordpress/components - Reusable UI components
  • @wordpress/data - State management

Development Packages

Available as npm packages:
  • @wordpress/scripts - Build and development scripts
  • @wordpress/env - Local WordPress environment
  • @wordpress/eslint-plugin - ESLint configuration
  • @wordpress/prettier-config - Prettier configuration

Block Library Structure

Blocks follow a specific file structure:

Style Files

  • style.scss - Loads on both frontend and in editor
  • editor.scss - Loads only in editor

Next Steps