Skip to content

Bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

Professional WordPress project structure

The organization of Bedrock is similar to putting WordPress in its own subdirectory but with some improvements, including renaming wp-content/ to app/.

Bedrock structure

├── composer.json ├── config │ ├── application.php # Primary wp-config │ └── environments │ ├── development.php │ ├── staging.php │ └── production.php ├── vendor # Composer dependencies └── web # Public document root ├── app # WordPress content dir │ ├── mu-plugins │ ├── plugins │ ├── themes │ └── uploads ├── wp-config.php ├── index.php └── wp # WordPress core

Standard WordPress structure

├── index.php ├── license.txt ├── readme.html ├── wp-activate.php ├── wp-admin ├── wp-blog-header.php ├── wp-comments-post.php ├── wp-config-sample.php ├── wp-content │ ├── index.php │ ├── plugins │ └── themes ├── wp-cron.php ├── wp-includes ├── wp-links-opml.php ├── wp-load.php ├── wp-login.php ├── wp-mail.php ├── wp-settings.php ├── wp-signup.php ├── wp-trackback.php └── xmlrpc.php
Bedrock
WordPress WordPress
Separate configs per environment
Environment variables
Custom wp-content directory
Composer for managing WordPress installation
Composer for managing WordPress plugins and themes
mu-plugins autoloader

Using Composer with WordPress

Bedrock is an ideal starting point for using Composer with WordPress. Manage your WordPress install and plugins with Composer, a PHP dependency manager. Composer will make development more reliable, help with team collaboration, and it helps maintain a better Git repository.

By default, Bedrock disables the ability for plugins and themes to be added, removed, or modified on non-development environments.

Environment specific configuration

Bedrock uses Dotenv to manage environment specific configuration. Setup different config values based on the environment your site is running in, from a directory structure that is easy to understand.

Enhanced WordPress security

Bedrock’s structure limits access to non-public files and offers more secure passwords through wp-password-bcrypt.

Sponsors

Help support our open-source development efforts

Built with Bedrock

Recommendations

I'm a big fan of Bedrock (and all of Roots in general)

Josh Koenig Josh Koenig

Bedrock is like the bridge between WordPress and the rest of PHP

Carl Alexander Carl Alexander

Roots' distros have been essential to jumping back into WordPress devel after a decade out. Until WP quits being an antiquated, monetized pit of code, this is all that’s holding my sanity in check.

Ross J Kuhn Ross J Kuhn

Bedrock is doing a huge service to the WordPress community, and I can see it being adopted as the standard for WordPress development. Hopefully as more people adopt it, the developer community at large will view WordPress sites on similar footing as more “professional” platforms.

Daniel Strunk Daniel Strunk

If you have to use WordPress, use Bedrock for your web app and Sage to develop your custom theme. Any Laravel developer will feel at home in these tools.

Rory McDaniel Rory McDaniel

I think 2 years ago I tweeted to y'all to say I love Sage -- now I'm getting started with Bedrock and loving it! thank you for making me feel like WordPress can be sane, secure, and modern.

Michael Snook Michael Snook