# Bedrock (WordPress)

> Bedrock: a modern WordPress boilerplate by Roots that manages dependencies with Composer and strictly separates code from content, to run WordPress like a real PHP app.

- **Category**: Technical
- **URL**: https://www.romaindelfosse.fr/en/glossary/bedrock/

---

**Bedrock** is a WordPress boilerplate developed and maintained by **Roots**, an American collective that builds modern tooling for WordPress. Its pitch is simple and radical: instead of accepting WordPress's historical structure — which mixes the core, plugins, uploads and configuration at the project root — Bedrock reorganizes everything so that WordPress can be managed like a professional PHP application, with Composer, environment variables and a strict separation between code and content.

## Technical definition

### The Bedrock structure

A Bedrock project looks like this:

```
project/
├── composer.json          # Dependencies: WordPress core + plugins + themes
├── composer.lock          # Locked versions
├── config/
│   ├── application.php    # Global configuration
│   └── environments/
│       ├── development.php
│       ├── staging.php
│       └── production.php
├── .env.example           # Expected environment variables
└── web/
    ├── app/               # Replaces wp-content
    │   ├── plugins/
    │   ├── themes/
    │   ├── mu-plugins/
    │   └── uploads/       # Mounted as a volume on a PaaS
    ├── wp/                # WordPress core (managed by Composer)
    ├── wp-config.php      # Loads the config from config/
    └── index.php
```

The project root doesn't expose the WordPress core — `web/` is the document root served by the web server. This structure prevents a whole class of information leaks tied to direct access to `/wp-config.php`, `/readme.html` or `/license.txt`.

### Composer as the package manager

Bedrock's most fundamental change is that **everything is a Composer dependency**: the WordPress core, every plugin (through the WPackagist proxy, which exposes the WordPress.org directory as Composer packages), and every theme. Installing a plugin means editing `composer.json` and running `composer install` again — not clicking around a dashboard. Updating WordPress means running `composer update roots/wordpress` — with a `composer.lock` that guarantees exact reproducibility across environments.

This approach also unlocks dependency auditing: `composer audit --locked` checks every package against the public CVE database. On a standard WordPress install, no equivalent tool covers plugins installed through the dashboard.

## Current challenges

### The limits of the approach

Bedrock is not a universal answer to WordPress. It requires a development discipline not every team has: you can no longer install a plugin in one click, the workflow goes through Git and Composer, and developers need to be comfortable on the command line. For an editorial team that just wants to add Yoast, that's real friction. Bedrock is for technical teams who want to treat WordPress as a serious development project, not for teams who want to keep the agility of the dashboard.

Bedrock also doesn't change WordPress at runtime: it's still the same engine, with the same bugs, the same potential vulnerabilities and the same reliance on the plugin ecosystem. Bedrock improves the engineering *around* WordPress, not WordPress itself.

## Practical applications

On a PaaS like Upsun, Fly.io or Platform.sh, Bedrock is practically the default structure: without Composer, without a code/content split and without environment variables, reproducible deployment just isn't achievable. I use Bedrock in [my experiment on securing WordPress with Infrastructure as Code](/en/blog/securiser-wordpress-sans-plugins-infrastructure-as-code/), which relies on this structure to decouple the security configuration from the application code.



## Frequently Asked Questions

### What is the difference between a standard WordPress install and a Bedrock one?

A standard WordPress install puts everything at the project root: the WordPress core, plugins, themes, uploads and configuration. It's easy to install but hard to version — what goes into Git? Only the custom plugins? Everything? Nothing? Bedrock solves the problem by reorganizing: the WordPress core lives in web/wp/, plugins and themes in web/app/, uploads are isolated, configuration is split into PHP files per environment (development, staging, production), and every dependency — including the core and the plugins — is managed with Composer.

### Is Bedrock compatible with every WordPress plugin?

Yes, 99% of the time. At runtime, Bedrock is still standard WordPress: plugins and themes from the WordPress.org directory work without changes. The one thing to watch is plugins that write directly into their own directory (some caching or security plugins) — on an immutable filesystem those writes fail, and you either have to reconfigure the plugin or mount a dedicated volume.

### Why is Bedrock popular in PaaS stacks?

Because it treats WordPress as a normal PHP application: with a composer.lock, environment variables, a clean split between code and content, and a wp-config.php that reads its configuration from getenv() instead of hard-coded constants. That structure is exactly what a modern PaaS (Upsun, Fly.io, Platform.sh) expects: reproducible builds, Git-based deployment, and no writes to the application filesystem at runtime.



## Resources

- [Bedrock — Official documentation](https://roots.io/bedrock/?utm_source=romaindelfosse&amp;utm_medium=glossaire&amp;utm_campaign=bedrock) — Roots

- [Bedrock — GitHub repository](https://github.com/roots/bedrock?utm_source=romaindelfosse&amp;utm_medium=glossaire&amp;utm_campaign=bedrock) — Roots

- [WordPress Packagist — Composer repository for WordPress plugins](https://wpackagist.org/?utm_source=romaindelfosse&amp;utm_medium=glossaire&amp;utm_campaign=bedrock) — WP Packagist

