# WordPress Core via Composer

Packages for installing WordPress core via Composer. Choose the build that fits your project.

`roots/wordpress` is a meta-package that provides WordPress core installation via Composer. It's part of the [Roots](https://roots.io) WordPress packaging ecosystem, which includes several packages to give you flexibility in how WordPress is installed.

## Packages

| Package | Description | Includes |
| --- | --- | --- |
| [`roots/wordpress`](https://github.com/roots/wordpress) | Meta-package (recommended) | Installs `roots/wordpress-no-content` & `roots/wordpress-core-installer` |
| [`roots/wordpress-full`](https://github.com/roots/wordpress-full) | Full WordPress build | Core, official themes, Akismet & Hello Dolly, beta & RC releases |
| [`roots/wordpress-no-content`](https://github.com/roots/wordpress-no-content) | Minimal WordPress build | Core only — no themes, plugins, or beta releases |
| [`roots/wordpress-core-installer`](https://github.com/roots/wordpress-core-installer) | Composer plugin | Installs WordPress core outside of `vendor/` into a configurable directory |

## How packages are built

Packages are generated by [`roots/wordpress-packager`](https://github.com/roots/wordpress-packager), an open-source PHP tool that polls the [WordPress.org API](https://api.wordpress.org/core/version-check/1.7/) every 10 minutes for new releases.

- **Release detection** — new WordPress versions are compared against existing package tags before publishing.
- **Dist integrity** — packages reference official wordpress.org dist zips with SHA1 checksum verification.
- **Tested pipeline** — packager has a PHPUnit test suite, PHPStan at max level, and CI on every change.

## Core installer

[`roots/wordpress-core-installer`](https://github.com/roots/wordpress-core-installer) is a Composer plugin that installs WordPress core into a dedicated directory (default: `wordpress/`) instead of `vendor/`. This is required for WordPress to function properly, since it expects to run from its own directory.

The install directory can be customized in your `composer.json`:

```json
{
  "extra": {
    "wordpress-install-dir": "wp"
  }
}
```

## Getting started

Most projects should use `roots/wordpress`, which installs WordPress core without default themes or plugins. This is the recommended package for [Bedrock](https://roots.io/bedrock/) projects and modern WordPress development.

```sh
composer require roots/wordpress
```

## Example configurations

### Standard (recommended)

WordPress core without default themes or plugins. Manage your themes and plugins individually via Composer with [WP Packages](https://wp-packages.org/).

```json
{
  "repositories": [
    {
      "name": "wp-packages",
      "type": "composer",
      "url": "https://repo.wp-packages.org"
    }
  ],
  "require": {
    "composer/installers": "^2.2",
    "roots/wordpress": "^6.8",
    "wp-plugin/woocommerce": "^10.0",
    "wp-theme/twentytwentyfive": "^1.0"
  },
  "config": {
    "allow-plugins": {
      "composer/installers": true,
      "roots/wordpress-core-installer": true
    }
  }
}
```

### Full build

Includes default themes, Akismet, Hello Dolly, and beta/RC releases. Closest to a standard WordPress download.

```json
{
  "require": {
    "roots/wordpress-core-installer": "^3.0",
    "roots/wordpress-full": "^6.8"
  },
  "config": {
    "allow-plugins": {
      "roots/wordpress-core-installer": true
    }
  }
}
```

## Using Bedrock?

All of this is already configured for you. [Bedrock](https://roots.io/bedrock/) is a WordPress boilerplate with Composer, better configuration, and an improved folder structure.
