Skip to content

roots/wp-composer

WP Composer

Build status Follow Roots Sponsor Roots

A modern, community-funded Composer repository for WordPress plugins and themes.

Support us

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.

Sponsors

Carrot WordPress.com Itineris Kinsta

Package Naming

Type Convention Example
Plugin wp-plugin/plugin-name wp-plugin/woocommerce
Theme wp-theme/theme-name wp-theme/twentytwentyfive

Usage

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 of vendor/
  • extra.installer-paths — maps package types to your WordPress content directory (adjust paths to match your project structure)
  • extra.wordpress-install-dir — tells roots/wordpress-core-installer where to install WordPress core

Roots WordPress Packages

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
    }
  }
}

Migrating from WPackagist

  1. Remove wpackagist packages: composer remove wpackagist-plugin/woocommerce
  2. Update your repository URL in composer.json (see above)
  3. 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

Community

About

A modern, community-funded Composer repository for WordPress plugins and themes

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors