PHPackages                             wp-spaghetti/wp-boot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wp-spaghetti/wp-boot

ActiveProject

wp-spaghetti/wp-boot
====================

WP Boot is a lightweight Composer-based WordPress management system

v1.2.0(1mo ago)010GPL-3.0-or-laterPHPPHP &gt;=8.1CI passing

Since Dec 21Pushed 1mo agoCompare

[ Source](https://github.com/wp-spaghetti/wp-boot)[ Packagist](https://packagist.org/packages/wp-spaghetti/wp-boot)[ Fund](https://buymeacoff.ee/frugan)[ RSS](/packages/wp-spaghetti-wp-boot/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (13)Versions (8)Used By (0)

[![PHP Version](https://camo.githubusercontent.com/8c5270b6063c5e16d0a74934926d935d831b3abf6ce715b4189ce7121a1d09cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/8c5270b6063c5e16d0a74934926d935d831b3abf6ce715b4189ce7121a1d09cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d626f6f74)[![Packagist Downloads](https://camo.githubusercontent.com/f23c0d0e1ae358ee192dae5f1f73e464549c55aabfdb7093b1a39f708fcd506c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/f23c0d0e1ae358ee192dae5f1f73e464549c55aabfdb7093b1a39f708fcd506c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d626f6f74)[![Packagist Stars](https://camo.githubusercontent.com/5e37c42e95cf36385a75abe8c87e93598860d684163fb5bcb2c9a78926f707d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/5e37c42e95cf36385a75abe8c87e93598860d684163fb5bcb2c9a78926f707d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d626f6f74)[![GitHub Actions Workflow Status](https://github.com/wp-spaghetti/wp-boot/actions/workflows/release.yml/badge.svg)](https://github.com/wp-spaghetti/wp-boot/actions/workflows/release.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/154a9240be71c1ca39ca85be53c277c06e5919f63c1b68046e89f28456985db2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/154a9240be71c1ca39ca85be53c277c06e5919f63c1b68046e89f28456985db2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d626f6f74)[![Known Vulnerabilities](https://camo.githubusercontent.com/3420b606e990c6b9674968d076363947844699fe41546c2c5be71768d91308af/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d626f6f742f62616467652e737667)](https://camo.githubusercontent.com/3420b606e990c6b9674968d076363947844699fe41546c2c5be71768d91308af/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d626f6f742f62616467652e737667)[![GitHub Issues](https://camo.githubusercontent.com/fc5f3ab5a5727efda6c1841a8fd00086a30d2675c4ebee0e162a713140f01a61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/fc5f3ab5a5727efda6c1841a8fd00086a30d2675c4ebee0e162a713140f01a61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d626f6f74)

[![GitHub Release](https://camo.githubusercontent.com/d1a7ed2fc9252fb4c31b0ea8ae34c7c978b8127a745c9c7779ac86768e5ef371/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/d1a7ed2fc9252fb4c31b0ea8ae34c7c978b8127a745c9c7779ac86768e5ef371/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d626f6f74)[![License](https://camo.githubusercontent.com/3fb6c1fec0076689475e9e97001c1e40cab111b9d466d92ab57504daf937303d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d626f6f74)](https://camo.githubusercontent.com/3fb6c1fec0076689475e9e97001c1e40cab111b9d466d92ab57504daf937303d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d626f6f74)

WP Boot
=======

[](#wp-boot)

**WP Boot** is a lightweight Composer-based WordPress management system designed for scenarios where you need to manage an existing WordPress installation without restructuring its directory layout.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Composer
- **rsync** - Used to sync WordPress core files from vendor to public directory

Why WP Boot?
------------

[](#why-wp-boot)

While robust solutions like [Bedrock](https://roots.io/bedrock/), [WP Starter](https://github.com/wecodemore/wpstarter), and [Wordplate](https://github.com/vinkla/wordplate) offer excellent WordPress management through Composer, they typically require significant structural changes to the WordPress directory layout.

WP Boot was created for situations where:

- You're working with an **existing WordPress installation** that cannot be heavily modified
- You need to **version control** an already-deployed WordPress site
- You want to **dockerize** a traditional WordPress setup without restructuring
- You need a quick, minimal-impact solution for dependency management

How It Works
------------

[](#how-it-works)

WP Boot uses **rsync** to synchronize WordPress core files from the Composer vendor directory to your public directory, keeping the standard WordPress structure intact.

It only modifies the `wp-config.php` file, adding a simple bootstrap block:

```
// BEGIN WP Boot - Do not remove this block
// @see https://github.com/wp-spaghetti/wp-boot
use function Env\env;

require_once dirname(__DIR__).'/private/wp-boot/bootstrap.php';
// END WP Boot - Do not remove this block

define('DB_NAME', env('DB_NAME'));
define('DB_USER', env('DB_USER'));
define('DB_PASSWORD', env('DB_PASSWORD'));
define('DB_HOST', env('DB_HOST'));
```

This approach allows you to:

- Manage WordPress core, plugins, and themes via Composer
- Use environment variables for configuration (`.env` files)
- Keep the standard WordPress directory structure intact

Installation
------------

[](#installation)

```
composer create-project wp-spaghetti/wp-boot private/wp-boot
cd private/wp-boot
cp .env.dist .env
# Edit .env with your configuration
# IMPORTANT: Set WP_BOOT_SYNC_ENABLED=true to enable WordPress sync
```

**Note:** During `composer create-project`, WordPress core will be downloaded to `vendor/wordpress/`, but files will **not** be synced to your `public/` directory until you set `WP_BOOT_SYNC_ENABLED=true` in your `.env` file.

This gives you time to:

1. Review and configure your `.env` file
2. Verify the target `public/` directory exists and is correct
3. Decide when to sync WordPress files

Once configured, run:

```
composer install  # or composer update
```

This will trigger the sync script and copy WordPress core files to `../../public/`.

Then add the bootstrap block to your `wp-config.php` file (see "How It Works" section above).

### Directory Structure

[](#directory-structure)

After installation, your project structure will look like this:

```
your-project/
├── private/
│   └── wp-boot/
│       ├── vendor/
│       │   └── wordpress/          # WordPress core managed by Composer
│       ├── .env                     # Environment configuration
│       ├── bootstrap.php
│       ├── composer.json
│       └── post-cmd.sh              # rsync sync script
└── public/                          # Your WordPress public directory
    ├── wp-admin/                    # Synced from vendor/wordpress
    ├── wp-includes/                 # Synced from vendor/wordpress
    ├── wp-content/
    │   ├── plugins/                 # Managed by Composer
    │   ├── themes/                  # Managed by Composer
    │   └── uploads/                 # User uploads (not managed)
    ├── wp-config.php                # Modified to include bootstrap
    └── index.php                    # Synced from vendor/wordpress

```

The `post-cmd.sh` script automatically syncs WordPress core files from `private/wp-boot/vendor/wordpress/` to `public/` after every `composer install` or `composer update`.

Optional: Installing Language Packs
-----------------------------------

[](#optional-installing-language-packs)

WP Boot includes [WP Translation Downloader](https://github.com/inpsyde/wp-translation-downloader), a Composer plugin that automatically downloads translations from the WordPress.org API for all installed WordPress packages (core, plugins, and themes).

**1. Add your desired languages to `composer.json`:**

In the `extra.wp-translation-downloader.languages` array, add the locale codes you need:

```
{
  "extra": {
    "wp-translation-downloader": {
      "languages": [
        "it_IT"
      ]
    }
  }
}
```

Then run `composer update` — translations will be automatically downloaded to `public/wp-content/languages/`.

**2. Configure WordPress to use the language in `.env`:**

```
WPLANG=it_IT
```

For more information:

Optional: Disallow Search Engine Indexing in Non-Production
-----------------------------------------------------------

[](#optional-disallow-search-engine-indexing-in-non-production)

WordPress 5.5+ includes native environment detection via `WP_ENVIRONMENT_TYPE`. Wp-boot automatically sets this based on your `WP_ENV` value in `.env`.

To prevent search engines from indexing staging/development sites, create this file:

**`public/wp-content/mu-plugins/disallow-indexing.php`**

```
