A modern, community-funded Composer repository for WordPress plugins and themes.
We're dedicated to pushing modern WordPress development forward through our open source projects, and we need your support to keep building. You can support our work by purchasing Radicle, our recommended WordPress stack, or by sponsoring us on GitHub. Every contribution directly helps us create better tools for the WordPress ecosystem.
| Type | Convention | Example |
|---|---|---|
| Plugin | wp-plugin/plugin-name |
wp-plugin/woocommerce |
| Theme | wp-theme/theme-name |
wp-theme/twentytwentyfive |
Add the repository to your composer.json:
{
"repositories": [
{
"name": "wp-composer",
"type": "composer",
"url": "https://repo.wp-composer.com",
"only": ["wp-plugin/*", "wp-theme/*"]
}
],
"require": {
"composer/installers": "^2.2",
"wp-plugin/woocommerce": "^10.0",
"wp-theme/twentytwentyfive": "^1.0"
},
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
},
"config": {
"allow-plugins": {
"composer/installers": true,
"roots/wordpress-core-installer": true
}
}
}composer/installers— installs plugins and themes into their correct WordPress directories instead ofvendor/extra.installer-paths— maps package types to your WordPress content directory (adjust paths to match your project structure)extra.wordpress-install-dir— tellsroots/wordpress-core-installerwhere to install WordPress core
WP Composer is built by Roots and is the recommended repository for use alongside the Roots WordPress packaging ecosystem:
| Package | Description |
|---|---|
roots/wordpress |
Meta-package for installing WordPress core via Composer |
roots/wordpress-full |
Full WordPress build (core + default themes + plugins + betas) |
roots/wordpress-no-content |
Minimal WordPress build (core only) |
roots/bedrock |
WordPress boilerplate with Composer, better config, and improved structure |
A typical Bedrock project uses roots/wordpress for WordPress core and WP Composer for plugins and themes:
{
"repositories": [
{
"name": "wp-composer",
"type": "composer",
"url": "https://repo.wp-composer.com",
"only": ["wp-plugin/*", "wp-theme/*"]
}
],
"require": {
"composer/installers": "^2.2",
"roots/wordpress": "^6.9",
"wp-plugin/woocommerce": "^10.0",
"wp-plugin/turn-comments-off": "^2.0"
},
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
},
"config": {
"allow-plugins": {
"composer/installers": true,
"roots/wordpress-core-installer": true
}
}
}- Remove wpackagist packages:
composer remove wpackagist-plugin/woocommerce - Update your repository URL in
composer.json(see above) - Add with new naming:
composer require wp-plugin/woocommerce
Or use the migration script to automatically update your composer.json:
curl -sO https://raw.githubusercontent.com/roots/wp-composer/main/scripts/migrate-from-wpackagist.sh && bash migrate-from-wpackagist.sh- Join us on Discord by sponsoring us on GitHub
- Join us on Roots Discourse
- Follow @rootswp on Twitter
- Follow the Roots Blog
- Subscribe to the Roots Newsletter