-
GitHub stars
-
Projects created
-
roots/wordpress installs
WordPress boilerplate with Composer, easier configuration, and an improved folder structure
- Uses WordPress Core functionality for customizations
- Better Git integration for WordPress development
- Most widely used Composer-based WordPress setup
- Maintained for over 9 years
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 coding standards1 | ❌ | ✅ |
Traditional WordPress structure2 | ❌ | ✅ |
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 | ✅ | ❌ |
1. WordPress coding standards are not enforced by default, but can added if that is your preference | ||
2. Bedrock leverages functionality that WordPress Core provides and is compatible with most plugins |
Use 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.
Our roots/wordpress
package has been installed 13,059,092 times.
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)
Bedrock is like the bridge between WordPress and the rest of PHP
In my opinion, the roots.io toolkit is the most sane way to do WordPress in 2023
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.
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.
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.
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.
Subscribe for updates
Join over 8,000 subscribers on our newsletter to get the latest Roots updates and tips on building better WordPress sites
Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?