
Welcome to the WordPress Development Repository! For guidance on how to contribute to bug reports, patches, testing, documentation, or to get involved in any capacity, please refer to the contributor handbook.
Getting Started
Credentials
Before diving in, make sure to set up your environment.
Using GitHub Codespaces
To begin, create a codespace for this repository by clicking the button below:
Open in GitHub Codespaces
Once you open it, the codespace will launch in a web-based version of Visual Studio Code. The dev container is pre-configured with all necessary software for this project.
Note: Dev containers are an open standard supported by GitHub Codespaces and other tools.
Tip: In some browsers, the shortcut for opening the command palette (Ctrl/Command + Shift + P) may conflict with browser shortcuts. Instead, you can open the command palette by pressing F1 or clicking the cog icon in the bottom-left corner of the editor.
When you launch your codespace, allow the postCreateCommand
to complete to ensure WordPress is set up correctly. This might take a few minutes.
Local Development
WordPress is built with PHP, MySQL, and JavaScript, using Node for JavaScript dependencies. You can set up a local development environment to get started quickly.
You should be comfortable using the command line for setting up, starting, and stopping the environment, as well as running tests.
Make sure Node and npm are installed. Node is a JavaScript runtime for developer tools, and npm is its package manager. To install, you can use the package manager for your OS:
- macOS: brew install node
- Windows: choco install nodejs
- Ubuntu: apt install nodejs npm
If you're not using a package manager, download installers from the Node.js website.
Note: WordPress supports Node.js 14.x
and npm 6.x
only.
You’ll also need Docker installed and running, as it powers the local development environment. Install Docker as you would any other application.
Development Environment Commands
Make sure Docker is running before using these commands.
To Start the Development Environment for the First Time
1. Clone the repository:
git clone https://github.com/WordPress/wordpress-develop.git
2. Navigate to the repository folder:
cd wordpress-develop
3. Run the following commands:
npm install
npm run build:dev
npm run env:start
npm run env:install
Your WordPress site will be available at http://localhost:8889. Configuration settings can be adjusted in the .env file located in the root of the project directory.
To Watch for Changes
If you’re modifying WordPress core files, start the file watcher to build or copy the files as needed:
npm run dev
To stop the watcher, press Ctrl + C.
To Run a WP-CLI Command
Use the following command for WP-CLI tasks:
npm run env:cli -- <command>
For example, to get help:
npm run env:cli -- help
To Run Tests
You can run the PHP and end-to-end test suites with these commands:
1. PHP tests:
npm run test:php
2. End-to-end tests:
npm run test:e2e
To Restart the Development Environment
If you modify the configuration in the docker-compose.yml or .env files, restart the environment with:
npm run env:restart
To Stop the Development Environment
To save resources, stop the environment when not in use:
npm run env:stop
To Start the Development Environment Again
Starting the environment again is as simple as running:
npm run env:start
Credentials
Here are the default credentials for your environment:
1. Database Name:wordpress_develop
2. Username: root
3. Password: password
To log into the site, go to:
http://localhost:8889/wp-admin
- Username:
admin
- Password:
password
Note: When using Codespaces, access the site via the port-forwarded URL from the terminal’s ports tab and append /wp-admin
to log in.
To Generate a New Password (Recommended)
- Go to the Dashboard.
- In the left menu, click Users.
- Click Edit under the admin user.
- Scroll down and click Generate Password. Use this password (recommended) or change it, then click Update User.
If you use the generated password, be sure to save it in a secure place, like a password manager.