Prerequisites
Before you begin, ensure you have the following installed:Required Software
Node.js and npm
Gutenberg requires Node.js v20 and npm v10. We recommend using Node Version Manager (nvm) for easy installation and management.
Git
Install Git for source control. You’ll also need a GitHub account to contribute.
Docker Desktop (Recommended)
Install Docker to use the Alternatively, you can use Local, WampServer, or MAMP.
wp-env package for local WordPress development.On Windows 10 Home Edition, follow the Docker installation instructions for WSL2.
Composer (for PHP development)
Install Composer for PHP dependency management and testing.
Optional Tools
- GitHub CLI: The GitHub CLI is helpful for checking out pull requests locally
- Python: Required for some install scripts (may be pre-installed on your OS)
Setting Up Your Development Environment
1. Fork and Clone the Repository
Fork the Repository
Go to the Gutenberg repository on GitHub and click Fork to create a copy in your account.
2. Install Dependencies and Build
3. Set Up Local WordPress Environment
Using wp-env (Recommended)
The@wordpress/env package provides a quick way to create a WordPress environment using Docker:
The
wp-env start command creates a Docker container with WordPress and automatically activates your local Gutenberg build as a plugin.- WordPress site:
http://localhost:8888 - Admin dashboard:
http://localhost:8888/wp-admin/- Username:
admin - Password:
password
- Username:
- phpMyAdmin:
http://localhost:9000
Using MAMP or Local
If you prefer MAMP or Local, create a symlink to the Gutenberg directory in yourwp-content/plugins/ directory:
Git Workflow
Gutenberg follows a standard pull request workflow:Create a Feature Branch
Create a new branch for your changes using a descriptive name with a prefix:Branch Naming Prefixes:
add/- Add a new featureupdate/- Update an existing featurefix/- Fix an existing issuetry/- Experimental featureremove/- Remove an existing feature
Make Your Changes
Make your code changes, following the coding guidelines. Test thoroughly.
Run Tests
Commit Your Changes
Commit with a good commit message:
Create a Pull Request
Go to your forked repository on GitHub. GitHub will automatically detect your new branch and offer to create a pull request. Click the link and fill out the PR template.
Keeping Your Branch Up to Date
When working on long-running pull requests, you’ll need to keep your branch up to date with the maintrunk branch:
Keeping Your Fork Synced
Regularly update your fork’strunk branch:
Coding Standards
JavaScript
- Follow WordPress JavaScript coding standards
- Use ESLint for linting (automatically configured)
- Use Prettier for formatting
PHP
- Follow WordPress PHP coding standards
- Use PHP_CodeSniffer for standards checking
Development Tools Setup
Visual Studio Code
We recommend configuring VS Code with the following extensions:EditorConfig
Install EditorConfig for VS Code to automatically match the project’s editor rules.ESLint
Install ESLint Extension and add to your settings:Prettier
Install Prettier - Code formatter and configure:TypeScript
TypeScript support is built into VS Code. The project uses TypeScript via JSDoc to type check JavaScript files.Pull Request Guidelines
Before Submitting
- Ensure all tests pass
- Fix all linting and formatting issues (enforced by CI)
- Write tests for new functionality
- Update documentation as needed
PR Best Practices
- Non-trivial PRs should be preceded by a related issue
- Keep PRs atomic—one conceptual change per PR
- Write descriptive PR titles that explain what is being fixed, not how
- Label your PR appropriately (e.g.,
[Type] Bug,[Type] Enhancement)
- ✅ Good: “Fix editor breakage when clicking copy block button”
- ❌ Bad: “Check for nullable object in component”
Getting Your PR Reviewed
If you’re having trouble getting your PR reviewed:- Make sure it’s properly labeled
- Ensure all CI checks pass
- Ask for review in the
#core-editorSlack channel - Tag relevant team members if appropriate
Key Directories
Understanding the repository structure:/packages/- JavaScript packages (each has README.md and CHANGELOG.md)/lib/- PHP code/lib/compat/wordpress-X.Y/- Version-specific features/phpunit/- PHP tests/docs/- Documentation/docs/contributors/- Contributing guides/docs/explanations/architecture/- System architecture/docs/how-to-guides/- Implementation tutorials/docs/reference-guides/- API documentation
Common Pitfalls
Additional Resources
Next Steps
Testing Guide
Learn how to write and run tests for your code
Browse Issues
Find good first issues to work on