Skip to navigation
Why Bedrock is more secure than a standard WordPress install
28.10.26
### When comparing Bedrock to a standard WordPress installation, it is important to understand that **Bedrock is not a replacement for WordPress; it is a modern boilerplate/framework for managing WordPress.** Bedrock (developed by the team at Roots.io) changes the way WordPress is structured and deployed. Here is why it is considered significantly more secure than a "standard" WordPress install: #### 1. Environment Variables (.env) In a standard WordPress install, sensitive information like database credentials, API keys, and salts are stored in `wp-config.php`. This file is often committed to version control (like GitHub), which can lead to accidental leaks of credentials. * **Bedrock approach:** It uses a `.env` file to store environment-specific configuration. This file is **never** committed to version control. It keeps your secrets strictly separated from your codebase, making it much harder for attackers to find your credentials if your repository is compromised. #### 2. Improved Directory Structure A standard WordPress install places the `wp-content` folder inside the root directory, which exposes many files to the public web server. * **Bedrock approach:** It moves the entire WordPress core into a sub-directory called `/wp`. The web server is then pointed to a `/web` folder. This means that files like `wp-config.php`, `.env`, and your version control folders are **outside the web root**. An attacker cannot browse to `yourdomain.com/wp-config.php` because that file is physically inaccessible to the browser. #### 3. Dependency Management with Composer Standard WordPress installations often involve manually downloading plugins or themes, or updating them via the dashboard. This can lead to "plugin bloat" and inconsistent versions across environments. * **Bedrock approach:** It uses **Composer**, a PHP dependency manager. You define your plugins and themes in a `composer.json` file. This ensures that every developer on your team is using the exact same version of every plugin. It also makes it easier to audit your dependencies and ensure that you aren't running outdated, vulnerable versions of plugins. #### 4. Enforced Security Best Practices Bedrock is designed with "12-Factor App" methodology in mind. It forces you to adopt professional workflows: * **No file editing in the dashboard:** Because Bedrock manages plugins via Composer, you cannot (and should not) install or edit plugins directly through the WordPress admin dashboard. This prevents attackers from using the "Plugin Editor" or "Theme Editor" to inject malicious code into your site if they manage to gain administrative access. * **Separation of Concerns:** By separating the core, the configuration, and the content, you reduce the "attack surface" of the site. #### 5. Better Deployment Workflows Because Bedrock is built for version control (Git), it encourages a professional deployment pipeline (e.g., Local -> Staging -> Production). * In a standard install, people often make changes directly on the live site. This is a security nightmare. * With Bedrock, you make changes in your local environment, commit them to Git, and deploy them. This allows you to test updates in a safe environment before they go live, reducing the chance of breaking the site or introducing a vulnerability. ### Summary Comparison | Feature | Standard WordPress | Bedrock | | :--- | :--- | :--- | | **Credentials** | Stored in `wp-config.php` | Stored in `.env` (not in Git) | | **File Structure** | Root-level exposure | Core moved to `/wp` subfolder | | **Updates** | Manual / Dashboard | Managed via Composer | | **Security** | Vulnerable to file editing | File editing disabled by design | | **Deployment** | Often manual/FTP | Git-based / Automated | ### Is it "more secure"? **Yes, but with a caveat.** Bedrock is more secure because it **removes the human error** associated with standard WordPress management. It forces you to follow secure practices by default. However, Bedrock does not protect you from a poorly coded plugin or a weak administrator password. You still need to maintain good security hygiene, but Bedrock provides a much stronger foundation to build upon.
Reply
Anonymous
Information Epoch 1793285726
Use lower case and keep it short.
Home
Notebook
Contact us